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
Modifier 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, myType
Fields inherited from interface org.eclipse.persistence.internal.eis.cobol.FieldMetaData
ALPHA_NUMERIC, ALPHABETIC, BINARY, COMPOSITE, MANTISSA, NUMERIC, PACKED_DECIMAL, VOID
-
Constructor Summary
ConstructorDescriptionCompositeFieldMetaData
(String fieldName, String recordName) CompositeFieldMetaData
(String fieldName, RecordMetaData record) CompositeFieldMetaData
(String fieldName, RecordMetaData record, Vector<FieldMetaData> fields) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addField
(FieldMetaData newField) adds a field to the collectiondeepCopy()
performs a deep copy of all subordiate fields in themyCompositeFields
attributeextractValueFromArray
(byte[] recordData) loops through the subordinate fields extracting the value from each.int
a composite field can't have a decimal positiongetFieldNamed
(String fieldName) returns the first subordinate field with a name matching the string infieldName
returns a collection of subordinate fieldsint
getSize()
overidesElementaryFieldMetaData
to calculate the fields size from all the sizes of its subordinate fields.int
getType()
a composite field is by definition going to be compositeboolean
a composite field can't have a decimal positionprotected void
protected void
initialize
(Vector<FieldMetaData> fields) boolean
a composite field is by definition going to be compositeprotected void
method resets offsets of subordinate fields, should be called when the offset of the parent is changed.void
a composite field can't have a decimal positionvoid
setFields
(Vector<FieldMetaData> newCompositeFields) sets the composite field attribute to the new collectionvoid
setSize
(int size) we don't want to set the size for a composite field because its size is determined from its subordinate fields.void
setType
(int type) a composite field is by definition going to be composite, so this cannot be changedprotected void
writeCompositeOnArray
(CobolRow row, byte[] recordData) This method is used by fields that are array values to write themselves to arraysvoid
writeCompositeOnRow
(CobolRow row, byte[] recordData) writes individual fields on given rowvoid
writeOnArray
(CobolRow row, byte[] recordData) takes the value from the row for this field and writes it to the byte arrayvoid
writeOnRow
(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, setRecord
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
initialize
in classElementaryFieldMetaData
-
initialize
-
deepCopy
performs a deep copy of all subordiate fields in themyCompositeFields
attribute- Specified by:
deepCopy
in interfaceFieldMetaData
- Overrides:
deepCopy
in classElementaryFieldMetaData
-
getSize
public int getSize()overidesElementaryFieldMetaData
to calculate the fields size from all the sizes of its subordinate fields.- Specified by:
getSize
in interfaceFieldMetaData
- Overrides:
getSize
in 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:
setSize
in interfaceFieldMetaData
- Overrides:
setSize
in classElementaryFieldMetaData
-
hasDecimal
public boolean hasDecimal()a composite field can't have a decimal position- Specified by:
hasDecimal
in interfaceFieldMetaData
- Overrides:
hasDecimal
in classElementaryFieldMetaData
-
getDecimalPosition
public int getDecimalPosition()a composite field can't have a decimal position- Specified by:
getDecimalPosition
in interfaceFieldMetaData
- Overrides:
getDecimalPosition
in 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:
isComposite
in interfaceFieldMetaData
- Overrides:
isComposite
in classElementaryFieldMetaData
-
getType
public int getType()a composite field is by definition going to be composite- Specified by:
getType
in interfaceFieldMetaData
- Overrides:
getType
in classElementaryFieldMetaData
-
setType
public void setType(int type) a composite field is by definition going to be composite, so this cannot be changed- Specified by:
setType
in interfaceFieldMetaData
- Overrides:
setType
in classElementaryFieldMetaData
-
getFields
returns a collection of subordinate fields- Specified by:
getFields
in interfaceCompositeObject
-
setFields
sets the composite field attribute to the new collection- Specified by:
setFields
in interfaceCompositeObject
-
addField
adds a field to the collection- Specified by:
addField
in interfaceCompositeObject
-
getFieldNamed
returns the first subordinate field with a name matching the string infieldName
- Specified by:
getFieldNamed
in interfaceCompositeObject
-
extractValueFromArray
loops through the subordinate fields extracting the value from each.- Specified by:
extractValueFromArray
in interfaceFieldMetaData
- Overrides:
extractValueFromArray
in 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:
writeOnRow
in interfaceFieldMetaData
- Overrides:
writeOnRow
in classElementaryFieldMetaData
-
writeOnArray
takes the value from the row for this field and writes it to the byte array- Specified by:
writeOnArray
in interfaceFieldMetaData
- Overrides:
writeOnArray
in 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.
-