com.sap.conn.jco

## Interface JCoClassMetaData

- All Superinterfaces:
    Cloneable, JCoMetaData, Serializable

      public interface JCoClassMetaData
      extends JCoMetaData

  Encapsulates the metadata of ABAP classes. The interface comprises public methods for access to ABAP class definition. JCoClassMetaData is used by JCoAbapObjects.

  Note: The implementation for this interface provided by the JCo runtime. Other implementations are not supported.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `JCoClassMetaData.JCoAttributeKind` An enumeration of the possible or relevant attribute types.

  - ### 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 declaringClass, String attributeName, int attributeType, int charLength, int decimals, String description, Object metaData, JCoExtendedFieldMetaData extended, JCoClassMetaData.JCoAttributeKind kind, boolean readOnly, String initialValue)` Adds an attribute to the class definition.
    `void` | `addImplementedInterface(String implementedInterface)` Adds an interface implemented by the class type.
    `void` | `addParentClass(String parentClass)` Adds the parent class.
    `JCoClassMetaData.JCoAttributeKind` | `getAttributeKind(int index)` Returns what kind of attribute the given attribute is.
    `JCoClassMetaData.JCoAttributeKind` | `getAttributeKind(String attributeName)` Returns what kind of attribute the given attribute is.
    `String` | `getDeclaringClass(int index)` Returns the name of the declaring class of the given attribute.
    `String` | `getDeclaringClass(String attributeName)` Returns the name of the declaring class of the given attribute.
    `String` | `getDefault(int index)` Returns the default value of the data field at the specified index.
    `String` | `getDefault(String attributeName)` Returns the default value for the attribute with the given name.
    `List<String>` | `getImplementedInterfaces()` Returns the list of implemented interfaces.
    `List<String>` | `getParentClasses()` Returns the parent classes.
    `boolean` | `isReadOnly(int index)` Indicates whether the given attribute is a read-only attribute or not.
    `boolean` | `isReadOnly(String attributeName)` Indicates whether the given attribute is a read-only attribute or not.

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

      `getByteLength, getByteLength, getClassMetaData, getClassMetaData, 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

    - #### getParentClasses

          List<String> getParentClasses()

      Returns the parent classes. The parent classes are the classes that the current class extends, directly or indirectly. The names of these classes are stored in a `String` array starting with the root class and then going down the extension hierarchy until the current class is reached.
      Returns:
        the names of all parent classes in a string array; an empty array is returned if there are no parent classes

    - #### getImplementedInterfaces

          List<String> getImplementedInterfaces()

      Returns the list of implemented interfaces.
      Returns:
        an array of interface names

    - #### isReadOnly

          boolean isReadOnly(String attributeName)

      Indicates whether the given attribute is a read-only attribute or not.
      Parameters:
        `attributeName` - - the name of the attribute
      Returns:
        `true` if the attribute is read-only (`const`) or not
      Throws:
        `JCoRuntimeException` - with group `JCoException.JCO_ERROR_FIELD_NOT_FOUND` if an attribute with the given name does not exist
      See Also:
        `isReadOnly(int)`

    - #### isReadOnly

          boolean isReadOnly(int index)

      Indicates whether the given attribute is a read-only attribute or not.
      Parameters:
        `index` - - the index of the attribute
      Returns:
        `true` if the attribute is read-only (`const`) or not
      See Also:
        `isReadOnly(String)`

    - #### getAttributeKind

          JCoClassMetaData.JCoAttributeKind getAttributeKind(String attributeName)

      Returns what kind of attribute the given attribute is.
      Parameters:
        `attributeName` - - the name of the attribute
      Returns:
        the kind of the attribute as an element of the enumeration `JCoClassMetaData.JCoAttributeKind`
      Throws:
        `JCoRuntimeException` - with group `JCoException.JCO_ERROR_FIELD_NOT_FOUND` if an attribute with the given name does not exist
      See Also:
        `getAttributeKind(int)`

    - #### getAttributeKind

          JCoClassMetaData.JCoAttributeKind getAttributeKind(int index)

      Returns what kind of attribute the given attribute is.
      Parameters:
        `index` - - the index of the attribute
      Returns:
        the kind of the attribute as an element of the enumeration `JCoClassMetaData.JCoAttributeKind`
      See Also:
        `getAttributeKind(String)`

    - #### getDeclaringClass

          String getDeclaringClass(String attributeName)

      Returns the name of the declaring class of the given attribute. The declaring class is the class from which this class (represented by this metadata entity) inherits the attribute, or this class itself if it declares the attribute.
      Parameters:
        `attributeName` - - the name of the attribute
      Returns:
        the declaring class of the given attribute
      See Also:
        `getDeclaringClass(String)`

    - #### getDeclaringClass

          String getDeclaringClass(int index)

      Returns the name of the declaring class of the given attribute. The declaring class is the class from which this class (represented by this metadata entity) inherits the attribute, or this class itself if it declares the attribute.
      Parameters:
        `index` - - the index of the attribute
      Returns:
        the declaring class of the given attribute
      Throws:
        `JCoRuntimeException` - with group `JCoException.JCO_ERROR_FIELD_NOT_FOUND` if an attribute with the given name does not exist
      See Also:
        `getDeclaringClass(int)`

    - #### getDefault

          String getDefault(int index)

      Returns the default value of the data field at the specified index.
      Parameters:
        `index` - - the index of the field
      Returns:
        data field default value
      See Also:
        `getDefault(String)`

    - #### getDefault

          String getDefault(String attributeName)

      Returns the default value for the attribute with the given name.
      Parameters:
        `attributeName` - - the name of the attribute
      Returns:
        default value of the attribute
      Throws:
        `JCoRuntimeException` - with group `JCoException.JCO_ERROR_FIELD_NOT_FOUND` if an attribute with the given name does not exist
      See Also:
        `getDefault(int)`

    - #### add

          void add(String declaringClass,
                 String attributeName,
                 int attributeType,
                 int charLength,
                 int decimals,
                 String description,
                 Object metaData,
                 JCoExtendedFieldMetaData extended,
                 JCoClassMetaData.JCoAttributeKind kind,
                 boolean readOnly,
                 String initialValue)

      Adds an attribute to the class definition.
      Parameters:
        `declaringClass` - class where the attribute was declared
        `attributeName` - attribute name
        `attributeType` - type of the attribute
        `charLength` - length in chars
        `decimals` - number of decimals in case of BCD type
        `description` - attribute description
        `metaData` - metadata if the attribute has a non scalar type
        `extended` - additional object associated with the attribute
        `kind` - kind of attribute - instance, class member or constant
        `readOnly` - flag, true if the attribute has read only access
        `initialValue` - initial value for the attribute

    - #### addParentClass

          void addParentClass(String parentClass)

      Adds the parent class.
      Parameters:
        `parentClass` - a parent class

    - #### addImplementedInterface

          void addImplementedInterface(String implementedInterface)

      Adds an interface implemented by the class type.
      Parameters:
        `implementedInterface` - implemented interface

Copyright © 2020 SAP. All Rights Reserved.