com.sap.conn.jco

## 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:
    `JCoStructure`, `JCoTable`

- - ### Field Summary

    - ### Fields inherited from interface com.sap.conn.jco.JCoMetaData

      `TYPE_ABAPOBJECT, TYPE_BCD, TYPE_BOX, TYPE_BYTE, TYPE_CDAY, TYPE_CHAR, TYPE_DATE, TYPE_DECF16, TYPE_DECF34, TYPE_DTDAY, TYPE_DTMONTH, TYPE_DTWEEK, TYPE_EXCEPTION, TYPE_FLOAT, TYPE_GENERIC_BOX, TYPE_INT, TYPE_INT1, TYPE_INT2, TYPE_INT8, TYPE_INVALID, TYPE_ITAB, TYPE_NUM, TYPE_STRING, TYPE_STRUCTURE, TYPE_TABLE, TYPE_TIME, TYPE_TMINUTE, TYPE_TSECOND, TYPE_UTCLONG, TYPE_UTCMINUTE, TYPE_UTCSECOND, TYPE_XSTRING, UNINITIALIZED`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(String name, int type, int nucByteLength, int nucByteOffset, int ucByteLength, int ucByteOffset)` Adds a new scalar field descriptor to the metadata object.
    `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.
    `void` | `add(String name, int type, int nucByteOffset, int ucByteOffset, JCoRecordMetaData recordMetaData)` Adds a new complex field descriptor to the metadata object, i.e.
    `int` | `getByteOffset(int index)` Returns the offset in a non-Unicode layout of the data field at the specified index.
    `int` | `getByteOffset(String fieldName)` Returns the offset in a non-Unicode layout of the field with the specified name.
    `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.
    `int` | `getRecordLength()` Returns the total length of a structure or single row of a table with a non-Unicode layout.
    `int` | `getUnicodeByteOffset(int index)` Returns the offset in a Unicode layout of the data field at the specified index.
    `int` | `getUnicodeByteOffset(String fieldName)` Returns the offset in a Unicode layout of the field with the specified name.
    `int` | `getUnicodeRecordLength()` Returns the total length of a structure or single row of a table with a Unicode layout.
    `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.
    `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.
    `void` | `setRecordLength(int recordNUCLength, int recordUCLength)` Sets the total length of a structure or single row of a table.

    - ### Methods inherited from interface com.sap.conn.jco.JCoMetaData

      `getByteLength, getByteLength, getClassNameOfField, getClassNameOfField, getDecimals, getDecimals, getDescription, getDescription, getExtendedFieldMetaData, getExtendedFieldMetaData, getFieldCount, getLength, getLength, getName, getName, getRecordMetaData, getRecordMetaData, getRecordTypeName, getRecordTypeName, getType, getType, getTypeAsString, getTypeAsString, getUnicodeByteLength, getUnicodeByteLength, hasField, indexOf, isAbapObject, isAbapObject, isLocked, isNestedType1Structure, isNestedType1Structure, isStructure, isStructure, isTable, isTable, lock, setName`

- - ### Method Detail

    - #### 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 meta data 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 meta data 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

Copyright © 2016 SAP. All Rights Reserved.