当前位置: 首页>>代码示例>>Java>>正文


Java ClassFinder类代码示例

本文整理汇总了Java中com.sun.beans.finder.ClassFinder的典型用法代码示例。如果您正苦于以下问题:Java ClassFinder类的具体用法?Java ClassFinder怎么用?Java ClassFinder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClassFinder类属于com.sun.beans.finder包,在下文中一共展示了ClassFinder类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findCustomizerClass

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
private static Class<?> findCustomizerClass(Class<?> type) {
    String name = type.getName() + "Customizer";
    try {
        type = ClassFinder.findClass(name, type.getClassLoader());
        // Each customizer should inherit java.awt.Component and implement java.beans.Customizer
        // according to the section 9.3 of JavaBeans&trade; specification
        if (Component.class.isAssignableFrom(type) && Customizer.class.isAssignableFrom(type)) {
            return type;
        }
    }
    catch (Exception exception) {
        // ignore any exceptions
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:Introspector.java

示例2: instantiate

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Try to create an instance of a named class.
 * First try the classloader of "sibling", then try the system
 * classloader then the class loader of the current Thread.
 */
static Object instantiate(Class<?> sibling, String className)
             throws InstantiationException, IllegalAccessException,
                                            ClassNotFoundException {
    // First check with sibling's classloader (if any).
    ClassLoader cl = sibling.getClassLoader();
    Class<?> cls = ClassFinder.findClass(className, cl);
    return cls.newInstance();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Introspector.java

示例3: resolveClass

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Use the given ClassLoader rather than using the system class
 */
@SuppressWarnings("rawtypes")
protected Class resolveClass(ObjectStreamClass classDesc)
    throws IOException, ClassNotFoundException {

    String cname = classDesc.getName();
    return ClassFinder.resolveClass(cname, this.loader);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:Beans.java

示例4: findClass

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Resolves class by name using current class loader.
 * This method handles exception using current exception listener.
 *
 * @param name  the name of the class
 * @return the object that represents the class
 */
public Class<?> findClass(String name) {
    try {
        return ClassFinder.resolveClass(name, getClassLoader());
    }
    catch (ClassNotFoundException exception) {
        handleException(exception);
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:DocumentHandler.java

示例5: instantiate

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Try to create an instance of a named class.
 * First try the classloader of "sibling", then try the system
 * classloader then the class loader of the current Thread.
 */
@SuppressWarnings("deprecation")
static Object instantiate(Class<?> sibling, String className)
             throws InstantiationException, IllegalAccessException,
                    NoSuchMethodException, InvocationTargetException,
                                            ClassNotFoundException {
    // First check with sibling's classloader (if any).
    ClassLoader cl = sibling.getClassLoader();
    Class<?> cls = ClassFinder.findClass(className, cl);
    return cls.newInstance();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:Introspector.java

示例6: instantiate

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Try to create an instance of a named class.
 * First try the classloader of "sibling", then try the system
 * classloader then the class loader of the current Thread.
 */
static Object instantiate(Class sibling, String className)
             throws InstantiationException, IllegalAccessException,
                                            ClassNotFoundException {
    // First check with sibling's classloader (if any).
    ClassLoader cl = sibling.getClassLoader();
    Class cls = ClassFinder.findClass(className, cl);
    return cls.newInstance();
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:14,代码来源:Introspector.java

示例7: resolveClass

import com.sun.beans.finder.ClassFinder; //导入依赖的package包/类
/**
 * Use the given ClassLoader rather than using the system class
 */
protected Class resolveClass(ObjectStreamClass classDesc)
    throws IOException, ClassNotFoundException {

    String cname = classDesc.getName();
    return ClassFinder.resolveClass(cname, this.loader);
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:10,代码来源:Beans.java


注:本文中的com.sun.beans.finder.ClassFinder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。