Class ElementaryFieldMetaData

java.lang.Object
org.eclipse.persistence.internal.eis.cobol.ElementaryFieldMetaData
All Implemented Interfaces:
FieldMetaData
Direct Known Subclasses:
CompositeFieldMetaData

public class ElementaryFieldMetaData extends Object implements FieldMetaData
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 Details

    • myRecord

      protected RecordMetaData myRecord
      This is the record that contains this field
    • myName

      protected String myName
      This is the name of the field
    • mySize

      protected int mySize
      This is the size of the field
    • myOffset

      protected int myOffset
      This is the offset of the field within the record byte array
    • myType

      protected int myType
      This is the type of data the field contains
    • isRedefine

      protected boolean isRedefine
      This is true if this field is redefined
    • decimalPosition

      protected int decimalPosition
      This is the offset of the decimal position within the digits of a numeric field
    • myFieldRedefined

      protected FieldMetaData myFieldRedefined
      This is the field that this field redefines
    • myArraySize

      protected int myArraySize
      This is the number of elements in the array if this field is an array type
    • myDependentFieldName

      protected String myDependentFieldName
      This is populated if the arraySize is dependent on another field
    • isSigned

      protected boolean isSigned
      This is true if the field is a numeric field that is signed
  • Constructor Details

    • ElementaryFieldMetaData

      public ElementaryFieldMetaData()
    • ElementaryFieldMetaData

      public ElementaryFieldMetaData(String fieldName, String recordName)
    • ElementaryFieldMetaData

      public ElementaryFieldMetaData(String fieldName, RecordMetaData record)
  • Method Details

    • initialize

      protected void initialize()
    • initialize

      protected void initialize(String fieldName, String recordName)
    • initialize

      protected void initialize(String fieldName, RecordMetaData record)
    • deepCopy

      public FieldMetaData deepCopy()
      performs a deep copy of all the attributes of the field
      Specified by:
      deepCopy in interface FieldMetaData
    • isSigned

      public boolean isSigned()
      returns true if field is a signed numeric field
      Specified by:
      isSigned in interface FieldMetaData
    • setIsSigned

      public void setIsSigned(boolean signed)
      setter for isSigned
      Specified by:
      setIsSigned in interface FieldMetaData
    • hasDecimal

      public boolean hasDecimal()
      returns true if the field is a numeric field with a decimal marker
      Specified by:
      hasDecimal in interface FieldMetaData
    • getDecimalPosition

      public int getDecimalPosition()
      getter for decimalPosition
      Specified by:
      getDecimalPosition in interface FieldMetaData
    • setDecimalPosition

      public void setDecimalPosition(int newPosition)
      setter for decimalPosition
      Specified by:
      setDecimalPosition in interface FieldMetaData
    • getName

      public String getName()
      getter for myName
      Specified by:
      getName in interface FieldMetaData
    • setName

      public void setName(String newName)
      setter for myName
      Specified by:
      setName in interface FieldMetaData
    • getRecord

      public RecordMetaData getRecord()
      getter for myRecord
      Specified by:
      getRecord in interface FieldMetaData
    • setRecord

      public void setRecord(RecordMetaData newRecord)
      setter for myRecord
      Specified by:
      setRecord in interface FieldMetaData
    • 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 interface FieldMetaData
    • setSize

      public void setSize(int size)
      setter for mySize
      Specified by:
      setSize in interface FieldMetaData
    • isComposite

      public boolean isComposite()
      returns true if field is composite, since this is elementary, it always returns false
      Specified by:
      isComposite in interface FieldMetaData
    • getCompositeFields

      public Vector 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 interface FieldMetaData
    • setOffset

      public void setOffset(int offset)
      setter for myOffset
      Specified by:
      setOffset in interface FieldMetaData
    • getType

      public int getType()
      getter for myType
      Specified by:
      getType in interface FieldMetaData
    • setType

      public void setType(int type)
      setter for myType
      Specified by:
      setType in interface FieldMetaData
    • isFieldRedefine

      public boolean isFieldRedefine()
      returns true if field is a redefine
      Specified by:
      isFieldRedefine in interface FieldMetaData
    • setIsFieldRedefine

      public void setIsFieldRedefine(boolean status)
      setter for isRedefine
      Specified by:
      setIsFieldRedefine in interface FieldMetaData
    • setFieldRedefined

      public void setFieldRedefined(FieldMetaData field)
      setter for myFieldRedefined
      Specified by:
      setFieldRedefined in interface FieldMetaData
    • getFieldRedefined

      public FieldMetaData getFieldRedefined()
      getter for myFieldRedefined
      Specified by:
      getFieldRedefined in interface FieldMetaData
    • isArray

      public boolean isArray()
      returns true if field is an array
      Specified by:
      isArray in interface FieldMetaData
    • getArraySize

      public int getArraySize()
      getter for array size
      Specified by:
      getArraySize in interface FieldMetaData
    • setArraySize

      public void setArraySize(int newSize)
      setter for myArraySize
      Specified by:
      setArraySize in interface FieldMetaData
    • dependsOn

      public boolean dependsOn()
      returns true if this field has a dependent field
      Specified by:
      dependsOn in interface FieldMetaData
    • getDependentFieldName

      public String getDependentFieldName()
      getter for myDependentFieldName
      Specified by:
      getDependentFieldName in interface FieldMetaData
    • setDependentFieldName

      public void setDependentFieldName(String fieldName)
      setter for myDependentFieldName
      Specified by:
      setDependentFieldName in interface FieldMetaData
    • extractValueFromArray

      public Object extractValueFromArray(byte[] recordData)
      this method extracts and returns the value for the field, if the field is an array, the value is an Vector
      Specified by:
      extractValueFromArray in interface FieldMetaData
    • adjustArraySize

      protected void adjustArraySize(CobolRow row)
      this method adjusts the array size to the value in its dependent field
    • writeOnRow

      public void writeOnRow(CobolRow row, byte[] recordData)
      this method will write its value to the row provided
      Specified by:
      writeOnRow in interface FieldMetaData
    • writeOnArray

      public void writeOnArray(CobolRow row, byte[] recordData)
      this method will write its value from the row to the record data byte array
      Specified by:
      writeOnArray in interface FieldMetaData