Class ElementaryFieldMetaData
java.lang.Object
org.eclipse.persistence.internal.eis.cobol.ElementaryFieldMetaData
- All Implemented Interfaces:
FieldMetaData
- Direct Known Subclasses:
CompositeFieldMetaData
Purpose: This class defines the
FieldMetaData
interface it defines
various behavior associated with a field and stores meta-information about the field.
ElementaryFieldMetaData
represents a field that contains a direct value and
no subordinate fields, a root in the hierarchy.-
Field Summary
Modifier and TypeFieldDescriptionprotected int
This is the offset of the decimal position within the digits of a numeric fieldprotected boolean
This is true if this field is redefinedprotected boolean
This is true if the field is a numeric field that is signedprotected int
This is the number of elements in the array if this field is an array typeprotected String
This is populated if the arraySize is dependent on another fieldprotected FieldMetaData
This is the field that this field redefinesprotected String
This is the name of the fieldprotected int
This is the offset of the field within the record byte arrayprotected RecordMetaData
This is the record that contains this fieldprotected int
This is the size of the fieldprotected int
This is the type of data the field containsFields inherited from interface org.eclipse.persistence.internal.eis.cobol.FieldMetaData
ALPHA_NUMERIC, ALPHABETIC, BINARY, COMPOSITE, MANTISSA, NUMERIC, PACKED_DECIMAL, VOID
-
Constructor Summary
ConstructorDescriptionElementaryFieldMetaData
(String fieldName, String recordName) ElementaryFieldMetaData
(String fieldName, RecordMetaData record) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
adjustArraySize
(CobolRow row) this method adjusts the array size to the value in its dependent fielddeepCopy()
performs a deep copy of all the attributes of the fieldboolean
returns true if this field has a dependent fieldextractValueFromArray
(byte[] recordData) this method extracts and returns the value for the field, if the field is an array, the value is anVector
int
getter for array sizereturns an empty vector since an elementary field should have no subordinate fieldsint
getter for decimalPositiongetter for myDependentFieldNamegetter for myFieldRedefinedgetName()
getter for myNameint
getter for myOffsetgetter for myRecordint
getSize()
getter for mySize, multiplies field size my array size if field is an array to get total sizeint
getType()
getter for myTypeboolean
returns true if the field is a numeric field with a decimal markerprotected void
protected void
initialize
(String fieldName, String recordName) protected void
initialize
(String fieldName, RecordMetaData record) boolean
isArray()
returns true if field is an arrayboolean
returns true if field is composite, since this is elementary, it always returns falseboolean
returns true if field is a redefineboolean
isSigned()
returns true if field is a signed numeric fieldvoid
setArraySize
(int newSize) setter for myArraySizevoid
setDecimalPosition
(int newPosition) setter for decimalPositionvoid
setDependentFieldName
(String fieldName) setter for myDependentFieldNamevoid
setFieldRedefined
(FieldMetaData field) setter for myFieldRedefinedvoid
setIsFieldRedefine
(boolean status) setter for isRedefinevoid
setIsSigned
(boolean signed) setter for isSignedvoid
setter for myNamevoid
setOffset
(int offset) setter for myOffsetvoid
setRecord
(RecordMetaData newRecord) setter for myRecordvoid
setSize
(int size) setter for mySizevoid
setType
(int type) setter for myTypevoid
writeOnArray
(CobolRow row, byte[] recordData) this method will write its value from the row to the record data byte arrayvoid
writeOnRow
(CobolRow row, byte[] recordData) this method will write its value to the row provided
-
Field Details
-
myRecord
This is the record that contains this field -
myName
This is the name of the field -
mySize
protected int mySizeThis is the size of the field -
myOffset
protected int myOffsetThis is the offset of the field within the record byte array -
myType
protected int myTypeThis is the type of data the field contains -
isRedefine
protected boolean isRedefineThis is true if this field is redefined -
decimalPosition
protected int decimalPositionThis is the offset of the decimal position within the digits of a numeric field -
myFieldRedefined
This is the field that this field redefines -
myArraySize
protected int myArraySizeThis is the number of elements in the array if this field is an array type -
myDependentFieldName
This is populated if the arraySize is dependent on another field -
isSigned
protected boolean isSignedThis is true if the field is a numeric field that is signed
-
-
Constructor Details
-
ElementaryFieldMetaData
public ElementaryFieldMetaData() -
ElementaryFieldMetaData
-
ElementaryFieldMetaData
-
-
Method Details
-
initialize
protected void initialize() -
initialize
-
initialize
-
deepCopy
performs a deep copy of all the attributes of the field- Specified by:
deepCopy
in interfaceFieldMetaData
-
isSigned
public boolean isSigned()returns true if field is a signed numeric field- Specified by:
isSigned
in interfaceFieldMetaData
-
setIsSigned
public void setIsSigned(boolean signed) setter for isSigned- Specified by:
setIsSigned
in interfaceFieldMetaData
-
hasDecimal
public boolean hasDecimal()returns true if the field is a numeric field with a decimal marker- Specified by:
hasDecimal
in interfaceFieldMetaData
-
getDecimalPosition
public int getDecimalPosition()getter for decimalPosition- Specified by:
getDecimalPosition
in interfaceFieldMetaData
-
setDecimalPosition
public void setDecimalPosition(int newPosition) setter for decimalPosition- Specified by:
setDecimalPosition
in interfaceFieldMetaData
-
getName
getter for myName- Specified by:
getName
in interfaceFieldMetaData
-
setName
setter for myName- Specified by:
setName
in interfaceFieldMetaData
-
getRecord
getter for myRecord- Specified by:
getRecord
in interfaceFieldMetaData
-
setRecord
setter for myRecord- Specified by:
setRecord
in interfaceFieldMetaData
-
getSize
public int getSize()getter for mySize, multiplies field size my array size if field is an array to get total size- Specified by:
getSize
in interfaceFieldMetaData
-
setSize
public void setSize(int size) setter for mySize- Specified by:
setSize
in interfaceFieldMetaData
-
isComposite
public boolean isComposite()returns true if field is composite, since this is elementary, it always returns false- Specified by:
isComposite
in interfaceFieldMetaData
-
getCompositeFields
returns an empty vector since an elementary field should have no subordinate fields -
getOffset
public int getOffset()getter for myOffset- Specified by:
getOffset
in interfaceFieldMetaData
-
setOffset
public void setOffset(int offset) setter for myOffset- Specified by:
setOffset
in interfaceFieldMetaData
-
getType
public int getType()getter for myType- Specified by:
getType
in interfaceFieldMetaData
-
setType
public void setType(int type) setter for myType- Specified by:
setType
in interfaceFieldMetaData
-
isFieldRedefine
public boolean isFieldRedefine()returns true if field is a redefine- Specified by:
isFieldRedefine
in interfaceFieldMetaData
-
setIsFieldRedefine
public void setIsFieldRedefine(boolean status) setter for isRedefine- Specified by:
setIsFieldRedefine
in interfaceFieldMetaData
-
setFieldRedefined
setter for myFieldRedefined- Specified by:
setFieldRedefined
in interfaceFieldMetaData
-
getFieldRedefined
getter for myFieldRedefined- Specified by:
getFieldRedefined
in interfaceFieldMetaData
-
isArray
public boolean isArray()returns true if field is an array- Specified by:
isArray
in interfaceFieldMetaData
-
getArraySize
public int getArraySize()getter for array size- Specified by:
getArraySize
in interfaceFieldMetaData
-
setArraySize
public void setArraySize(int newSize) setter for myArraySize- Specified by:
setArraySize
in interfaceFieldMetaData
-
dependsOn
public boolean dependsOn()returns true if this field has a dependent field- Specified by:
dependsOn
in interfaceFieldMetaData
-
getDependentFieldName
getter for myDependentFieldName- Specified by:
getDependentFieldName
in interfaceFieldMetaData
-
setDependentFieldName
setter for myDependentFieldName- Specified by:
setDependentFieldName
in interfaceFieldMetaData
-
extractValueFromArray
this method extracts and returns the value for the field, if the field is an array, the value is anVector
- Specified by:
extractValueFromArray
in interfaceFieldMetaData
-
adjustArraySize
this method adjusts the array size to the value in its dependent field -
writeOnRow
this method will write its value to the row provided- Specified by:
writeOnRow
in interfaceFieldMetaData
-
writeOnArray
this method will write its value from the row to the record data byte array- Specified by:
writeOnArray
in interfaceFieldMetaData
-