com.sap.mw.jco
Interface IMetaData

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
JCO.MetaData

public interface IMetaData
extends java.io.Serializable

Encapsulates the meta-data of either a parameter list, a structure, or a table. Each element of meta-data describes a field of a parameter list, a field of a structure, or a column of a table in terms of name, type, length, etc. Meta-data objects are used to create parameter list, structures, or tables of a certain layout.

See Also:
JCO.ParameterList, JCO.Structure, JCO.Table

Field Summary
static int EXPORT_PARAMETER
          Flag that indicates a export parameter
static int IMPORT_PARAMETER
          Flag that indicates a import parameter
static int INACTIVE_PARAMETER
          Flag that indicates that the parameter is being excluded from a call
static int OPTIONAL_PARAMETER
          Flag that indicates a export parameter
static int TYPE_BCD
          Packed BCD number, any length between 1 and 16 bytes.
static int TYPE_BYTE
          Raw data, binary, fixed length, zero padded.
static int TYPE_CHAR
          1-byte or multibyte character.Fixed sized, blank padded.
static int TYPE_DATE
          Date ( YYYYYMMDD ).
static int TYPE_EXCEPTION
          ABAP exception.
static int TYPE_FLOAT
          Floating point,double precission.
static int TYPE_INT
          4-byte integer .
static int TYPE_INT1
          1-byte integer .
static int TYPE_INT2
          2-byte integer .
static int TYPE_INVALID
          The field info does not contain a valid JCO type
static int TYPE_ITAB
          Internal table.
static int TYPE_NUM
          Digits, fixed size,'0' padded.
static int TYPE_STRING
          UTF8 encoded string of variable length.
static int TYPE_STRUCTURE
          A heterogeneous structure.
static int TYPE_TABLE
          A Table.
static int TYPE_TIME
          Time (HHMMSS).
static int TYPE_XSTRING
          Byte array of variable length.
static int UNINITIALIZED
          The field info was not initialized yet
static int UNINITIALIZED_PARAMETER
          Flag that indicates a uninitialized parameter
 
Method Summary
 void addInfo(java.lang.String name, int type, int length, int offset, int decimals, int flags, java.lang.Object tab_meta_data)
          Adds a new field descriptor to the meta-data object
 void addInfo(java.lang.String name, int type, int length, int offset, int decimals, java.lang.String defaults, java.lang.String description, int flags, java.lang.Object tab_meta_data, com.sap.mw.jco.IExtendedFieldMetaData extended)
          Adds a new field descriptor to the meta-data object
 java.lang.Object clone()
          Creates an returns a copy of the IMetaData object.
 int getDecimals(int index)
          Returns the number of decimals of the data field at the specified index Decimals are only necessary for the JCO data types TYPE_BCD and TYPE_FLOAT, respectively.
 int getDecimals(java.lang.String field_name)
          Returns the number of decimals for the field with the specified name Decimals are only necessary for the JCO data types TYPE_BCD and TYPE_FLOAT, respectively.
 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 field_name)
          Returns the default value for the field with the specified name
 java.lang.String getDescription(int index)
          Returns the descriptional text of the data field at the specified index
 java.lang.String getDescription(java.lang.String field_name)
          Returns the descriptional text for the field with the specified name
 com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(int index)
          Returns the extended field meta-data object at the specified index
 com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(java.lang.String field_name)
          Returns the extended meta-data object for the field with the specified name
 int getFieldCount()
          Returns the number of entries (fields)
 int getInternalLength(int index)
          Returns the internal length of the data field at the specified index
 int getInternalLength(java.lang.String field_name)
          Returns the internal length of the field with the specified name
 int getLength(int index)
          Returns the length of the data field at the specified index
 int getLength(java.lang.String field_name)
          Returns the length of the field with the specified name
 IMetaData getMetaData(int index)
          Returns the meta-data if the specified data field is a table or structure.
 IMetaData getMetaData(java.lang.String field_name)
          Returns the meta-data if the specified data field is a table or structure.
 java.lang.String getName()
          Returns the name of the table/structure this meta-data describes
 java.lang.String getName(int index)
          Returns the field name of the data field at the specified index The field name is used for identfying a field in a structure or table row.
 int getOffset(int index)
          Deprecated. only used for internal purposes
 int getOffset(java.lang.String field_name)
          Deprecated. only used for internal purposes
 int getTabLength()
          Returns the total length of a structure or single row of a table.
 java.lang.String getTabName(int index)
          Returns the table/structure name of the data field or null if no table name is available
 java.lang.String getTabName(java.lang.String field_name)
          Returns the table/structure name of the data field or null if no table name is available
 int getType(int index)
          Returns the JCO type of the data field at the specified index
 int getType(java.lang.String field_name)
          Returns the type of the data for the field with the specified name
 java.lang.String getTypeAsString(int index)
          Returns the type of the data field at the specified index
 java.lang.String getTypeAsString(java.lang.String field_name)
          Returns the type of the data field for the field with the specified name
 boolean hasField(java.lang.String name)
          Checks whether a named field exists
 int indexOf(java.lang.String name)
          Returns the index of the named field info
 boolean isException(int index)
          Checks whether this field is a exception
 boolean isException(java.lang.String field_name)
          Checks whether this field with the specified name is a exception
 boolean isExport(int index)
          Checks whether the field at the specified index is an export parameter
 boolean isExport(java.lang.String field_name)
          Checks whether the field with the specified name is an export parameter
 boolean isImport(int index)
          Checks whether the field at the specified index is an import parameter
 boolean isImport(java.lang.String field_name)
          Checks whether the field with the specified name is an import parameter
 boolean isOptional(int index)
          Checks whether the field at the specified index is an optional parameter
 boolean isOptional(java.lang.String field_name)
          Checks whether the field with the specified name is an optional parameter
 boolean isStructure(int index)
          Checks whether the field at the specified index is a structure parameter
 boolean isStructure(java.lang.String field_name)
          Checks whether the field with the specified name is a structure parameter
 boolean isTable(int index)
          Checks whether the field is a table parameter
 boolean isTable(java.lang.String field_name)
          Checks whether the field with the specified name is a table parameter
 java.lang.String toString()
          Returns a string representation of the meta-data
 

