public class ClassReflectionHelperImpl extends Object implements ClassReflectionHelper
Constructor and Description |
---|
ClassReflectionHelperImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clean(Class<?> clazz)
Removes this class (and all appropriate sub-classes) from the cache
|
MethodWrapper |
createMethodWrapper(Method m)
Creates a method wrapper from the given method
|
void |
dispose()
Releases the entire cache, though the ClassReflectionHelper is
still usable after calling dispose
|
Method |
findPostConstruct(Class<?> clazz,
Class<?> matchingClass)
Finds the postConstruct method on this class
|
Method |
findPreDestroy(Class<?> clazz,
Class<?> matchingClass)
Finds the preDestroy method on this class
|
Set<Field> |
getAllFields(Class<?> clazz)
Gets all fields for a class (taking class heirarchy into account)
|
Set<MethodWrapper> |
getAllMethods(Class<?> clazz)
Gets all methods for a class (taking class heirarchy into account)
|
int |
size()
Returns an approximation of the current size of the cache
|
String |
toString() |
public Set<MethodWrapper> getAllMethods(Class<?> clazz)
ClassReflectionHelper
getAllMethods
in interface ClassReflectionHelper
clazz
- The class to analyze for all methodspublic Set<Field> getAllFields(Class<?> clazz)
ClassReflectionHelper
getAllFields
in interface ClassReflectionHelper
clazz
- The class to analyze for all fieldspublic Method findPostConstruct(Class<?> clazz, Class<?> matchingClass) throws IllegalArgumentException
ClassReflectionHelper
findPostConstruct
in interface ClassReflectionHelper
clazz
- The class to check for the postConstruct methodmatchingClass
- The PostConstruct interface, a small performance improvementIllegalArgumentException
- If a method marked as postConstruct is invalidpublic Method findPreDestroy(Class<?> clazz, Class<?> matchingClass) throws IllegalArgumentException
ClassReflectionHelper
findPreDestroy
in interface ClassReflectionHelper
clazz
- The class to check for the postConstruct methodmatchingClass
- The PostConstruct interface, a small performance improvementIllegalArgumentException
- If a method marked as postConstruct is invalidpublic void clean(Class<?> clazz)
ClassReflectionHelper
clean
in interface ClassReflectionHelper
clazz
- The class to remove. If null this method does nothingpublic MethodWrapper createMethodWrapper(Method m)
ClassReflectionHelper
createMethodWrapper
in interface ClassReflectionHelper
m
- A non-null method to create a wrapper frompublic void dispose()
ClassReflectionHelper
dispose
in interface ClassReflectionHelper
public int size()
ClassReflectionHelper
size
in interface ClassReflectionHelper
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.