Class CompositeFieldMetaData
java.lang.Object
org.eclipse.persistence.internal.eis.cobol.ElementaryFieldMetaData
org.eclipse.persistence.internal.eis.cobol.CompositeFieldMetaData
- All Implemented Interfaces:
CompositeObject,FieldMetaData
Purpose: This class represents metadata for composite fields. It exetends
ElementaryFieldMetaData and adds teh attribute myCompositeFields
which is a collection of subordinate fields.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<FieldMetaData> collection containing this fields subordinate fieldsFields inherited from class org.eclipse.persistence.internal.eis.cobol.ElementaryFieldMetaData
decimalPosition, isRedefine, isSigned, myArraySize, myDependentFieldName, myFieldRedefined, myName, myOffset, myRecord, mySize, myTypeFields inherited from interface org.eclipse.persistence.internal.eis.cobol.FieldMetaData
ALPHA_NUMERIC, ALPHABETIC, BINARY, COMPOSITE, MANTISSA, NUMERIC, PACKED_DECIMAL, VOID -
Constructor Summary
ConstructorsConstructorDescriptionCompositeFieldMetaData(String fieldName, String recordName) CompositeFieldMetaData(String fieldName, RecordMetaData record) CompositeFieldMetaData(String fieldName, RecordMetaData record, Vector<FieldMetaData> fields) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(FieldMetaData newField) adds a field to the collectiondeepCopy()performs a deep copy of all subordiate fields in themyCompositeFieldsattributeextractValueFromArray(byte[] recordData) loops through the subordinate fields extracting the value from each.inta composite field can't have a decimal positiongetFieldNamed(String fieldName) returns the first subordinate field with a name matching the string infieldNamereturns a collection of subordinate fieldsintgetSize()overidesElementaryFieldMetaDatato calculate the fields size from all the sizes of its subordinate fields.intgetType()a composite field is by definition going to be compositebooleana composite field can't have a decimal positionprotected voidprotected voidinitialize(Vector<FieldMetaData> fields) booleana composite field is by definition going to be compositeprotected voidmethod resets offsets of subordinate fields, should be called when the offset of the parent is changed.voida composite field can't have a decimal positionvoidsetFields(Vector<FieldMetaData> newCompositeFields) sets the composite field attribute to the new collectionvoidsetSize(int size) we don't want to set the size for a composite field because its size is determined from its subordinate fields.voidsetType(int type) a composite field is by definition going to be composite, so this cannot be changedprotected voidwriteCompositeOnArray(CobolRow row, byte[] recordData) This method is used by fields that are array values to write themselves to arraysvoidwriteCompositeOnRow(CobolRow row, byte[] recordData) writes individual fields on given rowvoidwriteOnArray(CobolRow row, byte[] recordData) takes the value from the row for this field and writes it to the byte arrayvoidwriteOnRow(CobolRow row, byte[] recordData) extracts the value from the record data for the field and writes it to the row.Methods inherited from class org.eclipse.persistence.internal.eis.cobol.ElementaryFieldMetaData
adjustArraySize, dependsOn, getArraySize, getCompositeFields, getDependentFieldName, getFieldRedefined, getName, getOffset, getRecord, initialize, initialize, isArray, isFieldRedefine, isSigned, setArraySize, setDecimalPosition, setDependentFieldName, setFieldRedefined, setIsFieldRedefine, setIsSigned, setName, setOffset, setRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.persistence.internal.eis.cobol.CompositeObject
getName
-
Field Details
-
myCompositeFields
collection containing this fields subordinate fields
-
-
Constructor Details
-
CompositeFieldMetaData
public CompositeFieldMetaData() -
CompositeFieldMetaData
-
CompositeFieldMetaData
-
CompositeFieldMetaData
public CompositeFieldMetaData(String fieldName, RecordMetaData record, Vector<FieldMetaData> fields)
-
-
Method Details
-
initialize
protected void initialize()- Overrides:
initializein classElementaryFieldMetaData
-
initialize
-
deepCopy
performs a deep copy of all subordiate fields in themyCompositeFieldsattribute- Specified by:
deepCopyin interfaceFieldMetaData- Overrides:
deepCopyin classElementaryFieldMetaData
-
getSize
public int getSize()overidesElementaryFieldMetaDatato calculate the fields size from all the sizes of its subordinate fields.- Specified by:
getSizein interfaceFieldMetaData- Overrides:
getSizein classElementaryFieldMetaData
-
setSize
public void setSize(int size) we don't want to set the size for a composite field because its size is determined from its subordinate fields.- Specified by:
setSizein interfaceFieldMetaData- Overrides:
setSizein classElementaryFieldMetaData
-
hasDecimal
public boolean hasDecimal()a composite field can't have a decimal position- Specified by:
hasDecimalin interfaceFieldMetaData- Overrides:
hasDecimalin classElementaryFieldMetaData
-
getDecimalPosition
public int getDecimalPosition()a composite field can't have a decimal position- Specified by:
getDecimalPositionin interfaceFieldMetaData- Overrides:
getDecimalPositionin classElementaryFieldMetaData
-
setDecimalPosition
public void setDecimalPosition()a composite field can't have a decimal position -
isComposite
public boolean isComposite()a composite field is by definition going to be composite- Specified by:
isCompositein interfaceFieldMetaData- Overrides:
isCompositein classElementaryFieldMetaData
-
getType
public int getType()a composite field is by definition going to be composite- Specified by:
getTypein interfaceFieldMetaData- Overrides:
getTypein classElementaryFieldMetaData
-
setType
public void setType(int type) a composite field is by definition going to be composite, so this cannot be changed- Specified by:
setTypein interfaceFieldMetaData- Overrides:
setTypein classElementaryFieldMetaData
-
getFields
returns a collection of subordinate fields- Specified by:
getFieldsin interfaceCompositeObject
-
setFields
sets the composite field attribute to the new collection- Specified by:
setFieldsin interfaceCompositeObject
-
addField
adds a field to the collection- Specified by:
addFieldin interfaceCompositeObject
-
getFieldNamed
returns the first subordinate field with a name matching the string infieldName- Specified by:
getFieldNamedin interfaceCompositeObject
-
extractValueFromArray
loops through the subordinate fields extracting the value from each.- Specified by:
extractValueFromArrayin interfaceFieldMetaData- Overrides:
extractValueFromArrayin classElementaryFieldMetaData
-
writeCompositeOnRow
writes individual fields on given row -
writeOnRow
extracts the value from the record data for the field and writes it to the row.- Specified by:
writeOnRowin interfaceFieldMetaData- Overrides:
writeOnRowin classElementaryFieldMetaData
-
writeOnArray
takes the value from the row for this field and writes it to the byte array- Specified by:
writeOnArrayin interfaceFieldMetaData- Overrides:
writeOnArrayin classElementaryFieldMetaData
-
writeCompositeOnArray
This method is used by fields that are array values to write themselves to arrays -
resetChildOffsets
protected void resetChildOffsets()method resets offsets of subordinate fields, should be called when the offset of the parent is changed.
-