org.jboss.kernel.plugins.annotations
Class AbstractParameterAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation,P extends MutableParameterizedMetaData>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T,C>
          extended by org.jboss.kernel.plugins.annotations.AbstractAdaptersAnnotationPlugin<T,C>
              extended by org.jboss.kernel.plugins.annotations.AbstractParameterAnnotationPlugin<T,C,P>
Type Parameters:
T - info type
C - annotation type
P - mutable parametrized type
All Implemented Interfaces:
Cloneable, AnnotationPlugin<T,C>, org.jboss.util.JBossInterface
Direct Known Subclasses:
ConstructorParameterAnnotationPlugin, FactoryMethodAnnotationPlugin, InstallationParameterAnnotationPlugin, LifecycleParameterAnnotationPlugin

public abstract class AbstractParameterAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation,P extends MutableParameterizedMetaData>
extends AbstractAdaptersAnnotationPlugin<T,C>

Annotation plugin for handling annotations that take parameters.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.kernel.plugins.annotations.AbstractAdaptersAnnotationPlugin
adapters
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected AbstractParameterAnnotationPlugin(Class<C> annotation, Annotation2ValueMetaDataAdapter... adapters)
           
 
Method Summary
protected abstract  boolean checkAnnotatedInfo(ElementType type)
          Check additional element type - apart from Parameter element type.
protected  P createParametrizedMetaData(T info)
          Create new Parametrized metadata.
protected  P createParametrizedMetaData(T info, C annotation)
          Create new Parametrized metadata.
protected  P createParametrizedMetaData(T info, C annotation, BeanMetaData beanMetaData)
          Create new Parametrized metadata.
protected  P createParametrizedMetaData(T info, C annotation, KernelControllerContext context)
          Create new Parametrized metadata.
protected abstract  org.jboss.reflect.spi.ParameterInfo[] getParameters(T info)
          Get the parameters infos from type.
protected abstract  List<? extends MetaDataVisitorNode> handleParameterlessInfo(T info, C annotation, BeanMetaData beanMetaData)
          Handle info which has zero parameters.
protected  List<? extends MetaDataVisitorNode> handleParameterlessInfo(T info, C annotation, KernelControllerContext context)
          Handle info which has zero parameters.
protected  List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, C annotation, KernelControllerContext context)
          Apply annotation since it's not present.
protected  boolean isElementTypeSupported(ElementType type)
          Is type supported by plugin.
protected abstract  void setParameterizedMetaData(P parameterizedMetaData, BeanMetaData beanMetaData)
          Set the ParameterizedMetaData instance.
protected  void setParameterizedMetaData(P parameterizedMetaData, KernelControllerContext context)
          Set the ParameterizedMetaData instance.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin
applyAnnotation, cleanAnnotation, getAnnotation, getSupportedTypes, internalApplyAnnotation, internalApplyAnnotation, internalCleanAnnotation, isAttributePresent, isMetaDataAlreadyPresent, isMetaDataAlreadyPresent, toShortString, toString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractParameterAnnotationPlugin

protected AbstractParameterAnnotationPlugin(Class<C> annotation,
                                            Annotation2ValueMetaDataAdapter... adapters)
Method Detail

checkAnnotatedInfo

protected abstract boolean checkAnnotatedInfo(ElementType type)
Check additional element type - apart from Parameter element type.

Parameters:
type - the type
Returns:
true if additional type is supported

isElementTypeSupported

protected boolean isElementTypeSupported(ElementType type)
Description copied from class: AbstractAnnotationPlugin
Is type supported by plugin.

Specified by:
isElementTypeSupported in class AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
type - the annotation element type
Returns:
true if element supported

getParameters

protected abstract org.jboss.reflect.spi.ParameterInfo[] getParameters(T info)
Get the parameters infos from type.

Parameters:
info - the type
Returns:
array of parameter info

handleParameterlessInfo

protected List<? extends MetaDataVisitorNode> handleParameterlessInfo(T info,
                                                                      C annotation,
                                                                      KernelControllerContext context)
Handle info which has zero parameters.

Parameters:
info - the info
annotation - the annotation
context - the context
Returns:
list of added meta data visitor nodes

handleParameterlessInfo

protected abstract List<? extends MetaDataVisitorNode> handleParameterlessInfo(T info,
                                                                               C annotation,
                                                                               BeanMetaData beanMetaData)
Handle info which has zero parameters.

Parameters:
info - the info
annotation - the annotation
beanMetaData - the bean metadata
Returns:
list of added meta data visitor nodes

createParametrizedMetaData

protected P createParametrizedMetaData(T info,
                                       C annotation,
                                       KernelControllerContext context)
Create new Parametrized metadata.

Parameters:
info - the info
annotation - the annotation
context - the context
Returns:
new ParameterizedMetaData instance

createParametrizedMetaData

protected P createParametrizedMetaData(T info,
                                       C annotation,
                                       BeanMetaData beanMetaData)
Create new Parametrized metadata.

Parameters:
info - the info
annotation - the annotation
beanMetaData - the bean metadata
Returns:
new ParameterizedMetaData instance

createParametrizedMetaData

protected P createParametrizedMetaData(T info,
                                       C annotation)
Create new Parametrized metadata.

Parameters:
info - the info
annotation - the annotation
Returns:
new ParameterizedMetaData instance

createParametrizedMetaData

protected P createParametrizedMetaData(T info)
Create new Parametrized metadata.

Parameters:
info - the info
Returns:
new ParameterizedMetaData instance

setParameterizedMetaData

protected void setParameterizedMetaData(P parameterizedMetaData,
                                        KernelControllerContext context)
Set the ParameterizedMetaData instance.

Parameters:
parameterizedMetaData - the parameterized metadata
context - the context

setParameterizedMetaData

protected abstract void setParameterizedMetaData(P parameterizedMetaData,
                                                 BeanMetaData beanMetaData)
Set the ParameterizedMetaData instance.

Parameters:
parameterizedMetaData - the parameterized metadata
beanMetaData - the bean metadata

internalApplyAnnotation

protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info,
                                                                      org.jboss.metadata.spi.MetaData retrieval,
                                                                      C annotation,
                                                                      KernelControllerContext context)
                                                               throws Throwable
Description copied from class: AbstractAnnotationPlugin
Apply annotation since it's not present.

Overrides:
internalApplyAnnotation in class AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
retrieval - the metadata
annotation - the annotation
context - the context
Returns:
list of added meta data visitor nodes
Throws:
Throwable - for any error


Copyright ? 2007 JBoss Inc.. All Rights Reserved.