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.BaseMetaDataAnnotationPlugin<T,C>
          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>, MetaDataAnnotationPlugin<T,C>, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractConstructorParameterAnnotationPlugin, AbstractMethodParameterAnnotationPlugin

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, Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
           
 
Method Summary
protected abstract  boolean checkAnnotatedInfo(ElementType type)
          Check additional element type - apart from Parameter element type.
protected abstract  org.jboss.metadata.spi.signature.Signature createParametersSignature(String name, String[] parameters, int index)
          Create parameters signature.
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 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> internalApplyAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, C annotation, BeanMetaData beanMetaData)
          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.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin
applyAnnotation, checkIfNotAbstractBeanMetaDataSpecific, cleanAnnotation, internalApplyAnnotation, internalApplyAnnotation, internalCleanAnnotation, isMetaDataAlreadyPresent
 
Methods inherited from class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes, isAttributePresent, isAttributePresent, isCleanup, isCleanupOnly, 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
 
Methods inherited from interface org.jboss.kernel.plugins.annotations.MetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes
 

Constructor Detail

AbstractParameterAnnotationPlugin

protected AbstractParameterAnnotationPlugin(Class<C> annotation,
                                            Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> 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: BaseMetaDataAnnotationPlugin
Is type supported by plugin.

Specified by:
isElementTypeSupported in class BaseMetaDataAnnotationPlugin<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 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,
                                       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 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,
                                                                      BeanMetaData beanMetaData)
                                                               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
beanMetaData - the bean metadata
Returns:
list of added meta data visitor nodes
Throws:
Throwable - for any error

createParametersSignature

protected abstract org.jboss.metadata.spi.signature.Signature createParametersSignature(String name,
                                                                                        String[] parameters,
                                                                                        int index)
Create parameters signature.

Parameters:
name - the name
parameters - the parameters
index - the index
Returns:
new signature


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.