com.fatwire.gst.foundation.controller.action
Class AnnotationInjector
java.lang.Object
com.fatwire.gst.foundation.controller.action.AnnotationInjector
public final class AnnotationInjector
- extends Object
Helper to inject dependencies into Object based on annotated fields and
methods.
- Since:
- Mar 26, 2011
- Author:
- Dolf Dijkstra
Field Summary |
protected static org.apache.commons.logging.Log |
LOG
|
protected static org.apache.commons.logging.Log |
LOG_TIME
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.commons.logging.Log LOG
LOG_TIME
protected static final org.apache.commons.logging.Log LOG_TIME
AnnotationInjector
public AnnotationInjector()
inject
public static final void inject(Object object,
Factory factory)
- Inject ICS runtime objects into the object. Objects flagged with the
InjectForRequest
annotation will be populated by this method by
retrieving the value from the Factory.getObject(String,Class)
method.
- Parameters:
object
- the object to inject intofactory
- the factory that created the objects that need to be
injected.
findFieldsWithAnnotation
public static final Field[] findFieldsWithAnnotation(Object object,
Class<? extends Annotation> annnotationClass)
- Finds the fields in the class or super class that are annotated with the
annnotationClass annotation.
- Parameters:
object
- the object to inspect.annnotationClass
- the annotation to find.
- Returns:
- the array of fields with the annotation, never null.
injectIntoField
public static void injectIntoField(Object object,
Factory factory,
Field field)
throws SecurityException
- Parameters:
object
- factory
- field
-
- Throws:
SecurityException
injectIntoMethod
public static void injectIntoMethod(Object object,
Factory factory,
Method method)
throws SecurityException
- Parameters:
object
- factory
- method
-
- Throws:
SecurityException
Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.