org.objectweb.easybeans.deployment.annotations.metadata
Class FieldAnnotationMetadata

java.lang.Object
  extended by org.objectweb.easybeans.deployment.annotations.metadata.FieldAnnotationMetadata
All Implemented Interfaces:
IAnnotationEJB, IAnnotationResource

public class FieldAnnotationMetadata
extends java.lang.Object
implements IAnnotationEJB, IAnnotationResource

This class represents the annotation metadata of a field.

Author:
Florent Benoit

Field Summary
private  ClassAnnotationMetadata classAnnotationMetadata
          Parent metadata.
private  boolean inherited
          This field is a field from a super class ?
private  JAnnotationEJB jAnnotationEJB
          Object representing @EJB annotation.
private  JAnnotationResource jAnnotationResource
          Object representing @Resource annotation.
private  JField jField
          Method on which we got metadata.
private  boolean persistenceContext
          This field is used as a PersistenceContext.
 
Constructor Summary
FieldAnnotationMetadata(JField jField, ClassAnnotationMetadata classAnnotationMetadata)
          Constructor.
 
Method Summary
private static void concatStringBuilder(java.lang.String name, java.lang.Object object, java.lang.StringBuilder sb)
          Adds an entry to the given StringBuilder.
private static void concatStringBuilder(java.lang.String name, java.lang.Object object, java.lang.StringBuilder sb, java.lang.String indent)
          Adds an entry to the given StringBuilder.
 ClassAnnotationMetadata getClassAnnotationMetadata()
           
 java.lang.String getFieldName()
           
 JAnnotationEJB getJAnnotationEJB()
           
 JAnnotationResource getJAnnotationResource()
           
 JField getJField()
           
 boolean isInherited()
           
 boolean isPersistenceContext()
           
 void setInherited(boolean inherited)
          Sets the inheritance of this method.
 void setJAnnotationEJB(JAnnotationEJB jAnnotationEJB)
          Set JAnnotationEJB object.
 void setJAnnotationResource(JAnnotationResource jAnnotationResource)
          Set JAnnotationResource object.
 void setPersistenceContext(boolean persistenceContext)
          Sets the persistence context info on this field.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jField

private JField jField
Method on which we got metadata.


classAnnotationMetadata

private ClassAnnotationMetadata classAnnotationMetadata
Parent metadata.


jAnnotationEJB

private JAnnotationEJB jAnnotationEJB
Object representing @EJB annotation.


jAnnotationResource

private JAnnotationResource jAnnotationResource
Object representing @Resource annotation.


inherited

private boolean inherited
This field is a field from a super class ?


persistenceContext

private boolean persistenceContext
This field is used as a PersistenceContext.

Constructor Detail

FieldAnnotationMetadata

public FieldAnnotationMetadata(JField jField,
                               ClassAnnotationMetadata classAnnotationMetadata)
Constructor.

Parameters:
jField - the field on which we will set/add metadata
classAnnotationMetadata - the parent metadata.
Method Detail

getFieldName

public java.lang.String getFieldName()
Returns:
name of the field

getJField

public JField getJField()
Returns:
JMethod object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation

concatStringBuilder

private static void concatStringBuilder(java.lang.String name,
                                        java.lang.Object object,
                                        java.lang.StringBuilder sb,
                                        java.lang.String indent)
Adds an entry to the given StringBuilder.

Parameters:
name - the name of the entry.
object - object to add.
sb - the string builder object on which add the given element.
indent - the indent to add at each line.

concatStringBuilder

private static void concatStringBuilder(java.lang.String name,
                                        java.lang.Object object,
                                        java.lang.StringBuilder sb)
Adds an entry to the given StringBuilder.

Parameters:
name - the name of the entry.
object - object to add.
sb - the string builder object on which add the given element.

isInherited

public boolean isInherited()
Returns:
true if this method is inherited from a super class

setInherited

public void setInherited(boolean inherited)
Sets the inheritance of this method.

Parameters:
inherited - true if method is from a super class

getClassAnnotationMetadata

public ClassAnnotationMetadata getClassAnnotationMetadata()
Returns:
parent metadata (class)

getJAnnotationEJB

public JAnnotationEJB getJAnnotationEJB()
Specified by:
getJAnnotationEJB in interface IAnnotationEJB
Returns:
JAnnotationEJB object representing javax.annotation.EJB annotation.

setJAnnotationEJB

public void setJAnnotationEJB(JAnnotationEJB jAnnotationEJB)
Set JAnnotationEJB object.

Specified by:
setJAnnotationEJB in interface IAnnotationEJB
Parameters:
jAnnotationEJB - object representing javax.annotation.EJB annotation.

getJAnnotationResource

public JAnnotationResource getJAnnotationResource()
Specified by:
getJAnnotationResource in interface IAnnotationResource
Returns:
JAnnotationResource object representing javax.annotation.Resource annotation.

setJAnnotationResource

public void setJAnnotationResource(JAnnotationResource jAnnotationResource)
Set JAnnotationResource object.

Specified by:
setJAnnotationResource in interface IAnnotationResource
Parameters:
jAnnotationResource - object representing javax.annotation.Resource annotation.

isPersistenceContext

public boolean isPersistenceContext()
Returns:
true if this field is used as a persistence context.

setPersistenceContext

public void setPersistenceContext(boolean persistenceContext)
Sets the persistence context info on this field.

Parameters:
persistenceContext - true/false