Field Detail

UNINITIALIZED

public static final int UNINITIALIZED
The field info was not initialized yet

TYPE_INVALID

public static final int TYPE_INVALID
The field info does not contain a valid JCO type

TYPE_CHAR

public static final int TYPE_CHAR
1-byte or multibyte character.Fixed sized, blank padded. Corresponds to ABAP type 'C'.

TYPE_DATE

public static final int TYPE_DATE
Date ( YYYYYMMDD ). Corresponds to ABAP type 'D'.

TYPE_BCD

public static final int TYPE_BCD
Packed BCD number, any length between 1 and 16 bytes. Corresponds to ABAP type 'P'.

TYPE_TIME

public static final int TYPE_TIME
Time (HHMMSS). Corresponds to ABAP type 'T'

TYPE_BYTE

public static final int TYPE_BYTE
Raw data, binary, fixed length, zero padded. Corresponds to ABAP type 'X'.

TYPE_ITAB

public static final int TYPE_ITAB
Internal table. (Deprecated! Not used)

TYPE_NUM

public static final int TYPE_NUM
Digits, fixed size,'0' padded. Corresponds to ABAP type 'N'.

TYPE_FLOAT

public static final int TYPE_FLOAT
Floating point,double precission. Corresponds to ABAP type 'F'.

TYPE_INT

public static final int TYPE_INT
4-byte integer . Corresponds to ABAP type 'I'.

TYPE_INT2

public static final int TYPE_INT2
2-byte integer . Corresponds to ABAP type 's'.

TYPE_INT1

public static final int TYPE_INT1
1-byte integer . Corresponds to ABAP type 'b'.

TYPE_STRUCTURE

public static final int TYPE_STRUCTURE
A heterogeneous structure. Corresponds to ABAP type 'u'.

TYPE_STRING

public static final int TYPE_STRING
UTF8 encoded string of variable length. Corresponds to ABAP type 'g'.

TYPE_XSTRING

public static final int TYPE_XSTRING
Byte array of variable length. Corresponds to ABAP type 'y'.

TYPE_TABLE

public static final int TYPE_TABLE
A Table. Corresponds to ABAP type 'h'.

TYPE_EXCEPTION

public static final int TYPE_EXCEPTION
ABAP exception.

IMPORT_PARAMETER

public static final int IMPORT_PARAMETER
Flag that indicates a import parameter

EXPORT_PARAMETER

public static final int EXPORT_PARAMETER
Flag that indicates a export parameter

OPTIONAL_PARAMETER

public static final int OPTIONAL_PARAMETER
Flag that indicates a export parameter

UNINITIALIZED_PARAMETER

public static final int UNINITIALIZED_PARAMETER
Flag that indicates a uninitialized parameter

INACTIVE_PARAMETER

public static final int INACTIVE_PARAMETER
Flag that indicates that the parameter is being excluded from a call
Method Detail

clone

public java.lang.Object clone()
Creates an returns a copy of the IMetaData object.
Returns:
A clone of this IMetaData object.

indexOf

public int indexOf(java.lang.String name)
Returns the index of the named field info
Parameters:
name - the name of the field for which the index is being returned
Returns:
the index of the named field in the fields list
Throws:
JCO.Exception - if the field could not be found

hasField

public boolean hasField(java.lang.String name)
Checks whether a named field exists
Parameters:
name - the name of the field to check for existence
Returns:
true if the field with the specified name exist, false otherwise
Since:
JCo 1.1

getName

public java.lang.String getName()
Returns the name of the table/structure this meta-data describes
Parameters:
index - the index of the field
Returns:
The name of the underlying table/structure

getFieldCount

public int getFieldCount()
Returns the number of entries (fields)

addInfo

public void addInfo(java.lang.String name,
                    int type,
                    int length,
                    int offset,
                    int decimals,
                    int flags,
                    java.lang.Object tab_meta_data)
Adds a new field descriptor to the meta-data object
Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field length in bytes
offset - Data field offset in the internal JCO data buffer
decimals - Data field number of decimals (only necessary for the data types TYPE_BCD and TYPE_FLOAT)
flags - Bit-vector for additional attributes of the field. The vector can be ORed together from
FlagDescription
IMPORT_PARAMETERThe field is an import parameter
EXPORT_PARAMETERThe field is an export parameter
OPTIONAL_PARAMETERThe field is an optional parameter
INACTIVATE_PARAMETEROnly used for table parameters,
indicating that the content of the table will not be sent to the server
tab_meta - meta-data if the field is a complex field, i.e. structure or table, null otherwise

addInfo

public void addInfo(java.lang.String name,
                    int type,
                    int length,
                    int offset,
                    int decimals,
                    java.lang.String defaults,
                    java.lang.String description,
                    int flags,
                    java.lang.Object tab_meta_data,
                    com.sap.mw.jco.IExtendedFieldMetaData extended)
Adds a new field descriptor to the meta-data object
Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field length in bytes
offset - Data field offset in the internal JCO data buffer
decimals - Data field number of decimals (only necessary for the data types TYPE_BCD and TYPE_FLOAT)
sdefault - Data Field default value
description - Descriptional text of the data field
flags - Bit-vector for additional attributes of the field. The vector can be ORed together from
FlagDescription
IMPORT_PARAMETERThe field is an import parameter
EXPORT_PARAMETERThe field is an export parameter
OPTIONAL_PARAMETERThe field is an optional parameter
INACTIVATE_PARAMETEROnly used for table parameters,
indicating that the content of the table will not be sent to the server
tab_meta - meta-data if the field is a complex field, i.e. structure or table, null otherwise
extented - extended meta-data for this field or null if none available.

getName

public java.lang.String getName(int index)
Returns the field name of the data field at the specified index The field name is used for identfying a field in a structure or table row.
Parameters:
index - the index of the field
Returns:
The field name of the data field described by this meta information object.

getTabName

public java.lang.String getTabName(int index)
Returns the table/structure name of the data field or null if no table name is available
Parameters:
index - the index of the field
Returns:
The table/structure name of the data field described by this meta information object.

getTabName

public java.lang.String getTabName(java.lang.String field_name)
Returns the table/structure name of the data field or null if no table name is available
Parameters:
field_name - the name of the field
Returns:
The table/structure name of the data field described by this meta information object.

getMetaData

public IMetaData getMetaData(int index)
Returns the meta-data if the specified data field is a table or structure. The method will return null if no meta-data are available
Parameters:
index - the index of the field
Returns:
The table/structure meta-data of the data field or null

getMetaData

public IMetaData getMetaData(java.lang.String field_name)
Returns the meta-data if the specified data field is a table or structure. The method will return null if no meta-data are available
Parameters:
field_name - the name of the field
Returns:
The table/structure meta-data of the data field or null

getExtendedFieldMetaData

public com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(int index)
Returns the extended field meta-data object at the specified index
Parameters:
index - the index of the field
Returns:
the extended field meta-data object or null if not available

getExtendedFieldMetaData

public com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(java.lang.String field_name)
Returns the extended meta-data object for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
the extended field meta-data object or null if not available

getLength

public int getLength(int index)
Returns the length of the data field at the specified index
Parameters:
index - the index of the field
Returns:
data field length

getLength

public int getLength(java.lang.String field_name)
Returns the length of the field with the specified name
Parameters:
field_name - the name of the field
Returns:
data field length
Since:
JCo 2.0

