|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The FieldDescriptor provides read access to field's metadata description. MetaData information for example:
ME2.1 Representation:
These representations are used in interfaces available from 2.1 version
such as Row.getValue and Row.setValue methods.
Example usage: Retrieving the Field object form a Row parentRow using FieldDescriptor.RowDescriptor rowDesc = parentRow.getRowDescriptor(); FieldDescriptor fieldDesc = rowDesc.getFieldDescriptor("field name"); CharacterField charField = parentRow.getCharacterField(fieldDesc);
The field object can retrieved for the other types using the appropriate methods.
Method Summary | |
boolean |
checkFieldValue(java.lang.Object fieldValue)
Returns true if the field value represented by an Object instnace is compliant to the type , length and decimals definitions in the application's metadata. |
int |
compare(java.lang.Object comparedValue,
java.lang.Object referenceValue)
Comparison of two field values represented by Object instances. the comparison is based on field value type. |
java.lang.Object |
convertTo21DataType(java.lang.Object object)
Converts the specified object to the ME 2.1 data type. |
java.lang.Object |
convertTo25DataType(java.lang.Object object)
Converts the specified object to the ME 2.5 data type. |
FieldGroupDescriptorIterator |
getAllFieldGroupDescriptors()
Returns an iterator to all FieldGroupDescriptor objects to which this Field is a member; null if this Field is not a member of any group. |
FieldInputQualifyType |
getCreateInputQualifyType()
Identify qualification of application input when the field is created on device but is not synchronized with the backend. |
int |
getDecimals()
Returns the maximum decimal number digit length defined in the backend system. |
FieldGroupDescriptor |
getFieldGroupDescriptor(FieldGroupType type)
Returns the FieldGroupDescriptor of the specified FieldGroupType for which this Field is a member; null if this Field is not a member of any group or of the specfied group type. |
java.lang.String |
getFieldName()
Retrieves the name of the field described by this FieldDescriptor |
BasisFieldType |
getFieldType()
Retuns the BasisFieldType instance of the field described by this FieldDescriptor. |
int |
getLength()
Returns the maximum field length defined in the backend system |
FieldInputQualifyType |
getModifyInputQualifyType()
Identify qualification of applications input when the field has been synchronized with the backend. |
int |
getRealLength()
Returns the maximum real field length defined in the backend. |
RelationDescriptor |
getRelatedRelation()
Returns the RelationDescriptor instance related this FieldDescriptor. |
RowDescriptor |
getRowDescriptor()
Returns the RowDescriptor instance that contains this FieldDescriptor |
boolean |
isIndexed()
Returns the flag indicating whether the corresponding object for this FieldDescriptor is an index field or not. |
boolean |
isKey()
Returns the flag indicating whether the corresponding object for this FieldDescriptor is a key field or not. |
boolean |
signed()
Returns the flag indicating whether the length includes a sign or not. |
java.lang.Object |
to25Object(java.lang.String string)
Transformation of a field value represented by a String instance, to a field value represented by an Object instance. |
java.lang.String |
to25String(java.lang.Object object)
Transformation of a field value represented by an Object instance into a field value represented by a String instance. |
java.lang.Object |
toObject(java.lang.String string)
Deprecated. |
java.lang.String |
toString(java.lang.Object object)
Deprecated. |
Methods inherited from interface com.sap.ip.me.api.persist.meta.AttributeDescriptor |
getMultiple, getName, getType, isIndex, toSqlString |
Method Detail |
public java.lang.String getFieldName()
public BasisFieldType getFieldType()
BasisFieldType
public int getLength()
getLength
in interface AttributeDescriptor
public int getRealLength()
public int getDecimals()
getDecimals
in interface AttributeDescriptor
public FieldInputQualifyType getCreateInputQualifyType()
FieldInputQualifyType
public FieldInputQualifyType getModifyInputQualifyType()
FieldInputQualifyType
public boolean isKey()
public boolean signed()
public boolean isIndexed()
public RelationDescriptor getRelatedRelation()
RelationDescriptor
public RowDescriptor getRowDescriptor()
RowDescriptor
public java.lang.String toString(java.lang.Object object)
object
- the field value in Object representation
public java.lang.Object toObject(java.lang.String string)
string
- the String field value
public boolean checkFieldValue(java.lang.Object fieldValue)
fieldValue
- the field value to be tested
public int compare(java.lang.Object comparedValue, java.lang.Object referenceValue)
comparedValue
- the Object to be comparedreferenceValue
- the Object used as a reference of comparison
public java.lang.String to25String(java.lang.Object object)
object
- the field value in ME2.5 Object representation
public java.lang.Object to25Object(java.lang.String string)
string
- the String field value
public FieldGroupDescriptorIterator getAllFieldGroupDescriptors()
<SyncBO id="SAP001" version="1" type="timedTwoWay" allowCreate="true" allowModify="true" allowDelete="true" reqDirectSync="false"> <TopStructure name="TOP"> <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true"> <Input type="create">false</Input> <Input type="modify">false</Input> </Field> <Field name="NFIELD" type="N" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false" /> <Field name="CFIELD" type="C" length="50" decimalLength="0" signed="false" isKey="false" isIndex="false" /> <Field name="DFIELD" type="D" length="8" decimalLength="0" signed="false" isKey="false" isIndex="false" /> <Field name="TFIELD" type="T" length="6" decimalLength="0" signed="false" isKey="false" isIndex="false" /> <Field name="PFIELD" type="P" length="10" decimalLength="3" signed="false" isKey="false" isIndex="false" /> <FieldGroup name="GROUP1" type="T"> <Field name="DFIELD" /> <Field name="TFIELD" /> </FieldGroup> <FieldGroup name="GROUP2" type="O"> <Field name="NFIELD" /> <Field name="PFIELD" /> <Field name="CFIELD" /> </FieldGroup> </TopStructure> </SyncBO> TopRowDescriptor topDesc // assume that we have already assined FieldGroupDescriptorIterator itr = topDesc.getFieldDescriptor("DFIELD").getAllFieldGroupDescriptors(); while(itr.hasNext()) { FieldGroupDescriptor group = itr.next(); System.out.println("group name:"+group.getName()); } Output: group name:GROUP1
public FieldGroupDescriptor getFieldGroupDescriptor(FieldGroupType type)
TopRowDescriptor topDesc // assume that we have already assined FieldGroupDescriptor group = topDesc.getFieldDescriptor("DFIELD").getFieldGroupDescriptor(FieldGroupType.T); System.out.println("group name:"+group.getName()); Output: group name:GROUP1
type
- field group type
public java.lang.Object convertTo21DataType(java.lang.Object object)
object
-
public java.lang.Object convertTo25DataType(java.lang.Object object)
object
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |