com.bm.ejb3metadata.annotations.metadata
Class ClassAnnotationMetadata

java.lang.Object
  extended by com.bm.ejb3metadata.annotations.metadata.CommonAnnotationMetadata
      extended by com.bm.ejb3metadata.annotations.metadata.ClassAnnotationMetadata
All Implemented Interfaces:
IAnnotationResource, IEjbEJB, IEJBInterceptors, IPersistenceContext, IPersistenceUnit, ISharedMetadata, ITransactionAttribute

public class ClassAnnotationMetadata
extends CommonAnnotationMetadata
implements ITransactionAttribute, IEJBInterceptors

This class represents the annotation metadata of a Bean.
From this class, we can access to all methods of a bean with its associated information.

Author:
Daniel Wiese

Constructor Summary
ClassAnnotationMetadata(java.lang.String className, EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
          Constructor.
 
Method Summary
 void addAroundInvokeMethodMetadata(MethodAnnotationMetadata aroundInvokeMethodMetadata)
          Add a @AroundInvoke method of this class.
 void addFieldAnnotationMetadata(FieldAnnotationMetadata fieldAnnotationMetadata)
          Add field annotation metadata for a given Bean.
 void addMethodAnnotationMetadata(MethodAnnotationMetadata methodAnnotationMetadata)
          Add method annotation metadata for a given Bean.
 void addPostActivateMethodMetadata(MethodAnnotationMetadata postActivateMethodMetadata)
          Adds a @PostActivate method of this class.
 void addPostConstructMethodMetadata(MethodAnnotationMetadata postConstructMethodMetadata)
          Adds a @PostConstruct method of this class.
 void addPreDestroyMethodMetadata(MethodAnnotationMetadata preDestroyMethodMetadata)
          Adds a @PreDestroy method of this class.
 void addPrePassivateMethodMetadata(MethodAnnotationMetadata prePassivateMethodMetadata)
          Adds a @PrePassivate method of this class.
 JInterceptors getAnnotationInterceptors()
          Object representing list of @Interceptors.
 ApplicationException getApplicationException()
          the @ApplicationException annotation.
 java.util.List<MethodAnnotationMetadata> getAroundInvokeMethodMetadatas()
          the list of methods metadata with annotation @AroundInvoke.
 java.lang.String getClassName()
          name of the bean (associated to this metadata).
 EjbJarAnnotationMetadata getEjbJarAnnotationMetadata()
          parent metadata object.
 java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> getExternalUserEasyBeansInterceptors()
          Map<interceptor type <--> List of methods/class corresponding to the interceptor> (interceptor classes) of user interceptors that enhancer will use.
 FieldAnnotationMetadata getFieldAnnotationMetadata(JField jField)
          key of the map of fields annotations.
 java.util.Collection<FieldAnnotationMetadata> getFieldAnnotationMetadataCollection()
          Get collections of fields annotation metadata.
 java.lang.String[] getInterfaces()
          array of interfaces name.
 java.util.List<JAnnotationResource> getJAnnotationResources()
          JAnnotationResources list representing @Resources annotation.
 java.util.List<JavaxPersistenceContext> getJavaxPersistencePersistenceContexts()
          javaxPersistencePersistenceContexts list representing @PersistenceContexts annotation.
 java.util.List<JavaxPersistenceUnit> getJavaxPersistencePersistenceUnits()
          javaxPersistencePersistenceUnits list representing @PersistenceUnits annotation.
 JCommonBean getJCommonBean()
          the attributes for a Stateless/Stateful/MDB.
 java.util.List<JEjbEJB> getJEjbEJBs()
          jEjbEJBs list representing @EJBs annotation.
 JMessageDriven getJMessageDriven()
          Message driven attribute.
 JService getJService()
          the jService.
 JStateful getJStateful()
          the attributes for a Stateful.
 JStateless getJStateless()
          the attributes for a Stateless.
 java.lang.String getLocalHome()
          the @LocalHome class name.
 JLocal getLocalInterfaces()
          the local interfaces of this class.
 MethodAnnotationMetadata getMethodAnnotationMetadata(JMethod jMethod)
          jMethod key of the map of methods annotations.
 java.util.Collection<MethodAnnotationMetadata> getMethodAnnotationMetadataCollection()
          Get collections of methods annotation metadata.
 java.util.LinkedList<MethodAnnotationMetadata> getPostActivateMethodsMetadata()
          the methods metadata with annotation @PostActivate.
 java.util.LinkedList<MethodAnnotationMetadata> getPostConstructMethodsMetadata()
          the methods metadata with annotation @PostConstruct.
 java.util.LinkedList<MethodAnnotationMetadata> getPreDestroyMethodsMetadata()
          the methods metadata with annotation @PreDestroy.
 java.util.LinkedList<MethodAnnotationMetadata> getPrePassivateMethodsMetadata()
          the method metadata with annotation @PrePassivate.
 java.lang.String getRemoteHome()
          the @RemoteHome class name.
 JRemote getRemoteInterfaces()
          the remote interfaces of this class.
 java.lang.String getSuperName()
          the super class name.
 TransactionAttributeType getTransactionAttributeType()
          transaction Attribute type.
 TransactionManagementType getTransactionManagementType()
          transaction management type from.
 boolean isAroundInvokeMethodMetadata()
          the method metadata with annotation @AroundInvoke.
 boolean isBean()
          true if the classs is a Bean.
 boolean isInterceptor()
          Is that this class is an interceptor class ?
 boolean isMdb()
          true if the class is an MDB class.
 boolean isService()
          true if the class is an MDB class.
 boolean isSession()
          true if the class is a session bean class.
 boolean isStateful()
          true if the class is a stateful class.
 boolean isStateless()
          true if the class is a stateless class.
 void setAnnotationsInterceptors(JInterceptors annotationInterceptors)
          Sets the object representing the @Interceptors annotation.
 void setApplicationException(ApplicationException applicationException)
          Sets the object representing the @ApplicationException annotation.
 void setClassType(ClassType cType)
          Sets the type of this class.
 void setExternalUserInterceptors(java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> externalUserInterceptors)
          Sets the list of user interceptors that enhancers will use.
These interceptors are defined outside the bean class (interceptor classes).
 void setInterfaces(java.lang.String[] interfaces)
          Sets the interfaces of this class.
 void setJAnnotationResources(java.util.List<JAnnotationResource> jAnnotationResources)
          Sets JAnnotationResources object.
 void setJavaxPersistencePersistenceContexts(java.util.List<JavaxPersistenceContext> javaxPersistencePersistenceContexts)
          Sets JavaxPersistencePersistenceContexts object.
 void setJavaxPersistencePersistenceUnits(java.util.List<JavaxPersistenceUnit> javaxPersistencePersistenceUnits)
          Sets setJavaxPersistencePersistenceUnits object.
 void setJCommonBean(JCommonBean commonBean)
          Sets the attributes for a Stateless/Stateful/MDB.
 void setJEjbEJBs(java.util.List<JEjbEJB> jEjbEJBs)
          Set JEjbEJBs object.
 void setJMessageDriven(JMessageDriven messageDriven)
          Sets the message driven bean object.
 void setJService(JService service)
          Sets the attributes for a Stateless.
 void setJStateful(JStateful jStateful)
          Sets the attributes for a Stateful.
 void setJStateless(JStateless jStateless)
          Sets the attributes for a Stateless.
 void setLocalHome(java.lang.String localHome)
          Sets the @LocalHome class name.
 void setLocalInterfaces(JLocal jLocal)
          Sets the local interfaces of this class.
 void setModified()
          Defines that this class has been modified.
 void setRemoteHome(java.lang.String remoteHome)
          Sets the @RemoteHome class name.
 void setRemoteInterfaces(JRemote jRemote)
          Sets the remote interfaces of this class.
 void setSuperName(java.lang.String superName)
          Sets the super class name.
 void setTransactionAttributeType(TransactionAttributeType transactionAttributeType)
          Set Transaction Attribute Type.
 void setTransactionManagementType(TransactionManagementType transactionManagementType)
          Sets transaction management type.
 java.lang.String toString()
          string representation.
 boolean wasModified()
          true if the class has been modified.
 
Methods inherited from class com.bm.ejb3metadata.annotations.metadata.CommonAnnotationMetadata
concatStringBuilder, concatStringBuilder, getJAnnotationResource, getJavaxPersistenceContext, getJavaxPersistenceUnit, getJEjbEJB, isPersistenceContext, isPersistenceUnit, setJAnnotationResource, setJavaxPersistenceContext, setJavaxPersistenceUnit, setJEjbEJB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassAnnotationMetadata

public ClassAnnotationMetadata(java.lang.String className,
                               EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
Constructor.

Parameters:
className - name of the class associated to these metadatas.
ejbJarAnnotationMetadata - parent metadata object.
Method Detail

getClassName

public java.lang.String getClassName()
name of the bean (associated to this metadata).

Returns:
name of the bean (associated to this metadata).

addMethodAnnotationMetadata

public void addMethodAnnotationMetadata(MethodAnnotationMetadata methodAnnotationMetadata)
Add method annotation metadata for a given Bean.

Parameters:
methodAnnotationMetadata - metadata of a method.

getMethodAnnotationMetadata

public MethodAnnotationMetadata getMethodAnnotationMetadata(JMethod jMethod)
jMethod key of the map of methods annotations.

Parameters:
jMethod - key of the map of methods annotations.
Returns:
method annotation metadata of a given method.

getMethodAnnotationMetadataCollection

public java.util.Collection<MethodAnnotationMetadata> getMethodAnnotationMetadataCollection()
Get collections of methods annotation metadata.

Returns:
collections of methods annotation metadata.

addFieldAnnotationMetadata

public void addFieldAnnotationMetadata(FieldAnnotationMetadata fieldAnnotationMetadata)
Add field annotation metadata for a given Bean.

Parameters:
fieldAnnotationMetadata - metadata of a field.

getFieldAnnotationMetadata

public FieldAnnotationMetadata getFieldAnnotationMetadata(JField jField)
key of the map of fields annotations.

Parameters:
jField - key of the map of fields annotations.
Returns:
field annotation metadata of a given method.

getFieldAnnotationMetadataCollection

public java.util.Collection<FieldAnnotationMetadata> getFieldAnnotationMetadataCollection()
Get collections of fields annotation metadata.

Returns:
collections of fields annotation metadata.

setLocalInterfaces

public void setLocalInterfaces(JLocal jLocal)
Sets the local interfaces of this class.

Parameters:
jLocal - list of interfaces.

setRemoteInterfaces

public void setRemoteInterfaces(JRemote jRemote)
Sets the remote interfaces of this class.

Parameters:
jRemote - list of interfaces.

getLocalInterfaces

public JLocal getLocalInterfaces()
the local interfaces of this class.

Returns:
the local interfaces of this class.

getRemoteInterfaces

public JRemote getRemoteInterfaces()
the remote interfaces of this class.

Returns:
the remote interfaces of this class.

isStateless

public boolean isStateless()
true if the class is a stateless class.

Returns:
true if the class is a stateless class

isStateful

public boolean isStateful()
true if the class is a stateful class.

Returns:
true if the class is a stateful class

isSession

public boolean isSession()
true if the class is a session bean class.

Returns:
true if the class is a session bean class

isMdb

public boolean isMdb()
true if the class is an MDB class.

Returns:
true if the class is an MDB class

isService

public boolean isService()
true if the class is an MDB class.

Returns:
true if the class is an MDB class

setClassType

public void setClassType(ClassType cType)
Sets the type of this class.

Parameters:
cType - a type from enum class ClassType.
See Also:
ClassType

getJMessageDriven

public JMessageDriven getJMessageDriven()
Message driven attribute.

Returns:
Message driven attribute.

setJMessageDriven

public void setJMessageDriven(JMessageDriven messageDriven)
Sets the message driven bean object.

Parameters:
messageDriven - attributes of message driven bean.

toString

public java.lang.String toString()
string representation.

Overrides:
toString in class CommonAnnotationMetadata
Returns:
string representation.

getRemoteHome

public java.lang.String getRemoteHome()
the @RemoteHome class name.

Returns:
the @RemoteHome class name.

setRemoteHome

public void setRemoteHome(java.lang.String remoteHome)
Sets the @RemoteHome class name.

Parameters:
remoteHome - the class name.

getLocalHome

public java.lang.String getLocalHome()
the @LocalHome class name.

Returns:
the @LocalHome class name.

setLocalHome

public void setLocalHome(java.lang.String localHome)
Sets the @LocalHome class name. the @LocalHome class name.

Parameters:
localHome - the class name.

getTransactionManagementType

public TransactionManagementType getTransactionManagementType()
transaction management type from.

Returns:
transaction management type from.
See Also:
TransactionManagementType.

setTransactionManagementType

public void setTransactionManagementType(TransactionManagementType transactionManagementType)
Sets transaction management type.

Parameters:
transactionManagementType - value. (BEAN, CONTAINER)
See Also:
TransactionManagementType

getTransactionAttributeType

public TransactionAttributeType getTransactionAttributeType()
transaction Attribute type.

Specified by:
getTransactionAttributeType in interface ITransactionAttribute
Returns:
transaction Attribute type.
See Also:
TransactionAttributeType

setTransactionAttributeType

public void setTransactionAttributeType(TransactionAttributeType transactionAttributeType)
Set Transaction Attribute Type.

Specified by:
setTransactionAttributeType in interface ITransactionAttribute
Parameters:
transactionAttributeType - the type of transaction.
See Also:
TransactionAttributeType

getAnnotationInterceptors

public JInterceptors getAnnotationInterceptors()
Object representing list of @Interceptors.

Returns:
object representing list of @Interceptors.

setAnnotationsInterceptors

public void setAnnotationsInterceptors(JInterceptors annotationInterceptors)
Sets the object representing the @Interceptors annotation.

Specified by:
setAnnotationsInterceptors in interface IEJBInterceptors
Parameters:
annotationInterceptors - list of classes

getApplicationException

public ApplicationException getApplicationException()
the @ApplicationException annotation.

Returns:
the @ApplicationException annotation.

setApplicationException

public void setApplicationException(ApplicationException applicationException)
Sets the object representing the @ApplicationException annotation.

Parameters:
applicationException - object representation

isBean

public boolean isBean()
true if the classs is a Bean.

Returns:
true if the classs is a Bean

getInterfaces

public java.lang.String[] getInterfaces()
array of interfaces name.

Returns:
array of interfaces name.

setInterfaces

public void setInterfaces(java.lang.String[] interfaces)
Sets the interfaces of this class.

Parameters:
interfaces - name of interfaces.

getSuperName

public java.lang.String getSuperName()
the super class name.

Returns:
the super class name.

setSuperName

public void setSuperName(java.lang.String superName)
Sets the super class name.

Parameters:
superName - name of the super class.

getEjbJarAnnotationMetadata

public EjbJarAnnotationMetadata getEjbJarAnnotationMetadata()
parent metadata object.

Returns:
parent metadata object.

getExternalUserEasyBeansInterceptors

public java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> getExternalUserEasyBeansInterceptors()
Map<interceptor type <--> List of methods/class corresponding to the interceptor> (interceptor classes) of user interceptors that enhancer will use.

Returns:
Map<interceptor type <--> List of methods/class corresponding to the interceptor> (interceptor classes) of user interceptors that enhancer will use.

setExternalUserInterceptors

public void setExternalUserInterceptors(java.util.Map<InterceptorType,java.util.List<JClassInterceptor>> externalUserInterceptors)
Sets the list of user interceptors that enhancers will use.
These interceptors are defined outside the bean class (interceptor classes).

Parameters:
externalUserInterceptors - list of interceptors that enhancer will use.

isAroundInvokeMethodMetadata

public boolean isAroundInvokeMethodMetadata()
the method metadata with annotation @AroundInvoke.

Returns:
the method metadata with annotation @AroundInvoke.

getAroundInvokeMethodMetadatas

public java.util.List<MethodAnnotationMetadata> getAroundInvokeMethodMetadatas()
the list of methods metadata with annotation @AroundInvoke.

Returns:
the list of methods metadata with annotation @AroundInvoke.

addAroundInvokeMethodMetadata

public void addAroundInvokeMethodMetadata(MethodAnnotationMetadata aroundInvokeMethodMetadata)
Add a @AroundInvoke method of this class.

Parameters:
aroundInvokeMethodMetadata - the method.

getPostConstructMethodsMetadata

public java.util.LinkedList<MethodAnnotationMetadata> getPostConstructMethodsMetadata()
the methods metadata with annotation @PostConstruct.

Returns:
the methods metadata with annotation @PostConstruct.

addPostConstructMethodMetadata

public void addPostConstructMethodMetadata(MethodAnnotationMetadata postConstructMethodMetadata)
Adds a @PostConstruct method of this class.

Parameters:
postConstructMethodMetadata - the method.

getPreDestroyMethodsMetadata

public java.util.LinkedList<MethodAnnotationMetadata> getPreDestroyMethodsMetadata()
the methods metadata with annotation @PreDestroy.

Returns:
the methods metadata with annotation @PreDestroy.

addPreDestroyMethodMetadata

public void addPreDestroyMethodMetadata(MethodAnnotationMetadata preDestroyMethodMetadata)
Adds a @PreDestroy method of this class.

Parameters:
preDestroyMethodMetadata - the method.

getPostActivateMethodsMetadata

public java.util.LinkedList<MethodAnnotationMetadata> getPostActivateMethodsMetadata()
the methods metadata with annotation @PostActivate.

Returns:
the methods metadata with annotation @PostActivate.

addPostActivateMethodMetadata

public void addPostActivateMethodMetadata(MethodAnnotationMetadata postActivateMethodMetadata)
Adds a @PostActivate method of this class.

Parameters:
postActivateMethodMetadata - the method.

getPrePassivateMethodsMetadata

public java.util.LinkedList<MethodAnnotationMetadata> getPrePassivateMethodsMetadata()
the method metadata with annotation @PrePassivate.

Returns:
the method metadata with annotation @PrePassivate.

addPrePassivateMethodMetadata

public void addPrePassivateMethodMetadata(MethodAnnotationMetadata prePassivateMethodMetadata)
Adds a @PrePassivate method of this class.

Parameters:
prePassivateMethodMetadata - the method.

isInterceptor

public boolean isInterceptor()
Is that this class is an interceptor class ?

Returns:
true if it the case, else false.

getJEjbEJBs

public java.util.List<JEjbEJB> getJEjbEJBs()
jEjbEJBs list representing @EJBs annotation.

Returns:
jEjbEJBs list representing @EJBs annotation.

setJEjbEJBs

public void setJEjbEJBs(java.util.List<JEjbEJB> jEjbEJBs)
Set JEjbEJBs object.

Parameters:
jEjbEJBs - list representing javax.ejb.EJBs annotation.

getJAnnotationResources

public java.util.List<JAnnotationResource> getJAnnotationResources()
JAnnotationResources list representing @Resources annotation.

Returns:
JAnnotationResources list representing @Resources annotation.

setJAnnotationResources

public void setJAnnotationResources(java.util.List<JAnnotationResource> jAnnotationResources)
Sets JAnnotationResources object.

Parameters:
jAnnotationResources - list representing javax.annotation.Resources annotation.

getJavaxPersistencePersistenceContexts

public java.util.List<JavaxPersistenceContext> getJavaxPersistencePersistenceContexts()
javaxPersistencePersistenceContexts list representing @PersistenceContexts annotation.

Returns:
javaxPersistencePersistenceContexts list representing @PersistenceContexts annotation.

setJavaxPersistencePersistenceContexts

public void setJavaxPersistencePersistenceContexts(java.util.List<JavaxPersistenceContext> javaxPersistencePersistenceContexts)
Sets JavaxPersistencePersistenceContexts object.

Parameters:
javaxPersistencePersistenceContexts - list representing @PersistenceContexts annotation.

getJavaxPersistencePersistenceUnits

public java.util.List<JavaxPersistenceUnit> getJavaxPersistencePersistenceUnits()
javaxPersistencePersistenceUnits list representing @PersistenceUnits annotation.

Returns:
javaxPersistencePersistenceUnits list representing @PersistenceUnits annotation.

setJavaxPersistencePersistenceUnits

public void setJavaxPersistencePersistenceUnits(java.util.List<JavaxPersistenceUnit> javaxPersistencePersistenceUnits)
Sets setJavaxPersistencePersistenceUnits object.

Parameters:
javaxPersistencePersistenceUnits - list representing @PersistenceUnits annotation.

getJCommonBean

public JCommonBean getJCommonBean()
the attributes for a Stateless/Stateful/MDB.

Returns:
the attributes for a Stateless/Stateful/MDB

setJCommonBean

public void setJCommonBean(JCommonBean commonBean)
Sets the attributes for a Stateless/Stateful/MDB.

Parameters:
commonBean - the attributes

getJStateful

public JStateful getJStateful()
the attributes for a Stateful.

Returns:
the attributes for a Stateful

setJStateful

public void setJStateful(JStateful jStateful)
Sets the attributes for a Stateful.

Parameters:
jStateful - the attributes

getJStateless

public JStateless getJStateless()
the attributes for a Stateless.

Returns:
the attributes for a Stateless

setJStateless

public void setJStateless(JStateless jStateless)
Sets the attributes for a Stateless.

Parameters:
jStateless - the attributes

getJService

public JService getJService()
the jService.

Returns:
the jService

setJService

public void setJService(JService service)
Sets the attributes for a Stateless.

Parameters:
service - the jService to set

wasModified

public boolean wasModified()
true if the class has been modified.

Returns:
true if the class has been modified.

setModified

public void setModified()
Defines that this class has been modified.



Copyright © 2008. All Rights Reserved.