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

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>
Type Parameters:
T - info type
C - annotation type
All Implemented Interfaces:
Cloneable, AnnotationPlugin<T,C>, MetaDataAnnotationPlugin<T,C>, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractAdaptersAnnotationPlugin, CallbackAnnotationPlugin, ClassAnnotationPlugin, ConstructorAnnotationPlugin, InjectableMemberAnnotationPlugin, MethodAnnotationPlugin

public abstract class AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
extends BaseMetaDataAnnotationPlugin<T,C>
implements AnnotationPlugin<T,C>

Abstract annotation plugin.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected AbstractAnnotationPlugin(Class<C> annotation)
           
 
Method Summary
 void applyAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, MetaDataVisitor visitor)
          Apply the check for annotation.
protected  AbstractBeanMetaData checkIfNotAbstractBeanMetaDataSpecific(BeanMetaData beanMetaData)
          Check if we require impl detail on BeanMetaData.
 void cleanAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, MetaDataVisitor visitor)
          Check if the annotation requires cleaning after itself.
protected  List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info, C annotation, BeanMetaData beanMetaData)
          Covariant override.
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  List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, C annotation, KernelControllerContext context)
          Apply annotation since it's not present.
protected  void internalCleanAnnotation(T info, org.jboss.metadata.spi.MetaData retrieval, C annotation, KernelControllerContext context)
          Clean annotation's actions.
protected  boolean isMetaDataAlreadyPresent(T info, C annotation, KernelControllerContext context)
          Is meta data already present.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes, isAttributePresent, isAttributePresent, isCleanup, isCleanupOnly, isElementTypeSupported, 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

AbstractAnnotationPlugin

protected AbstractAnnotationPlugin(Class<C> annotation)
Method Detail

isMetaDataAlreadyPresent

protected boolean isMetaDataAlreadyPresent(T info,
                                           C annotation,
                                           KernelControllerContext context)
Is meta data already present.

Parameters:
info - the info
annotation - the annotation
context - the context
Returns:
true if meta data already present

internalApplyAnnotation

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

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

internalApplyAnnotation

protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info,
                                                                      org.jboss.metadata.spi.MetaData retrieval,
                                                                      C annotation,
                                                                      BeanMetaData beanMetaData)
                                                               throws Throwable
Apply annotation since it's not present.

Overrides:
internalApplyAnnotation in class BaseMetaDataAnnotationPlugin<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

internalApplyAnnotation

protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(T info,
                                                                      C annotation,
                                                                      BeanMetaData beanMetaData)
                                                               throws Throwable
Covariant override.

Specified by:
internalApplyAnnotation in class BaseMetaDataAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
annotation - the annotation
beanMetaData - the bean meta data
Returns:
used to return covariant type
Throws:
Throwable - for any error

applyAnnotation

public final void applyAnnotation(T info,
                                  org.jboss.metadata.spi.MetaData retrieval,
                                  MetaDataVisitor visitor)
                           throws Throwable
Description copied from interface: AnnotationPlugin
Apply the check for annotation.

Specified by:
applyAnnotation in interface AnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
retrieval - metadata instance
visitor - current context visitor
Throws:
Throwable - for any error

cleanAnnotation

public void cleanAnnotation(T info,
                            org.jboss.metadata.spi.MetaData retrieval,
                            MetaDataVisitor visitor)
                     throws Throwable
Description copied from interface: AnnotationPlugin
Check if the annotation requires cleaning after itself.

Specified by:
cleanAnnotation in interface AnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,C extends Annotation>
Parameters:
info - the info
retrieval - metadata instance
visitor - current context visitor
Throws:
Throwable - for any error

internalCleanAnnotation

protected void internalCleanAnnotation(T info,
                                       org.jboss.metadata.spi.MetaData retrieval,
                                       C annotation,
                                       KernelControllerContext context)
                                throws Throwable
Clean annotation's actions.

Parameters:
info - the info
retrieval - the metadata
annotation - the annotation
context - the context
Throws:
Throwable - for any error

checkIfNotAbstractBeanMetaDataSpecific

protected AbstractBeanMetaData checkIfNotAbstractBeanMetaDataSpecific(BeanMetaData beanMetaData)
Check if we require impl detail on BeanMetaData.

Parameters:
beanMetaData - the bean metadata
Returns:
abstract bean metadata instance


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