public class ReflectorMap
extends java.lang.Object
| Constructor and Description |
|---|
ReflectorMap(java.util.ArrayList<java.lang.String> packageNames)
Deprecated.
since 1.2; use
ReflectorMap(Collection) instead |
ReflectorMap(java.util.Collection<java.lang.String> packageNames) |
ReflectorMap(java.lang.String... packageNames) |
ReflectorMap(java.lang.String packageName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReflect(java.lang.Class<?> type) |
boolean |
canReflect(java.lang.Object object) |
boolean |
canReflect(java.lang.Package thePackage) |
java.util.Set<java.lang.Object> |
discoverObjects(java.util.Collection<?> roots)
Discovers all objects reachable from the
roots and within the packages specified in the constructor. |
void |
discoverObjects(java.util.Collection<?> roots,
java.util.Set<java.lang.Object> out)
Discovers all objects reachable from the
roots and within the packages specified in the constructor. |
java.util.Set<java.lang.Object> |
discoverObjects(java.lang.Object... roots)
Discovers all objects reachable from the
roots and within the packages specified in the constructor. |
java.util.Set<java.lang.Object> |
discoverObjects(java.lang.Object root)
Discovers all objects reachable from the
root and within the packages specified in the constructor. |
void |
discoverObjects(java.lang.Object[] roots,
java.util.Set<java.lang.Object> out)
Discovers all objects reachable from the
roots and within the packages specified in the constructor. |
void |
discoverObjects(java.lang.Object root,
java.util.Set<java.lang.Object> out)
Discovers all objects reachable from the
root and within the packages specified in the constructor. |
Reflector |
getReflector(java.lang.Class<?> clazz) |
Reflector |
getReflector(java.lang.Object object) |
Reflector |
getReflector(java.lang.String simpleName) |
public ReflectorMap(java.lang.String packageName)
packageName - the package name to search for classespublic ReflectorMap(java.lang.String... packageNames)
packageNames - the package names to search for classespublic ReflectorMap(java.util.Collection<java.lang.String> packageNames)
packageNames - the package names to search for classes@Deprecated public ReflectorMap(java.util.ArrayList<java.lang.String> packageNames)
ReflectorMap(Collection) insteadpackageNames - the package names to search for classespublic java.util.Set<java.lang.Object> discoverObjects(java.lang.Object root)
root and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.root - the root objectpublic java.util.Set<java.lang.Object> discoverObjects(java.lang.Object... roots)
roots and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.roots - the root objectspublic java.util.Set<java.lang.Object> discoverObjects(java.util.Collection<?> roots)
roots and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.roots - the root objectspublic void discoverObjects(java.lang.Object root,
java.util.Set<java.lang.Object> out)
root and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.root - the root objectout - the set to which results are addedpublic void discoverObjects(java.lang.Object[] roots,
java.util.Set<java.lang.Object> out)
roots and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.roots - the root objectsout - the set to which results are addedpublic void discoverObjects(java.util.Collection<?> roots,
java.util.Set<java.lang.Object> out)
roots and within the packages specified in the constructor.
Objects that cannot be handled are neither added to the result nor recursively scanned.roots - the root objectsout - the set to which results are addedpublic boolean canReflect(java.lang.Object object)
true if the given object is not null and can be handled by this reflector map,
i.e. whether it's package name is part of the package names specified in the constructor,
and false otherwise.canReflect(Class),
canReflect(Package),
canReflect(String)public boolean canReflect(java.lang.Class<?> type)
true if the given class can be handled by this reflector map,
i.e. whether it's package name is part of the package names specified in the constructor,
and false otherwise.canReflect(Package),
canReflect(String)public boolean canReflect(java.lang.Package thePackage)
true if the given package can be handled by this reflector map,
i.e. whether it's name is part of the package names specified in the constructor,
and false otherwise.canReflect(String)public Reflector getReflector(java.lang.Object object)
object - the object whose class should be reflectedReflector corresponding to the class of the given object,
or a YamlObjectReflector if the object is a YamlObject.java.lang.NullPointerException - if object == nulljava.lang.RuntimeException - if the given object cannot be handled by this reflectorpublic Reflector getReflector(java.lang.Class<?> clazz)
clazz - the class to be reflectedReflector corresponding to the given clazzjava.lang.RuntimeException - if the given clazz cannot be handled by this reflectorpublic Reflector getReflector(java.lang.String simpleName)
simpleName - the simple name of the class to be reflectedReflector corresponding to the given Class with the given simpleNamejava.lang.RuntimeException - if the no class with the given simpleName can be found in the packages specified in the constructor