|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A Field represents a specific field with its meta info - FieldDescriptor. A Row has an array of Field objects that holds the every values set into it. The Field defines the accessor methods to every field value in a Row as well as some getter methods to the attributes of a Field.
Field object instance can be retrieved from its corresponding Row object, by passing the appropriate FieldDescriptor as the parameter. Field object is bound to an appropriate FieldDescriptor value inside.
Usage Examples:
Getting a Field instance from an existing Row:
//retrieving a field instance from a Row using the FieldDescriptor
Field delvDateField = existingRow.getField(delvDateFieldDescriptor);
//retrieving the Row's key field
Field keyField = existingRow.getKeyField();
Accessing the Field value:
TimeField
Getting the value of the TimeField.
java.sql.Time fieldValue = timeDateField.getSqlTime();
Setting a new field value to the Time field
timeDateField.setValue(java.sql.Time.valueOf("12:00:00"));
CharacterField
Getting the value of the CharacterField.
String fieldValue = characterField.getCharacters();
Setting a new field value to the Character field
fieldValue.setValue("new Value");
DecimalField
Getting the value of the DecimalField.
BigDecimal fieldValue = decimalField.getBigDecimal();
Setting a new field value to the Decimal field.
fieldValue.setValue(new BigDecimal("123456789"));
NumericField
Getting the value of the NumericField.
BigInteger fieldValue = NumericField.getBigInteger();
Setting a new field value to the Numeric Field.
fieldValue.setValue(new BigInteger("123456789"));
The value can also be retrieved by the getValue method which can be cast to
the appropriate object type.
java.sql.Date fieldValue = (java.sql.Date)fieldObject.getValue();
DateField
Getting the value of the DateField.
java.sql.Date fieldValue = delvDateField.getSqlDate();
Setting a new field value to the date field
delvDateField.setValue(java.sql.Date.valueOf("2003-11-22"));
Retrieving the other grouped Fields:
e.g. delvDate and delvTime fields are grouped together in the metadata
grouptype for date and time is T
Field[] groupMates = delvDateField.getGroupFields(FieldGroupType.T);
Field delvTimeField = groupMates[0];
Or using the specific type
DateField delvDateField = parentRow.getDateField(delvDateFieldDescriptor);
TimeField delvTimeField = delvDateField.getPairedTimeField();
Copyright: Copyright (c) 2002
Company: SAP AG
| Method Summary | |
FieldDescriptor |
getFieldDescriptor()
Returns The FieldDescriptor of the Field object. |
Field[] |
getGroupFields(FieldGroupType fieldGroupType)
Returns an array of other Field objects that are in the same specified group type. |
Row |
getRow()
Returns the row attribute of the Field object to which this Field instance belongs. |
java.lang.Object |
getValue()
Gets the value attribute of the Field object |
void |
setValue(java.lang.Object fieldValue)
Sets the value attribute of the Field object |
| Method Detail |
public java.lang.Object getValue()
public void setValue(java.lang.Object fieldValue)
throws ModificationNotAllowedException,
PersistenceException
fieldValue - The new value
ModificationNotAllowedException - thrown if the operation is not complying with the rules set in the metadata definition.
PersistenceException - thrown if any persistent layer exception occurred during the retrievalpublic Row getRow()
public Field[] getGroupFields(FieldGroupType fieldGroupType)
fieldGroupType - the type of Field grouping
FieldGroupTypepublic FieldDescriptor getFieldDescriptor()
FieldDescriptor
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||