@Singleton @Named(value="default") public class DefaultClassAnalyzer extends Object implements ClassAnalyzer
DEFAULT_IMPLEMENTATION_NAME| Constructor and Description |
|---|
DefaultClassAnalyzer(ServiceLocatorImpl locator) |
| Modifier and Type | Method and Description |
|---|---|
<T> Constructor<T> |
getConstructor(Class<T> clazz)
Will return the constructor that it to be used when constructing this
service
|
<T> Set<Field> |
getFields(Class<T> clazz)
Will return the set of initializer fields to be used when initializing
this service
|
<T> Set<Method> |
getInitializerMethods(Class<T> clazz)
Will return the set of initializer method to be used when initializing
this service
|
<T> Method |
getPostConstructMethod(Class<T> clazz)
Will return the postConstruct method of the class
|
<T> Method |
getPreDestroyMethod(Class<T> clazz)
Will return the preDestroy method of the class
|
public DefaultClassAnalyzer(ServiceLocatorImpl locator)
public <T> Constructor<T> getConstructor(Class<T> clazz) throws MultiException, NoSuchMethodException
ClassAnalyzerThe default implementation will use the zero-arg constructor if no single constructor with Inject is found
getConstructor in interface ClassAnalyzerclazz - the non-null class to analyzeMultiException - on an error when analyzing the classNoSuchMethodException - if there was no available constructorpublic <T> Set<Method> getInitializerMethods(Class<T> clazz) throws MultiException
ClassAnalyzerThe default implementation will return all methods marked with Inject
getInitializerMethods in interface ClassAnalyzerclazz - the non-null class to analyzeMultiException - on an error when analyzing the classpublic <T> Set<Field> getFields(Class<T> clazz) throws MultiException
ClassAnalyzerThe default implementation will return all fields marked with Inject
getFields in interface ClassAnalyzerclazz - the non-null class to analyzeMultiException - on an error when analyzing the classpublic <T> Method getPostConstructMethod(Class<T> clazz) throws MultiException
ClassAnalyzer
The default implementation will return the PostConstruct.postConstruct()
method or the method annotated with PostConstruct
getPostConstructMethod in interface ClassAnalyzerclazz - the non-null class to analyzeMultiException - on an error when analyzing the classpublic <T> Method getPreDestroyMethod(Class<T> clazz) throws MultiException
ClassAnalyzer
The default implementation will return the PreDestroy.preDestroy()
method or the method annotated with PreDestroy
getPreDestroyMethod in interface ClassAnalyzerclazz - the non-null class to analyzeMultiException - on an error when analyzing the classCopyright © 2014 Oracle Corporation. All rights reserved.