|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.nec.tdd.tools.dbMapper.ORFieldInfo
This class encapsulates a (class) field information for an object-relation mapping (ORMapEntry). An OR field can be of any of the following types:
An instance of this class is created per field tag specified in OR mapping (xml) file.
Inner Class Summary | |
static class |
ORFieldInfo.BasicTypeInfo
Stores additional information for an ORFieldInfo of basic type. |
static class |
ORFieldInfo.MultipleEntryTypeInfo
Stores additional information for an ORFieldInfo of multiple-entry type. |
static class |
ORFieldInfo.NestedTypeInfo
Stores additional information for a nested type field. |
static class |
ORFieldInfo.SingleEntryTypeInfo
Stores additional information for an ORFieldInfo of single-entry type. |
Fields inherited from interface com.nec.tdd.tools.dbMapper.Constants |
BOOLEAN_TYPE, BYTE_TYPE, CHAR_TYPE, DEFAULT_POOL_CAPACITY_INCREMENT, DEFAULT_POOL_INITIAL_CAPACITY, DOUBLE_TYPE, FIELD_TYPE_PRIMITIVE_CLASSES, FIELD_TYPE_WRAPPER_CLASSES, FLOAT_TYPE, INT_TYPE, LONG_TYPE, MAX_DEPTH, OBJECT_TYPE, SHORT_TYPE, STRING_TYPE |
Constructor Summary | |
ORFieldInfo(ORMapEntry mapEntry,
java.lang.String fieldName,
java.lang.String getMethodName,
java.lang.String setMethodName,
boolean isKey,
java.lang.Object typeInfo)
Constructs an ORFieldInfo with given field information. |
Method Summary | |
static java.lang.String |
generateGetMethodName(java.lang.String fieldName)
Generate accessor/getter method name from a field name using Sun Java Bean pattern. |
static java.lang.String |
generateSetMethodName(java.lang.String fieldName)
Generate modifier/setter method name from a field name using Sun Java Bean pattern. |
ORFieldInfo.BasicTypeInfo |
getBasicTypeInfo()
Returns additional information wrapped in BasicTypeInfo object for a basic field. Note: This method may throw a ClassCastException if field is not of basic type. |
java.lang.reflect.Method |
getGetMethod()
Get the accessor method of mapping class that will be used to extract field value from a user object designated by this ORFieldInfo. |
java.lang.String |
getGetMethodName()
Get the accessor method name of mapping class that will be used to extract field value from a user object designated by this ORFieldInfo. |
ORFieldInfo.MultipleEntryTypeInfo |
getMultipleEntryTypeInfo()
Returns additional information wrapped in MultipleEntryTypeInfo object for a non-basic multiple-entry field. Note: This method may throw a ClassCastException if field is not of multiple-entry type. |
java.lang.String |
getName()
Returns the field name associated with this ORFieldInfo. |
ORFieldInfo.NestedTypeInfo |
getNestedTypeInfo()
Returns additional information wrapped in NestedTypeInfo object for a nested type field. Note: This method may throw a ClassCastException if field is not of nested type. |
java.lang.reflect.Method |
getSetMethod()
Get the modifier method of mapping class that will be used to set field value of a user object designated by this ORFieldInfo. |
java.lang.String |
getSetMethodName()
Get the modifier method name of mapping class that will be used to set field value of a user object designated by this ORFieldInfo. |
ORFieldInfo.SingleEntryTypeInfo |
getSingleEntryTypeInfo()
Returns additional information wrapped in SingleEntryTypeInfo object for a non-basic single-entry field. Note: This method may throw a ClassCastException if field is not of single-entry type. |
boolean |
isBasicType()
Returns true if this field is of basic type, false otherwise. |
boolean |
isKey()
Returns true if this ORFieldInfo is a key field for mapEntry, false otherwise. |
boolean |
isMultipleEntryType()
Returns true if this field is of non-basic multiple-entry type, false otherwise. |
boolean |
isNestedType()
Returns true if this field is of nested type, false otherwise. |
boolean |
isSingleEntryType()
Returns true if this field is of non-basic single-entry type, false otherwise. |
java.lang.String |
toString()
Returns string representation of ORFieldInfo, containing the string representation of underlying typeInfo object (based on field type). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ORFieldInfo(ORMapEntry mapEntry, java.lang.String fieldName, java.lang.String getMethodName, java.lang.String setMethodName, boolean isKey, java.lang.Object typeInfo) throws java.lang.Exception
mapEntry
- The OR mapping entry to which this field
information belongs to.fieldName
- The field name.getMethodName
- Accessor method name of mapping class that
will be used to extract field value from a user
object designated by the fieldName. A null value
indicates that get method should be automatically
generated from fieldName. Sun Java Bean
recommendation is used to generate
getter method names from fieldName. For nested
type this parameter is ignored.setMethodName
- Modifier method name of mapping class that
will be used to set field value of a user
object designated by the fieldName. A null value
indicates that set method should be automatically
generated from fieldName. Sun Java Bean
recommendation is used to generate setter
method name from fieldName. For nested type this
parameter is ignored.isKey
- Set to true if this a key field for mapEntry, false
otherwise. Indicates the value of "isKey" (xml) tag
for given field in mapping file.typeInfo
- An instance of BasicTypeInfo, SingleEntryTypeInfo
or MultipleEntryTypeInfo, to provide additional
information for the field based on its type.java.lang.Exception
- if a validation error occurs.Method Detail |
public java.lang.String getName()
public java.lang.reflect.Method getGetMethod() throws java.lang.Exception
java.lang.Exception
- if matching getter method is not found in mapping
class or mapping class can not be located.public java.lang.String getGetMethodName()
public java.lang.reflect.Method getSetMethod() throws java.lang.Exception
java.lang.Exception
- if matching setter method is not found in mapping
class or mapping class can not be located.public java.lang.String getSetMethodName()
public boolean isKey()
public boolean isBasicType()
public ORFieldInfo.BasicTypeInfo getBasicTypeInfo()
public boolean isNestedType()
public ORFieldInfo.NestedTypeInfo getNestedTypeInfo()
public boolean isSingleEntryType()
public ORFieldInfo.SingleEntryTypeInfo getSingleEntryTypeInfo()
public boolean isMultipleEntryType()
public ORFieldInfo.MultipleEntryTypeInfo getMultipleEntryTypeInfo()
public static java.lang.String generateGetMethodName(java.lang.String fieldName)
fieldName
- the field name for which get method name being
generated.public static java.lang.String generateSetMethodName(java.lang.String fieldName)
fieldName
- the field name for which set method name being
generated.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |