Interface JCoRecordMetaData

All Superinterfaces:
Cloneable, JCoMetaData, Serializable

public interface JCoRecordMetaData extends JCoMetaData
Encapsulates the metadata of either a structure or a table. Each element of metadata describes a field of these record oriented data containers in terms of name, type, length, offsets, etc. JCoRecordMetadata objects are mainly used to create structures and tables of a certain layout. JCoRecordMetadata contains all the metadata which is specific to records
See Also:
  • Method Details

    • add

      void add(String name, int type, int nucByteLength, int nucByteOffset, int ucByteLength, int ucByteOffset)
      Adds a new scalar field descriptor to the metadata object.
      Parameters:
      name - Field name for identifying this data field
      type - Data field type
      nucByteLength - Data field length in bytes for non-Unicode layout
      ucByteLength - Data field length in bytes for Unicode layout
      nucByteOffset - Data field offset in bytes for non-Unicode layout
      ucByteOffset - Data field offset in bytes for Unicode layout
    • add

      void add(String name, int type, int nucByteOffset, int ucByteOffset, JCoRecordMetaData recordMetaData)
      Adds a new complex field descriptor to the metadata object, i.e. a structure or table
      Parameters:
      name - Field name for identifying this data field
      type - Data field type
      nucByteOffset - Data field offset in bytes for non-Unicode layout
      ucByteOffset - Data field offset in bytes for Unicode layout
      recordMetaData - the metadata for the structure or table
    • add

      void add(String name, int type, int nucByteLength, int nucByteOffset, int ucByteLength, int ucByteOffset, int decimals, String description, Object tabMetaData, JCoExtendedFieldMetaData extended)
      Adds a new field descriptor to the metadata object.
      Parameters:
      name - Field name for identifying this data field
      type - Data field type
      nucByteLength - Data field length in bytes for non-Unicode layout
      ucByteLength - Data field length in bytes for Unicode layout
      nucByteOffset - Data field offset in bytes for non-Unicode layout
      ucByteOffset - Data field offset in bytes for Unicode layout
      decimals - Data field number of decimals (only necessary for the data types TYPE_BCD and TYPE_FLOAT)
      description - Descriptional text of the data field
      tabMetaData - metadata if the field is a complex field, i.e. structure or table, null otherwise
      extended - extended metadata for this field or null if none available.
    • getUnicodeByteOffset

      int getUnicodeByteOffset(int index)
      Returns the offset in a Unicode layout of the data field at the specified index.
      Parameters:
      index - the index of the field
      Returns:
      data field offset in Unicode layout
    • getUnicodeByteOffset

      int getUnicodeByteOffset(String fieldName)
      Returns the offset in a Unicode layout of the field with the specified name.
      Parameters:
      fieldName - the name of the field
      Returns:
      data field offset in Unicode layout
      Throws:
      JCoRuntimeException - with group JCO_ERROR_FIELD_NOT_FOUND if a field with this name does not exist
    • getByteOffset

      int getByteOffset(int index)
      Returns the offset in a non-Unicode layout of the data field at the specified index.
      Parameters:
      index - the index of the field
      Returns:
      data field offset in non-Unicode layout
    • getByteOffset

      int getByteOffset(String fieldName)
      Returns the offset in a non-Unicode layout of the field with the specified name.
      Parameters:
      fieldName - the name of the field
      Returns:
      data field offset in non-Unicode layout
      Throws:
      JCoRuntimeException - with group JCO_ERROR_FIELD_NOT_FOUND if a field with this name does not exist
    • getUnicodeRecordLength

      int getUnicodeRecordLength()
      Returns the total length of a structure or single row of a table with a Unicode layout. Due to alignment constraints the length of a structure or table row is not necessarily the same as the sum of the field length.
      Returns:
      The total length of the record with Unicode layout
    • getRecordLength

      int getRecordLength()
      Returns the total length of a structure or single row of a table with a non-Unicode layout. Due to alignment constraints the length of a structure or table row is not necessarily the same as the sum of the field length.
      Returns:
      The total length of the record with non-Unicode layout
    • setRecordLength

      void setRecordLength(int recordNUCLength, int recordUCLength)
      Sets the total length of a structure or single row of a table. If the metadata instance has already been locked, an UnsupportedOperationException will be thrown.
      Parameters:
      recordNUCLength - the byte length of the structure with non-Unicode layout
      recordUCLength - the byte length of the structure with Unicode layout
    • isNestedType1Structure

      boolean isNestedType1Structure()
      Checks whether this JCoRecordMetaData is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout.
      Returns:
      true if the JCoRecordData is a nested TYPE1 structure, false otherwise
    • getLineType

      String getLineType()
      In case the JCoRecordMetaData represents a table type, getLineType() returns the name of the structure, table or data element, which is the line type of the table. If the metadata represents a structure, null is returned.
      Returns:
      the name of the line type for table types, null otherwise
    • setLineType

      void setLineType(String lineTypeName)
      In case the JCoRecordMetaData is created for a JCoCustomRepository and represents a table type, setLineType() allows setting the name of the structure, table or data element, which is the line type of the table. If the metadata instance has already been locked, an UnsupportedOperationException will be thrown.
      Parameters:
      lineTypeName - the name of the line type for table types, null otherwise
      Since:
      JCo 3.0.7