|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ClassLoaderHelper>
com.amazonaws.util.ClassLoaderHelper
public enum ClassLoaderHelper
Method Summary | |
---|---|
static java.net.URL |
getResource(java.lang.String resource,
boolean classesFirst,
java.lang.Class<?>... classes)
If classesFirst is false, retrieves the resource via the context class loader of the current thread, and if not found, via the class loaders of the optionally specified classes in the order of their specification, and if not found, from the class loader of ClassLoaderHelper as the
last resort. |
static java.net.URL |
getResource(java.lang.String resource,
java.lang.Class<?>... classes)
Retrieves the resource via the context class loader of the current thread, and if not found, via the class loaders of the optionally specified classes in the order of their specification, and if not found, from the class loader of ClassLoaderHelper as the last
resort. |
static java.io.InputStream |
getResourceAsStream(java.lang.String resource,
boolean classesFirst,
java.lang.Class<?>... classes)
If classesFirst is false, retrieves the resource as an input stream via the context class loader of the current thread, and if not found, via the class loaders of the optionally specified classes in the order of their specification, and if not found, from the class loader of ClassLoaderHelper as the last resort. |
static java.io.InputStream |
getResourceAsStream(java.lang.String resource,
java.lang.Class<?>... classes)
Retrieves the resource as an input stream via the context class loader of the current thread, and if not found, via the class loaders of the optionally specified classes in the order of their specification, and if not found, from the class loader of ClassLoaderHelper as the last resort. |
static java.lang.Class<?> |
loadClass(java.lang.String fqcn,
boolean classesFirst,
java.lang.Class<?>... classes)
If classesFirst is false, loads the class via the context class loader of the current thread, and if not found, via the class loaders of the optionally specified classes in the order of their specification, and if not found, from the caller class loader as the last resort. |
static java.lang.Class<?> |
loadClass(java.lang.String fqcn,
java.lang.Class<?>... classes)
Loads the class via the optionally specified classes in the order of their specification, and if not found, via the context class loader of the current thread, and if not found, from the caller class loader as the last resort. |
static ClassLoaderHelper |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static ClassLoaderHelper[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static ClassLoaderHelper[] values()
for (ClassLoaderHelper c : ClassLoaderHelper.values()) System.out.println(c);
public static ClassLoaderHelper valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic static java.net.URL getResource(java.lang.String resource, java.lang.Class<?>... classes)
ClassLoaderHelper
as the last
resort.
resource
- resource to be loadedclasses
- class loader providers
public static java.net.URL getResource(java.lang.String resource, boolean classesFirst, java.lang.Class<?>... classes)
ClassLoaderHelper
as the
last resort.
If classesFirst is true, retrieves the resource via the optionally
specified classes in the order of their specification, and if not found,
via the context class loader of the current thread, and if not found,
from the class loader of ClassLoaderHelper
as the last resort.
resource
- resource to be loadedclassesFirst
- true if the class loaders of the optionally specified classes
take precedence over the context class loader of the current
thread; false if the opposite is true.classes
- class loader providers
public static java.lang.Class<?> loadClass(java.lang.String fqcn, java.lang.Class<?>... classes) throws java.lang.ClassNotFoundException
fqcn
- fully qualified class name of the target class to be loadedclasses
- class loader providers
java.lang.ClassNotFoundException
- if failed to load the classpublic static java.lang.Class<?> loadClass(java.lang.String fqcn, boolean classesFirst, java.lang.Class<?>... classes) throws java.lang.ClassNotFoundException
If classesFirst is true, loads the class via the optionally specified classes in the order of their specification, and if not found, via the context class loader of the current thread, and if not found, from the caller class loader as the last resort.
fqcn
- fully qualified class name of the target class to be loadedclassesFirst
- true if the class loaders of the optionally specified classes
take precedence over the context class loader of the current
thread; false if the opposite is true.classes
- class loader providers
java.lang.ClassNotFoundException
- if failed to load the classpublic static java.io.InputStream getResourceAsStream(java.lang.String resource, java.lang.Class<?>... classes)
ClassLoaderHelper
as the last resort.
resource
- resource to be loadedclasses
- class loader providers
public static java.io.InputStream getResourceAsStream(java.lang.String resource, boolean classesFirst, java.lang.Class<?>... classes)
ClassLoaderHelper
as the last resort.
If classesFirst is true, retrieves the resource as an input stream via
the optionally specified classes in the order of their specification, and
if not found, via the context class loader of the current thread, and if
not found, from the class loader of ClassLoaderHelper
as the last
resort.
resource
- resource to be loadedclassesFirst
- true if the class loaders of the optionally specified classes
take precedence over the context class loader of the current
thread; false if the opposite is true.classes
- class loader providers
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |