com.sap.conn.jco
Interface JCoClassMetaData

All Superinterfaces:
java.lang.Cloneable, JCoMetaData, java.io.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
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_CHAR, TYPE_DATE, TYPE_DECF16, TYPE_DECF34, TYPE_EXCEPTION, TYPE_FLOAT, TYPE_GENERIC_BOX, TYPE_INT, TYPE_INT1, TYPE_INT2, TYPE_INVALID, TYPE_ITAB, TYPE_NUM, TYPE_STRING, TYPE_STRUCTURE, TYPE_TABLE, TYPE_TIME, TYPE_XSTRING, UNINITIALIZED
 
Method Summary
 void add(java.lang.String declaringClass, java.lang.String attributeName, int attributeType, int charLength, int decimals, java.lang.String description, java.lang.Object metaData, JCoExtendedFieldMetaData extended, JCoClassMetaData.JCoAttributeKind kind, boolean readOnly, java.lang.String initialValue)
          Adds an attribute to the class definition
 void addImplementedInterface(java.lang.String implementedInterface)
          Adds an interface implemented by the class type
 void addParentClass(java.lang.String parentClass)
          Adds the parent class
 JCoClassMetaData.JCoAttributeKind getAttributeKind(int index)
          Returns what kind of attribute the given attribute is.
 JCoClassMetaData.JCoAttributeKind getAttributeKind(java.lang.String attributeName)
          Returns what kind of attribute the given attribute is.
 java.lang.String getDeclaringClass(int index)
          Returns the name of the declaring class of the given attribute.
 java.lang.String getDeclaringClass(java.lang.String attributeName)
          Returns the name of the declaring class of the given attribute.
 java.lang.String getDefault(int index)
          Returns the default value of the data field at the specified index
 java.lang.String getDefault(java.lang.String attributeName)
          Returns the default value for the attribute with the given name
 java.util.List<java.lang.String> getImplementedInterfaces()
          Returns the list of implemented interfaces.
 java.util.List<java.lang.String> getParentClasses()
          Returns the parent classes.
 boolean isReadOnly(int index)
          Indicates whether the given attribute is a read-only attribute or not.
 boolean isReadOnly(java.lang.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, 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

java.util.List<java.lang.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

java.util.List<java.lang.String> getImplementedInterfaces()
Returns the list of implemented interfaces.

Returns:
an array of interface names

isReadOnly

boolean isReadOnly(java.lang.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(java.lang.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

java.lang.String getDeclaringClass(java.lang.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 meta data 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

java.lang.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 meta data 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

java.lang.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

java.lang.String getDefault(java.lang.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(java.lang.String declaringClass,
         java.lang.String attributeName,
         int attributeType,
         int charLength,
         int decimals,
         java.lang.String description,
         java.lang.Object metaData,
         JCoExtendedFieldMetaData extended,
         JCoClassMetaData.JCoAttributeKind kind,
         boolean readOnly,
         java.lang.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(java.lang.String parentClass)
Adds the parent class

Parameters:
parentClass - a parent class

addImplementedInterface

void addImplementedInterface(java.lang.String implementedInterface)
Adds an interface implemented by the class type

Parameters:
implementedInterface - implemented interface


Copyright © 2008-2014 SAP AG. All Rights Reserved.