getInternalLength

public int getInternalLength(int index)
Returns the internal length of the data field at the specified index
Parameters:
index - the index of the field
Returns:
data field internal length
Since:
JCo 2.0

getInternalLength

public int getInternalLength(java.lang.String field_name)
Returns the internal length of the field with the specified name
Parameters:
field_name - the name of the field
Returns:
data field internal length

getOffset

public int getOffset(int index)
Deprecated. only used for internal purposes

Returns the offset of the data field at the specified index
Parameters:
index - the index of the field
Returns:
data field offset

getOffset

public int getOffset(java.lang.String field_name)
Deprecated. only used for internal purposes

Returns the offset for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
data field offset

getType

public int getType(int index)
Returns the JCO type of the data field at the specified index
Parameters:
index - the index of the field
Returns:
the JCO data type

getType

public int getType(java.lang.String field_name)
Returns the type of the data for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
the JCO data type

getTypeAsString

public java.lang.String getTypeAsString(int index)
Returns the type of the data field at the specified index
Parameters:
index - the index of the field
Returns:
a string description of the JCO data type

getTypeAsString

public java.lang.String getTypeAsString(java.lang.String field_name)
Returns the type of the data field for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
a string description of the JCO data type

getDecimals

public int getDecimals(int index)
Returns the number of decimals of the data field at the specified index Decimals are only necessary for the JCO data types TYPE_BCD and TYPE_FLOAT, respectively.
Parameters:
index - the index of the field
Returns:
data field number of decimals.

getDecimals

public int getDecimals(java.lang.String field_name)
Returns the number of decimals for the field with the specified name Decimals are only necessary for the JCO data types TYPE_BCD and TYPE_FLOAT, respectively.
Parameters:
field_name - the name of the field
Returns:
data field number of decimals.

getDefault

public 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

getDefault

public java.lang.String getDefault(java.lang.String field_name)
Returns the default value for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
data field default value

getDescription

public java.lang.String getDescription(int index)
Returns the descriptional text of the data field at the specified index
Parameters:
index - the index of the field
Returns:
A descriptional text of the data field

getDescription

public java.lang.String getDescription(java.lang.String field_name)
Returns the descriptional text for the field with the specified name
Parameters:
field_name - the name of the field
Returns:
A descriptional text of the data field

isOptional

public boolean isOptional(int index)
Checks whether the field at the specified index is an optional parameter
Parameters:
index - the index of the field
Returns:
true if the specified field is an optional parameter, false otherwise

isOptional

public boolean isOptional(java.lang.String field_name)
Checks whether the field with the specified name is an optional parameter
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an optional parameter, false otherwise

isImport

public boolean isImport(int index)
Checks whether the field at the specified index is an import parameter
Parameters:
index - the index of the field
Returns:
true if the specified field is an import parameter, false otherwise

isImport

public boolean isImport(java.lang.String field_name)
Checks whether the field with the specified name is an import parameter
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an import parameter, false otherwise

isExport

public boolean isExport(int index)
Checks whether the field at the specified index is an export parameter
Parameters:
index - the index of the field
Returns:
true if the specified field is an export parameter, false otherwise

isExport

public boolean isExport(java.lang.String field_name)
Checks whether the field with the specified name is an export parameter
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an export parameter, false otherwise

isStructure

public boolean isStructure(int index)
Checks whether the field at the specified index is a structure parameter
Parameters:
index - the index of the field
Returns:
true if the specified field is a structure parameter, false otherwise

isStructure

public boolean isStructure(java.lang.String field_name)
Checks whether the field with the specified name is a structure parameter
Parameters:
field_name - the name of the field
Returns:
true if the specified field is a structure parameter, false otherwise

isTable

public boolean isTable(int index)
Checks whether the field is a table parameter
Parameters:
index - the index of the field
Returns:
true if the specified field is a table parameter, false otherwise

isTable

public boolean isTable(java.lang.String field_name)
Checks whether the field with the specified name is a table parameter
Parameters:
field_name - the name of the field
Returns:
true if the specified field is a table parameter, false otherwise

isException

public boolean isException(int index)
Checks whether this field is a exception
Parameters:
index - the index of the field
Returns:
true if the specified field is an exception, false otherwise

isException

public boolean isException(java.lang.String field_name)
Checks whether this field with the specified name is a exception
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an exception, false otherwise

getTabLength

public int getTabLength()
Returns the total length of a structure or single row of a table. 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

toString

public java.lang.String toString()
Returns a string representation of the meta-data
Overrides:
toString in class java.lang.Object
Returns:
a printable representation of this object