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.

  • Method Details

    • 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

      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:
    • 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

      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:
    • 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(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:
    • 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 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:
    • 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