public CompactedObjectInputStream(InputStream in, ClassLoader cl) throws IOException { super(in); mClassLoader = cl == null ? ClassHelper.getClassLoader() : cl; }
public CompactedObjectInputStream(InputStream in, ClassLoader cl) throws IOException { super(in); mClassLoader = cl == null ? ClassHelper.getClassLoader() : cl; }
private static ClassLoader findClassLoader() { return ClassHelper.getClassLoader(ExtensionLoader.class); }
private static ClassLoader findClassLoader() { return ClassHelper.getClassLoader(ExtensionLoader.class); }
/** * Return the default ClassLoader to use: typically the thread context * ClassLoader, if available; the ClassLoader that loaded the ClassUtils * class will be used as fallback. * <p> * Call this method if you intend to use the thread context ClassLoader in a * scenario where you absolutely need a non-null ClassLoader reference: for * example, for class path resource loading (but not necessarily for * <code>Class.forName</code>, which accepts a <code>null</code> ClassLoader * reference as well). * * @return the default ClassLoader (never <code>null</code>) * @see java.lang.Thread#getContextClassLoader() */ public static ClassLoader getClassLoader() { return getClassLoader(ClassHelper.class); }
/** * Return the default ClassLoader to use: typically the thread context * ClassLoader, if available; the ClassLoader that loaded the ClassUtils * class will be used as fallback. * <p> * Call this method if you intend to use the thread context ClassLoader in a * scenario where you absolutely need a non-null ClassLoader reference: for * example, for class path resource loading (but not necessarily for * <code>Class.forName</code>, which accepts a <code>null</code> ClassLoader * reference as well). * * @return the default ClassLoader (never <code>null</code>) * @see java.lang.Thread#getContextClassLoader() */ public static ClassLoader getClassLoader() { return getClassLoader(ClassHelper.class); }
/** * desc to class. * "[Z" => boolean[].class * "[[Ljava/util/Map;" => java.util.Map[][].class * * @param desc desc. * @return Class instance. * @throws ClassNotFoundException */ public static Class<?> desc2class(String desc) throws ClassNotFoundException { return desc2class(ClassHelper.getClassLoader(), desc); }
/** * Same as <code>Class.forName()</code>, except that it works for primitive * types. */ public static Class<?> forName(String name) throws ClassNotFoundException { return forName(name, getClassLoader()); }
/** * name to class. * "boolean" => boolean.class * "java.util.Map[][]" => java.util.Map[][].class * * @param name name. * @return Class instance. */ public static Class<?> name2class(String name) throws ClassNotFoundException { return name2class(ClassHelper.getClassLoader(), name); }
/** * desc to class. * "[Z" => boolean[].class * "[[Ljava/util/Map;" => java.util.Map[][].class * * @param desc desc. * @return Class instance. * @throws ClassNotFoundException */ public static Class<?> desc2class(String desc) throws ClassNotFoundException { return desc2class(ClassHelper.getClassLoader(), desc); }
/** * get class array instance. * * @param desc desc. * @return Class class array. * @throws ClassNotFoundException */ public static Class<?>[] desc2classArray(String desc) throws ClassNotFoundException { Class<?>[] ret = desc2classArray(ClassHelper.getClassLoader(), desc); return ret; }
/** * name to class. * "boolean" => boolean.class * "java.util.Map[][]" => java.util.Map[][].class * * @param name name. * @return Class instance. */ public static Class<?> name2class(String name) throws ClassNotFoundException { return name2class(ClassHelper.getClassLoader(), name); }
/** * get class array instance. * * @param desc desc. * @return Class class array. * @throws ClassNotFoundException */ public static Class<?>[] desc2classArray(String desc) throws ClassNotFoundException { Class<?>[] ret = desc2classArray(ClassHelper.getClassLoader(), desc); return ret; }
/** * Same as <code>Class.forName()</code>, except that it works for primitive * types. */ public static Class<?> forName(String name) throws ClassNotFoundException { return forName(name, getClassLoader()); }
/** * Get proxy. * * @param ics interface class array. * @return Proxy instance. */ public static Proxy getProxy(Class<?>... ics) { return getProxy(ClassHelper.getClassLoader(Proxy.class), ics); }
/** * Get proxy. * * @param ics interface class array. * @return Proxy instance. */ public static Proxy getProxy(Class<?>... ics) { return getProxy(ClassHelper.getClassLoader(Proxy.class), ics); }
public Class<?> toClass() { return toClass(ClassHelper.getClassLoader(ClassGenerator.class), getClass().getProtectionDomain()); }
public Class<?> toClass() { return toClass(ClassHelper.getClassLoader(ClassGenerator.class), getClass().getProtectionDomain()); }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (isGeneric() || (getConsumer() != null && getConsumer().isGeneric())) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, ClassHelper.getClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (isGeneric() || (getConsumer() != null && getConsumer().isGeneric())) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, ClassHelper.getClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }