org.castor.jdo.jpa.info
Class FieldInfo

java.lang.Object
  extended by org.castor.jdo.jpa.info.FieldInfo
All Implemented Interfaces:
NatureExtendable, PropertyHolder

public class FieldInfo
extends Object
implements PropertyHolder

This class holds the necessary information so that Castor can properly map a JPA annotated classes member to the database.

Since:
1.3
Author:
Peter Schmidt

Constructor Summary
FieldInfo(ClassInfo declaringClassInfo, Class<?> fieldType, String fieldName, Method getterMethod, Method setterMethod)
          Creates a FieldInfo associated to the given ClassInfo, describing the given a field with the given name using method (property) access.
 
Method Summary
 void addNature(String nature)
          
 ClassInfo getDeclaringClassInfo()
          Returns the declaring ClassInfo this FieldInfo is associated with.
 String getFieldName()
          Indicates the name of the field described by this FieldInfo.
 Class<?> getFieldType()
          Indicates the type of the field described by this FieldInfo.
 Method getGetterMethod()
          Indicates the getter access method of the field.
 Object getProperty(String name)
          
 Method getSetterMethod()
          Indicates the setter access method of the field.
 boolean hasNature(String nature)
          
 void setDeclaringClassInfo(ClassInfo classInfo)
          Sets the reference to the declaring ClassInfo this FieldInfo is associated with.
 void setFieldName(String fieldName)
          Sets the name of the field described by this FieldInfo.
 void setFieldType(Class<?> fieldType)
          Sets the type of the field described by this FieldInfo.
 void setGetterMethod(Method getterMethod)
          Sets the getter access method of the field.
 void setProperty(String name, Object value)
          
 void setSetterMethod(Method setterMethod)
          Sets the setter access method of the field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldInfo

public FieldInfo(ClassInfo declaringClassInfo,
                 Class<?> fieldType,
                 String fieldName,
                 Method getterMethod,
                 Method setterMethod)
Creates a FieldInfo associated to the given ClassInfo, describing the given a field with the given name using method (property) access.

Parameters:
declaringClassInfo - The ClassInfo this FieldInfo is associated with.
fieldType - The type of the described field.
fieldName - The name of the described field.
getterMethod - The reference to the getter method of the Field.
setterMethod - The reference to the setter method of the Field.
Method Detail

addNature

public void addNature(String nature)

Specified by:
addNature in interface NatureExtendable
See Also:
NatureExtendable.addNature(java.lang.String)

hasNature

public boolean hasNature(String nature)

Specified by:
hasNature in interface NatureExtendable
See Also:
NatureExtendable.hasNature(java.lang.String)

getProperty

public Object getProperty(String name)

Specified by:
getProperty in interface PropertyHolder
See Also:
PropertyHolder.getProperty(java.lang.String)

setProperty

public void setProperty(String name,
                        Object value)

Specified by:
setProperty in interface PropertyHolder
See Also:
PropertyHolder.setProperty(java.lang.String, java.lang.Object)

getDeclaringClassInfo

public ClassInfo getDeclaringClassInfo()
Returns the declaring ClassInfo this FieldInfo is associated with.

Returns:
the declaring ClassInfo this FieldInfo is associated with.

setDeclaringClassInfo

public void setDeclaringClassInfo(ClassInfo classInfo)
Sets the reference to the declaring ClassInfo this FieldInfo is associated with.

Parameters:
classInfo - The ClassInfo this FieldInfo is associated with.

getFieldName

public String getFieldName()
Indicates the name of the field described by this FieldInfo.

Returns:
the name of the field described by this FieldInfo.

setFieldName

public void setFieldName(String fieldName)
Sets the name of the field described by this FieldInfo.

Parameters:
fieldName - set the name of the field described by this FieldInfo.

getFieldType

public Class<?> getFieldType()
Indicates the type of the field described by this FieldInfo.

Returns:
the type of the field.

setFieldType

public void setFieldType(Class<?> fieldType)
Sets the type of the field described by this FieldInfo.

Parameters:
fieldType - The Type of the field.

getGetterMethod

public Method getGetterMethod()
Indicates the getter access method of the field.

Returns:
the getter method reference of the field.

setGetterMethod

public void setGetterMethod(Method getterMethod)
Sets the getter access method of the field.

Parameters:
getterMethod - the getter method reference.

getSetterMethod

public Method getSetterMethod()
Indicates the setter access method of the field.

Returns:
the setter method reference of the field.

setSetterMethod

public void setSetterMethod(Method setterMethod)
Sets the setter access method of the field.

Parameters:
setterMethod - the setter method reference.


Copyright © 2010. All Rights Reserved.