Package com.sap.conn.jco
Interface JCoClassMetaData
- All Superinterfaces:
Cloneable
,JCoMetaData
,Serializable
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 ClassesModifier and TypeInterfaceDescriptionstatic enum
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
Modifier and TypeMethodDescriptionvoid
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.getAttributeKind
(int index) Returns what kind of attribute the given attribute is.getAttributeKind
(String attributeName) Returns what kind of attribute the given attribute is.getDeclaringClass
(int index) Returns the name of the declaring class of the given attribute.getDeclaringClass
(String attributeName) Returns the name of the declaring class of the given attribute.getDefault
(int index) Returns the default value of the data field at the specified index.getDefault
(String attributeName) Returns the default value for the attribute with the given name.Returns the list of implemented interfaces.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 Details
-
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 aString
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
Returns the list of implemented interfaces.- Returns:
- an array of interface names
-
isReadOnly
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 groupJCoException.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
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 groupJCoException.JCO_ERROR_FIELD_NOT_FOUND
if an attribute with the given name does not exist- See Also:
-
getAttributeKind
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
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
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 groupJCoException.JCO_ERROR_FIELD_NOT_FOUND
if an attribute with the given name does not exist- See Also:
-
getDefault
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
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 groupJCoException.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 declaredattributeName
- attribute nameattributeType
- type of the attributecharLength
- length in charsdecimals
- number of decimals in case of BCD typedescription
- attribute descriptionmetaData
- metadata if the attribute has a non scalar typeextended
- additional object associated with the attributekind
- kind of attribute - instance, class member or constantreadOnly
- flag, true if the attribute has read only accessinitialValue
- initial value for the attribute
-
addParentClass
Adds the parent class.- Parameters:
parentClass
- a parent class
-
addImplementedInterface
Adds an interface implemented by the class type.- Parameters:
implementedInterface
- implemented interface
-