public class ResourceInjector extends AbstractAnnotationVisitor
target, targetClass
Constructor and Description |
---|
ResourceInjector(ResourceManager resMgr) |
ResourceInjector(ResourceManager resMgr,
List<ResourceResolver> resolvers) |
Modifier and Type | Method and Description |
---|---|
void |
construct(Object o) |
void |
construct(Object o,
Class<?> cls) |
void |
destroy(Object o) |
protected Class<?> |
getResourceType(Resource res,
Field field)
making this protected to keep pmd happy
|
void |
inject(Object o) |
void |
inject(Object o,
Class<?> claz) |
void |
invokePostConstruct() |
void |
invokePreDestroy() |
static boolean |
processable(Class<?> cls,
Object o) |
void |
visitClass(Class<?> clz,
Annotation annotation)
visit an annotated class.
|
void |
visitField(Field field,
Annotation annotation)
visit an annotated field.
|
void |
visitMethod(Method method,
Annotation annotation)
visit an annotated method.
|
addTargetAnnotation, getTarget, getTargetAnnotations, getTargetClass, setTarget, setTarget
public ResourceInjector(ResourceManager resMgr)
public ResourceInjector(ResourceManager resMgr, List<ResourceResolver> resolvers)
public void inject(Object o)
public void construct(Object o)
public void destroy(Object o)
public final void visitClass(Class<?> clz, Annotation annotation)
AnnotationVisitor
visitClass
is called for each of the annotations
that matches and for each class.visitClass
in interface AnnotationVisitor
visitClass
in class AbstractAnnotationVisitor
clz
- the class with the annotationannotation
- the annotationpublic final void visitField(Field field, Annotation annotation)
AnnotationVisitor
visitField
is called for each of the annotations
that matches and for each field.visitField
in interface AnnotationVisitor
visitField
in class AbstractAnnotationVisitor
field
- the annotated fieldannotation
- the annotationpublic final void visitMethod(Method method, Annotation annotation)
AnnotationVisitor
visitMethod
is called for each of the annotations
that matches and for each method.visitMethod
in interface AnnotationVisitor
visitMethod
in class AbstractAnnotationVisitor
method
- the annotated fieldxannotation
- the annotationpublic void invokePostConstruct()
public void invokePreDestroy()
Copyright © 2017 JBoss by Red Hat. All rights reserved.