|
foundry-0.9.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--foundry.classutils.ClassUtilities
A collection of methods useful for Classes.
| Constructor Summary | |
private |
ClassUtilities()
Constructs a new ClassUtilities object. |
| Method Summary | |
static Set |
getAllFields(Class c)
Returns all Fields in the supplied Class and all
of its superclasses. |
static Set |
getAllFields(Class c,
Class stop)
Returns all Fields in the supplied Class and all
of its superclasses, up to but not including the superclass
identified by the stop parameter. |
static Set |
getAllFieldsWithReturnType(Class c,
Class type,
Class stop,
boolean excludeStatics)
Returns all Fields in the supplied Class (and all
of its superclasses up to but not including the superclass
identified by the stop parameter) that are of the
supplied data type. |
static URL |
getClasspathLocation(Class c)
Returns the classpath URL from which the supplied Class was loaded. |
private static URL |
getOfficialClasspathLocation(Class c)
Returns the classpath URL from which the supplied Class was loaded, as computed using ProtectionDomains
and CodeSources. |
static void |
main(String[] args)
Convenience method; allows use of the ClassUtilities
class as a program. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
private ClassUtilities()
ClassUtilities object. Since all
publicly accessible methods in this class are
static, this method should never be called.| Method Detail |
private static final URL getOfficialClasspathLocation(Class c)
URL from which the supplied Class was loaded, as computed using ProtectionDomains
and CodeSources.c - the Class whose classpath location is to be
computednull if the
official classpath location could not be computedpublic static final URL getClasspathLocation(Class c)
URL from which the supplied Class was loaded.c - the Class whose classpath location is to be computednull if the
classpath location could not be determined
public static final Set getAllFields(Class c)
throws SecurityException
Fields in the supplied Class and all
of its superclasses.c - the Class whose Fields should be
returned; must not be nullSet consisting of Field objects in an
indeterminate orderSecurityException - if the current SecurityManager determines that reflection is not allowedClass.getFields(),
Class.getDeclaredFields()
public static final Set getAllFields(Class c,
Class stop)
throws SecurityException
Fields in the supplied Class and all
of its superclasses, up to but not including the superclass
identified by the stop parameter.c - the Class whose Fields should be
returned; must not be nullstop - the superclass whose Fields (and whose
ancestors' Fields) should not be included in the
return value; if null then the entire superclass
chain will be examinedSet consisting of Field objects in an
indeterminate orderSecurityException - if the current SecurityManager determines that reflection is not allowedClass.getFields(),
Class.getDeclaredFields()
public static final Set getAllFieldsWithReturnType(Class c,
Class type,
Class stop,
boolean excludeStatics)
throws SecurityException
Fields in the supplied Class (and all
of its superclasses up to but not including the superclass
identified by the stop parameter) that are of the
supplied data type. Static fields can be excluded from the result.c - the Class whose Fields should be
returned; must not be nulltype - the Class of the data type that the data type
of all Fields to be returned must be instances of; if
null then no data type filtering will be performedstop - the superclass whose Fields (and whose
ancestors' Fields) should not be included in the
return value; if null then the entire superclass
chain will be examinedexcludeStatics - exclude static Fields from the
result if trueSet consisting of Field objects in an
indeterminate orderSecurityException - if the current SecurityManager determines that reflection is not allowedClass.getFields(),
Class.getDeclaredFields()
public static final void main(String[] args)
throws Exception
ClassUtilities
class as a program. For each class name supplied as an argument,
prints the classpath location from which that class was loaded.args - the command line argumentsException - if an error was encountered
|
foundry-0.9.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||