org.apache.myfaces.config.annotation
Class ResourceAnnotationLifecycleProvider

java.lang.Object
  extended by org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider
      extended by org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider
All Implemented Interfaces:
LifecycleProvider, LifecycleProvider2
Direct Known Subclasses:
AllAnnotationLifecycleProvider

public class ResourceAnnotationLifecycleProvider
extends NoInjectionAnnotationLifecycleProvider


Field Summary
protected  Context context
           
 
Constructor Summary
ResourceAnnotationLifecycleProvider(Context context)
           
 
Method Summary
protected  void checkFieldAnnotation(Field field, Object instance)
           
protected  void checkMethodAnnotation(Method method, Object instance)
           
protected static String getFieldName(Method setter)
          Returns the field name for the given Method.
protected static void lookupFieldResource(Context context, Object instance, Field field, String name)
          Inject resources in specified field.
protected static void lookupMethodResource(Context context, Object instance, Method method, String name)
          Inject resources in specified method.
protected  void processAnnotations(Object instance)
          Inject resources in specified instance.
 
Methods inherited from class org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider
destroyInstance, newInstance, postConstruct
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context
Constructor Detail

ResourceAnnotationLifecycleProvider

public ResourceAnnotationLifecycleProvider(Context context)
Method Detail

processAnnotations

protected void processAnnotations(Object instance)
                           throws IllegalAccessException,
                                  InvocationTargetException,
                                  NamingException
Inject resources in specified instance.

Overrides:
processAnnotations in class NoInjectionAnnotationLifecycleProvider
Throws:
IllegalAccessException
InvocationTargetException
NamingException

checkMethodAnnotation

protected void checkMethodAnnotation(Method method,
                                     Object instance)
                              throws NamingException,
                                     IllegalAccessException,
                                     InvocationTargetException
Throws:
NamingException
IllegalAccessException
InvocationTargetException

checkFieldAnnotation

protected void checkFieldAnnotation(Field field,
                                    Object instance)
                             throws NamingException,
                                    IllegalAccessException
Throws:
NamingException
IllegalAccessException

lookupFieldResource

protected static void lookupFieldResource(Context context,
                                          Object instance,
                                          Field field,
                                          String name)
                                   throws NamingException,
                                          IllegalAccessException
Inject resources in specified field.

Throws:
NamingException
IllegalAccessException

lookupMethodResource

protected static void lookupMethodResource(Context context,
                                           Object instance,
                                           Method method,
                                           String name)
                                    throws NamingException,
                                           IllegalAccessException,
                                           InvocationTargetException
Inject resources in specified method.

Throws:
NamingException
IllegalAccessException
InvocationTargetException

getFieldName

protected static String getFieldName(Method setter)
Returns the field name for the given Method. E.g. setName() will be "name".

Parameters:
setter - the setter method
Returns:
the field name of the given setter method


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.