com.sap.mw.jco

Class JCO.MetaData

java.lang.Object
  extended bycom.sap.mw.jco.JCO.MetaData
All Implemented Interfaces:
Cloneable, IMetaData, Serializable
Direct Known Subclasses:
JCO.Record
Enclosing class:
JCO

public static class JCO.MetaData
extends Object
implements IMetaData, Cloneable, Serializable

Implements the meta data for a data structure, i.e. table, structure, or parameter list, respectively. Meta data describe the layout of a table, structure or parameter list.

See Also:
Serialized Form

Nested Class Summary
protected  class JCO.MetaData.Type1Data
           
 
Field Summary
protected  int[] blength
          The length of the java data fields in chars
protected  int[] boffset
          The offsets of the data fields into the java data buffer in chars
protected  byte[] decimals
          The number of decimals of the data fields
protected  String[] defaults
          Default values for the data fields
protected  String[] description
          Descriptional text for the data fields
protected  com.sap.mw.jco.IExtendedFieldMetaData[] extended_field_meta_data
          Extended meta data the data fields
protected  byte[] flags
          Flags that indicate the type of the parameter
protected  Hashtable hash_of_indices
          Hashtable for field_name field_index mapping
protected  long last_active_timestamp
           
protected  int[] length
          The length of the native data fields in bytes
protected  String[] name
          The names of the data fields
protected  int num_fields
          The number of meta data stored in this object
protected  int num_odata
          The number of complex objects stored in this object
protected  int[] offset
          The offsets of the data fields into the native data buffer in bytes
protected  byte[] oindex
          Indices into complex data buffer (i.e. structures and tables)
protected static int PRINT_HEADER_ALL
          Include all headers into the HTML output
protected static int PRINT_HEADER_DECIMALS
          Include the field decimals into the HTML output
protected static int PRINT_HEADER_DEFAULT
          Include the field defaults into the HTML output
protected static int PRINT_HEADER_INTERNAL_LENGTH
          Include the field size into the HTML output
protected static int PRINT_HEADER_INTERNAL_OFFSET
          Include the field offset into the HTML output
protected static int PRINT_HEADER_LENGTH
          Include the field size into the HTML output
protected static int PRINT_HEADER_NAME
          Include the field names into the HTML output
protected static int PRINT_HEADER_OFFSET
          Include the field offset into the HTML output
protected static int PRINT_HEADER_TYPE
          Include the field types into the HTML output
protected  String rec_name
          Name of the table or structure defined by this meta data (Only used for structure and table type records
protected  int tab_length
          Total number of bytes of a structure or of a single row in a table
protected  Object[] tab_meta
          The names of meta data of the tables as supplied by the repository
protected  byte[] type
          The SAP R/3 types of the data fields
protected  long type_handle
          Internally used handle
protected  String type_name
          Name of stucture, which is line type of the table (Only for tables)
protected  JCO.MetaData.Type1Data type1_data
          metadata for nested type1 structures
protected  byte unicode_type
           
 
Fields inherited from interface com.sap.mw.jco.IMetaData
EXPORT_PARAMETER, IMPORT_PARAMETER, INACTIVE_PARAMETER, NESTED_TYPE1_STRUCTURE, OPTIONAL_PARAMETER, TYPE_BCD, TYPE_BYTE, TYPE_CHAR, TYPE_DATE, TYPE_EXCEPTION, TYPE_FLOAT, TYPE_INT, TYPE_INT1, TYPE_INT2, TYPE_INVALID, TYPE_ITAB, TYPE_NUM, TYPE_STRING, TYPE_STRUCTURE, TYPE_TABLE, TYPE_TIME, TYPE_XSTRING, UNINITIALIZED, UNINITIALIZED_PARAMETER
 
Constructor Summary
protected JCO.MetaData()
          Creates an instance of the meta data object
  JCO.MetaData(IMetaData obj)
          Creates an instance of the meta data object
  JCO.MetaData(String rec_name)
          Creates an instance of the meta data object
  JCO.MetaData(String rec_name, int capacity)
          Creates an instance of the meta data object and preallocates data structures for the specifed number of entries.
 
Method Summary
 void addInfo(String name, char type, int offset, int length)
          Deprecated. Only used internally. This method might be removed or changed in the next release without notice. Use public void addInfo(String name, int type, int length, int offset) instead.
 void addInfo(String name, char type, int offset, int length, int decimals)
          Deprecated. Only used internally. This method might be removed or changed in the next release without notice. Use public void addInfo(String name, int type, int length, int offset, int decimals) instead.
 void addInfo(String name, int type, int length)
          Adds a new field descriptor to the meta data object.
 void addInfo(String name, int type, int length, int offset)
          Adds a new field descriptor to the meta data object.
 void addInfo(String name, int type, int length, int offset, int decimals)
          Adds a new field descriptor to the meta data object.
 void addInfo(String name, int type, int length, int offset, int decimals, int flags, Object tab_meta)
          Adds a new field descriptor to the meta data object.
 void addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, com.sap.mw.jco.IExtendedFieldMetaData extended)
          Adds a new field descriptor to the meta data object
 void addInfo(String name, int type, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, com.sap.mw.jco.IExtendedFieldMetaData extended)
          Adds a new field descriptor to the meta data object.
 Object clone()
          Creates an returns a copy of the MetaData object.
protected  void copy(IMetaData obj)
          Copy data from another meta data object
 boolean equals(Object obj)
          Compares the specified object with this meta data object for equality.
 int getCapacity()
          Returns the capacity of the internal buffers
protected  int getDataBufferLength(int index)
          This method is for internal use only.
protected  int getDataBufferOffset(int index)
          This method is for internal use only.
 int getDecimals(int index)
          Returns the number of decimals of the field Decimals are only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT.
 int getDecimals(String field_name)
          Returns the number of decimals of the field Decimals are only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT.
 String getDefault(int index)
          Returns the default value for the specified field
 String getDefault(String field_name)
          Returns the default value for the specified field
 String getDescription(int index)
          Returns a textual description for the specified field
 String getDescription(String field_name)
          Returns a textual description for the specified field
 com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(int index)
          Returns the extended field meta data object
 com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(String field_name)
          Returns the extended field meta data object
 int getFieldCount()
          Returns the number of fields.
 int getFlags(int index)
          Returns the flags for the specified field
 int getFlags(String field_name)
          Returns the flags for the specified field
 int getInternalLength(int index)
          Returns the length of the field
 int getInternalLength(String field_name)
          Returns the length of the field
 int getLength(int index)
          Returns the length of the field
 int getLength(String field_name)
          Returns the length of the field
 String getLineTypeName()
          Deprecated. only for internal use.
 IMetaData getMetaData()
          Returns the copy of MetaData object
 IMetaData getMetaData(int index)
          Returns the meta data if this data field is a table or structure or null if no meta data are available
 IMetaData getMetaData(String field_name)
          Returns the meta data if this data field is a table or structure or null if no meta data are available
 String getName()
          Returns the name of the record
 String getName(int index)
          Returns the field name of the data field The field name is used for identfying a field in a structure or table row.
 int getNumFields()
          Returns the number of fields.
protected  int getObjectId()
           
 int getOffset(int index)
          Returns the offset of the field.
 int getOffset(String field_name)
          Returns the offset of the field.
 int getTabLength()
          Returns the total length of a structure or single row of a table
 String getTabName(int index)
          Returns the table/structure name of the data field or null if no table name is available
 String getTabName(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 data type of the field
 int getType(String field_name)
          Returns the data type of the field
 String getTypeAsString(int index)
          Returns the data type of the field as a string
 String getTypeAsString(String field_name)
          Returns the data type of the field as a string
protected  byte getUnicodeType()
           
protected  String getUnicodeTypeAsString()
           
 boolean hasField(String field_name)
          Checks whether a named field exists
 int hashCode()
          Returns the hash code value for this record
 int indexOf(String field_name)
          Returns the index of the named field
protected  void internalSize(com.sap.mw.jco.JCO.DataSize size)
           
 boolean isActive(int index)
          Checks whether the specified field is active
 boolean isActive(String field_name)
          Checks whether the specified field is active
 boolean isException(int index)
          Checks whether this field is a exception
 boolean isException(String field_name)
          Checks whether this field is a exception
 boolean isExport(int index)
          Checks whether this field is an export parameter
 boolean isExport(String field_name)
          Checks whether this field is an export parameter
 boolean isImport(int index)
          Checks whether this field is an import parameter
 boolean isImport(String field_name)
          Checks whether this field is an import parameter
 boolean isInitialized(int index)
          Checks whether this field has been initialized
 boolean isInitialized(String field_name)
          Checks whether this field has been initialized
 boolean isNestedType1Structure()
          Checks whether this MetaData is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout
 boolean isNestedType1Structure(int index)
          Checks whether the field at the specified index is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout
 boolean isNestedType1Structure(String field_name)
          Checks whether the field with the specified name is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout
 boolean isOptional(int index)
          Checks whether this field is an optional parameter
 boolean isOptional(String field_name)
          Checks whether this field is an optional parameter
 boolean isStructure(int index)
          Checks whether this field is a structure parameter
 boolean isStructure(String field_name)
          Checks whether this field is a structure parameter
 boolean isTable(int index)
          Checks whether this field is a table parameter
 boolean isTable(String field_name)
          Checks whether this field is a table parameter
protected  void printHTML(PrintWriter os, IMetaData m, int level)
          Outputs record as a HTML table
protected  void printHTML(PrintWriter os, IMetaData m, int level, int print_flags)
          Outputs record as a HTML table
protected  void setDataBufferLength(int index, int dataBufferLength)
          This method is for internal use only.
protected  void setDataBufferOffset(int index, int dataBufferOffset)
          This method is for internal use only.
 void setExtendedFieldMetaData(com.sap.mw.jco.IExtendedFieldMetaData extended_field_meta_data, int index)
          Sets the extended field meta data object
 void setExtendedFieldMetaData(com.sap.mw.jco.IExtendedFieldMetaData extended_field_meta_data, String field_name)
          Sets the extended field meta data object
 void setFlags(int index, int flags)
          Sets the flags for the specified field
protected  void setName(String name)
          This method is for internal use only.
 void setNestedType1Structure(boolean isType1)
          Sets that this MetaData is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout
 void setTabLength(int tab_length)
          Sets the total length of a structure or single row of a table
 String toString()
          Converts to a string
protected  String toString(int level)
          Converts to a string
 void writeHTML(String html_filename)
          Dump the meta data to a file This method comes in handy for debugging purposes.
 void writeHTML(Writer writer)
          Dump the meta data to a stream This method comes in handy for debugging purposes.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String[] name
The names of the data fields


tab_meta

protected Object[] tab_meta
The names of meta data of the tables as supplied by the repository


offset

protected int[] offset
The offsets of the data fields into the native data buffer in bytes


length

protected int[] length
The length of the native data fields in bytes


boffset

protected int[] boffset
The offsets of the data fields into the java data buffer in chars


blength

protected int[] blength
The length of the java data fields in chars


type

protected byte[] type
The SAP R/3 types of the data fields


decimals

protected byte[] decimals
The number of decimals of the data fields


oindex

protected byte[] oindex
Indices into complex data buffer (i.e. structures and tables)


flags

protected byte[] flags
Flags that indicate the type of the parameter


defaults

protected String[] defaults
Default values for the data fields


description

protected String[] description
Descriptional text for the data fields


extended_field_meta_data

protected com.sap.mw.jco.IExtendedFieldMetaData[] extended_field_meta_data
Extended meta data the data fields


num_fields

protected int num_fields
The number of meta data stored in this object


num_odata

protected int num_odata
The number of complex objects stored in this object


tab_length

protected int tab_length
Total number of bytes of a structure or of a single row in a table


type_handle

protected long type_handle
Internally used handle


rec_name

protected String rec_name
Name of the table or structure defined by this meta data (Only used for structure and table type records


type_name

protected String type_name
Name of stucture, which is line type of the table (Only for tables)


type1_data

protected JCO.MetaData.Type1Data type1_data
metadata for nested type1 structures


hash_of_indices

protected Hashtable hash_of_indices
Hashtable for field_name field_index mapping


PRINT_HEADER_NAME

protected static int PRINT_HEADER_NAME
Include the field names into the HTML output


PRINT_HEADER_TYPE

protected static int PRINT_HEADER_TYPE
Include the field types into the HTML output


PRINT_HEADER_LENGTH

protected static int PRINT_HEADER_LENGTH
Include the field size into the HTML output


PRINT_HEADER_OFFSET

protected static int PRINT_HEADER_OFFSET
Include the field offset into the HTML output


PRINT_HEADER_DECIMALS

protected static int PRINT_HEADER_DECIMALS
Include the field decimals into the HTML output


PRINT_HEADER_DEFAULT

protected static int PRINT_HEADER_DEFAULT
Include the field defaults into the HTML output


PRINT_HEADER_INTERNAL_LENGTH

protected static int PRINT_HEADER_INTERNAL_LENGTH
Include the field size into the HTML output


PRINT_HEADER_INTERNAL_OFFSET

protected static int PRINT_HEADER_INTERNAL_OFFSET
Include the field offset into the HTML output


PRINT_HEADER_ALL

protected static int PRINT_HEADER_ALL
Include all headers into the HTML output


last_active_timestamp

protected long last_active_timestamp

unicode_type

protected byte unicode_type
Constructor Detail

JCO.MetaData

protected JCO.MetaData()
Creates an instance of the meta data object


JCO.MetaData

public JCO.MetaData(String rec_name)
Creates an instance of the meta data object

Parameters:
rec_name - the name of the table/structure

JCO.MetaData

public JCO.MetaData(String rec_name,
                    int capacity)
Creates an instance of the meta data object and preallocates data structures for the specifed number of entries.

Parameters:
rec_name - the name of the table/structure
capacity - no. of data fields to preallocate

JCO.MetaData

public JCO.MetaData(IMetaData obj)
Creates an instance of the meta data object

Parameters:
obj - the MetaData object to copy the values from
Method Detail

internalSize

protected void internalSize(com.sap.mw.jco.JCO.DataSize size)

getObjectId

protected int getObjectId()

getUnicodeTypeAsString

protected String getUnicodeTypeAsString()

getUnicodeType

protected byte getUnicodeType()

equals

public boolean equals(Object obj)
Compares the specified object with this meta data object for equality. Meta data are considered equal if they contain the same field names, types, lengths and decimals.

Parameters:
obj - the object to compare for equality with this object
Returns:
true if the meta data are equal, false otherwise.
Since:
JCo 2.0

hashCode

public int hashCode()
Returns the hash code value for this record

Returns:
the hash code for the record
Since:
JCo 2.0

clone

public Object clone()
Creates an returns a copy of the MetaData object.

Specified by:
clone in interface IMetaData
Returns:
A clone of this MetaData object.

copy

protected void copy(IMetaData obj)
Copy data from another meta data object

Parameters:
obj - the meta data object to copy from

indexOf

public final int indexOf(String field_name)
Returns the index of the named field

Specified by:
indexOf in interface IMetaData
Parameters:
field_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 - thrown if a field with the specified name does not exist

hasField

public final boolean hasField(String field_name)
Checks whether a named field exists

Specified by:
hasField in interface IMetaData
Parameters:
field_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 String getName()
Returns the name of the record

Specified by:
getName in interface IMetaData
Returns:
the name of the record

getLineTypeName

public String getLineTypeName()
Deprecated. only for internal use.

Returns the name of the line type for a table record.

Returns:
the name of the line type or null

getFieldCount

public int getFieldCount()
Returns the number of fields.

Specified by:
getFieldCount in interface IMetaData
Returns:
the number of entries in the record.

getNumFields

public int getNumFields()
Returns the number of fields. This is just a convenience function and returns the same value as getFieldCount().

Returns:
the number of entries in the record.

getCapacity

public int getCapacity()
Returns the capacity of the internal buffers

Returns:
the current capacity of the internal buffers

getMetaData

public IMetaData getMetaData()
Returns the copy of MetaData object

Returns:
the meta data object

addInfo

public void addInfo(String name,
                    int type,
                    int length)
Adds a new field descriptor to the meta data object.
Note: if the backend is an unicode enabled system use
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, IExtendedFieldMetaData extended)
Otherwise the parameters based on character data types cannot be interpreted correctly. Note: The preffered way to create meta data should be to use JCO.Repository. In this case the meta data fetched by Repository is correct independent on having unicode and non unicode backend.

Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field internal length
See Also:
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags,Object tab_meta, IExtendedFieldMetaData extended), JCO.Repository

addInfo

public void addInfo(String name,
                    int type,
                    int length,
                    int offset)
Adds a new field descriptor to the meta data object.
Note: if the backend is an unicode enabled system use
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, IExtendedFieldMetaData extended)
Otherwise the parameters based on character data types cannot be interpreted correctly. Note: The preffered way to create meta data should be to use JCO.Repository. In this case the meta data fetched by Repository is correct independent on having unicode and non unicode backend.

Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field internal length in bytes
offset - Data field offset in the internal JCO data buffer
See Also:
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags,Object tab_meta, IExtendedFieldMetaData extended), JCO.Repository

addInfo

public void addInfo(String name,
                    int type,
                    int length,
                    int offset,
                    int decimals)
Adds a new field descriptor to the meta data object.
Note: if the backend is an unicode enabled system use
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, IExtendedFieldMetaData extended)
Otherwise the parameters based on character data types cannot be interpreted correctly. Note: The preffered way to create meta data should be to use JCO.Repository. In this case the meta data fetched by Repository is correct independent on having unicode and non unicode backend.

Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field internal 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 JCO.TYPE_BCD and JCO.TYPE_FLOAT)
See Also:
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags,Object tab_meta, IExtendedFieldMetaData extended), JCO.Repository

addInfo

public void addInfo(String name,
                    int type,
                    int length,
                    int offset,
                    int decimals,
                    int flags,
                    Object tab_meta)
Adds a new field descriptor to the meta data object.
Note: if the backend is an unicode enabled system use
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, IExtendedFieldMetaData extended)
Otherwise the parameters based on character data types cannot be interpreted correctly. Note: The preffered way to create meta data should be to use JCO.Repository. In this case the meta data fetched by Repository is correct independent on having unicode and non unicode backend.

Specified by:
addInfo in interface IMetaData
Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field internal 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 JCO.TYPE_BCD and JCO.TYPE_FLOAT)
flags - Bit-vector for additional attributes of the field. The vector can be ORed together from
Flag Description
IMPORT_PARAMETER The field is an import parameter
EXPORT_PARAMETER The field is an export parameter
OPTIONAL_PARAMETER The field is optional parameter
INACTIVATE_PARAMETEROnly used for table parameter,
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 If this field is a structure or table object only the meta data of those objects will we copied not reference to the objects ! Use setValue(...) to actually set the container object.
See Also:
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags,Object tab_meta, IExtendedFieldMetaData extended), JCO.Repository

addInfo

public void addInfo(String name,
                    int type,
                    int length,
                    int offset,
                    int decimals,
                    String sdefault,
                    String description,
                    int flags,
                    Object tab_meta,
                    com.sap.mw.jco.IExtendedFieldMetaData extended)
Adds a new field descriptor to the meta data object.
Note: if the backend is an unicode enabled system use
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags, Object tab_meta, IExtendedFieldMetaData extended)
Otherwise the parameters based on character data types cannot be interpreted correctly. Note: The preffered way to create meta data should be to use JCO.Repository. In this case the meta data fetched by Repository is correct independent on having unicode and non unicode backend.

Specified by:
addInfo in interface IMetaData
Parameters:
name - Field name for identifying this data field
type - Data field type
length - Data field internal 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 JCO.TYPE_BCD and JCO.TYPE_FLOAT)
sdefault - Data Field default value
description - Description of data field
flags - Bit-vector for additional attributes of the field. The vector can be ORed together from
Flag Description
IMPORT_PARAMETER The field is an import parameter
EXPORT_PARAMETER The field is an export parameter
OPTIONAL_PARAMETER The field is optional parameter
INACTIVATE_PARAMETEROnly used for table parameter,
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. If this field is a structure or table object only the meta data of those objects will we copied not reference to the objects ! Use setValue(...) to actually set the container object.
extended - extended meta data for this field or null if none available.
See Also:
addInfo(String name, int type, int charlength, int length, int offset, int decimals, String sdefault, String description, int flags,Object tab_meta, IExtendedFieldMetaData extended), JCO.Repository

addInfo

public void addInfo(String name,
                    int type,
                    int charlength,
                    int length,
                    int offset,
                    int decimals,
                    String sdefault,
                    String description,
                    int flags,
                    Object tab_meta,
                    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
charlength - Data field length in character units
length - Data field internal 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 JCO.TYPE_BCD and JCO.TYPE_FLOAT)
sdefault - Data Field default value
description - Description of data field
flags - Bit-vector for additional attributes of the field. The vector can be ORed together from
Flag Description
IMPORT_PARAMETER The field is an import parameter
EXPORT_PARAMETER The field is an export parameter
OPTIONAL_PARAMETER The field is optional parameter
INACTIVATE_PARAMETEROnly used for table parameter,
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. If this field is a structure or table object only the meta data of those objects will we copied not reference to the objects ! Use setValue(...) to actually set the container object.
extended - extended meta data for this field or null if none available.

addInfo

public void addInfo(String name,
                    char type,
                    int offset,
                    int length)
Deprecated. Only used internally. This method might be removed or changed in the next release without notice. Use public void addInfo(String name, int type, int length, int offset) instead.

Parameters:
name - Field name for identifying this data field
type - ABAP field type as character
offset - Data field offset in the internal JCO data buffer
length - Data field internal length in bytes

addInfo

public void addInfo(String name,
                    char type,
                    int offset,
                    int length,
                    int decimals)
Deprecated. Only used internally. This method might be removed or changed in the next release without notice. Use public void addInfo(String name, int type, int length, int offset, int decimals) instead.

Adds a new field descriptor to the meta data object

Parameters:
name - Field name for identifying this data field
type - ABAP field type as a character
offset - Data field offset in the internal JCO data buffer
length - Data field internal length in bytes
decimals - Data field number of decimals (only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT)

getName

public String getName(int index)
Returns the field name of the data field The field name is used for identfying a field in a structure or table row.

Specified by:
getName in interface IMetaData
Parameters:
index - the index of the field
Returns:
The field name of the data field described by this meta information object.

getTabName

public String getTabName(int index)
Returns the table/structure name of the data field or null if no table name is available

Specified by:
getTabName in interface IMetaData
Parameters:
index - the index of the field
Returns:
The table/structure name of the data field described by this meta information object.

getTabName

public String getTabName(String field_name)
Returns the table/structure name of the data field or null if no table name is available

Specified by:
getTabName in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
The table/structure name of the data field described by this meta information object.
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getMetaData

public IMetaData getMetaData(int index)
Returns the meta data if this data field is a table or structure or null if no meta data are available

Specified by:
getMetaData in interface IMetaData
Parameters:
index - the index of the field
Returns:
The table/structure meta data of the data field or null

getMetaData

public IMetaData getMetaData(String field_name)
Returns the meta data if this data field is a table or structure or null if no meta data are available

Specified by:
getMetaData in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
The table/structure meta data of the data field or null
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getLength

public int getLength(int index)
Returns the length of the field

Specified by:
getLength in interface IMetaData
Parameters:
index - the index of the field
Returns:
field length

getLength

public int getLength(String field_name)
Returns the length of the field

Specified by:
getLength in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
field length
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getInternalLength

public int getInternalLength(int index)
Returns the length of the field

Specified by:
getInternalLength in interface IMetaData
Parameters:
index - the index of the field
Returns:
field length
Since:
JCo 2.0

getInternalLength

public int getInternalLength(String field_name)
Returns the length of the field

Specified by:
getInternalLength in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
field length
Throws:
JCO.Exception - thrown if a field with the specified name does not exist
Since:
JCo 2.0

getOffset

public int getOffset(int index)
Returns the offset of the field. Only used internally. This method might be removed or changed in the next release without notice.

Specified by:
getOffset in interface IMetaData
Parameters:
index - the index of the field
Returns:
field offset

getOffset

public int getOffset(String field_name)
Returns the offset of the field. Only used internally. This method might be removed or changed in the next release without notice.

Specified by:
getOffset in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
field offset
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getDataBufferLength

protected int getDataBufferLength(int index)
This method is for internal use only. Returns the internal data buffer length of the field at the specified index position.

Parameters:
index - the index of the field whose internal data buffer length is to be returned.

getDataBufferOffset

protected int getDataBufferOffset(int index)
This method is for internal use only. Returns the internal data buffer offset of the field at the specified index position.

Parameters:
index - the index of the field whose internal data buffer offset is to be returned.

setDataBufferLength

protected void setDataBufferLength(int index,
                                   int dataBufferLength)
This method is for internal use only. Sets the internal data buffer length of the field at the specified index position.

Parameters:
index - the index of the field whose internal data buffer length is to be set.
dataBufferLength - the data buffer length value to be set.

setDataBufferOffset

protected void setDataBufferOffset(int index,
                                   int dataBufferOffset)
This method is for internal use only. Sets the internal data buffer offset of the field at the specified index position.

Parameters:
index - the index of the field whose internal data buffer offset is to be set.
dataBufferOffset - the data buffer offset value to be set.

setName

protected void setName(String name)
This method is for internal use only. Sets the name of the record.

Parameters:
name - the name to be set.

getType

public int getType(int index)
Returns the data type of the field

Specified by:
getType in interface IMetaData
Parameters:
index - the index of the field
Returns:
data type

getType

public int getType(String field_name)
Returns the data type of the field

Specified by:
getType in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
data type
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getTypeAsString

public String getTypeAsString(int index)
Returns the data type of the field as a string

Specified by:
getTypeAsString in interface IMetaData
Parameters:
index - the index of the field
Returns:
a string description of the data type

getTypeAsString

public String getTypeAsString(String field_name)
Returns the data type of the field as a string

Specified by:
getTypeAsString in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
a string description of the data type
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getDecimals

public int getDecimals(int index)
Returns the number of decimals of the field Decimals are only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT.

Specified by:
getDecimals in interface IMetaData
Parameters:
index - the index of the field
Returns:
number of decimals for the field.

getDecimals

public int getDecimals(String field_name)
Returns the number of decimals of the field Decimals are only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT.

Specified by:
getDecimals in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
number of decimals for the field.
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getDefault

public String getDefault(int index)
Returns the default value for the specified field

Specified by:
getDefault in interface IMetaData
Parameters:
index - the index of the field
Returns:
the default value of the field or null if not defined

getDefault

public String getDefault(String field_name)
Returns the default value for the specified field

Specified by:
getDefault in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
the default value of the field or null if not defined
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getDescription

public String getDescription(int index)
Returns a textual description for the specified field

Specified by:
getDescription in interface IMetaData
Parameters:
index - the index of the field
Returns:
a text that describes the field or null if none available

getDescription

public String getDescription(String field_name)
Returns a textual description for the specified field

Specified by:
getDescription in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
a text that describes the field or null if none available
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getFlags

public int getFlags(int index)
Returns the flags for the specified field

Parameters:
index - the index of the field

getFlags

public int getFlags(String field_name)
Returns the flags for the specified field

Parameters:
field_name - the name of the field
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getExtendedFieldMetaData

public com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData(int index)
Returns the extended field meta data object

Specified by:
getExtendedFieldMetaData in interface IMetaData
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(String field_name)
Returns the extended field meta data object

Specified by:
getExtendedFieldMetaData in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
the extended field meta data object or null if not available
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

setExtendedFieldMetaData

public void setExtendedFieldMetaData(com.sap.mw.jco.IExtendedFieldMetaData extended_field_meta_data,
                                     int index)
Sets the extended field meta data object

Parameters:
extended_field_meta_data - the extended field meta data object or null if not available
index - the index of the field

setExtendedFieldMetaData

public void setExtendedFieldMetaData(com.sap.mw.jco.IExtendedFieldMetaData extended_field_meta_data,
                                     String field_name)
Sets the extended field meta data object

Parameters:
extended_field_meta_data - the extended field meta data object or null if not available
field_name - the name of the field

isOptional

public boolean isOptional(int index)
Checks whether this field is an optional parameter

Specified by:
isOptional in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is an optional parameter, false otherwise

isOptional

public boolean isOptional(String field_name)
Checks whether this field is an optional parameter

Specified by:
isOptional in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an optional parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isImport

public boolean isImport(int index)
Checks whether this field is an import parameter

Specified by:
isImport in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is an import parameter, false otherwise

isImport

public boolean isImport(String field_name)
Checks whether this field is an import parameter

Specified by:
isImport in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an import parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isExport

public boolean isExport(int index)
Checks whether this field is an export parameter

Specified by:
isExport in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is an export parameter, false otherwise

isExport

public boolean isExport(String field_name)
Checks whether this field is an export parameter

Specified by:
isExport in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an export parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isStructure

public boolean isStructure(int index)
Checks whether this field is a structure parameter

Specified by:
isStructure in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is structure parameter, false otherwise

isStructure

public boolean isStructure(String field_name)
Checks whether this field is a structure parameter

Specified by:
isStructure in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is structure parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isNestedType1Structure

public boolean isNestedType1Structure(int index)
Checks whether the field at the specified index is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout

Specified by:
isNestedType1Structure in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is a nested TYPE1 structure, false otherwise
Since:
JCo 2.0.5

isNestedType1Structure

public boolean isNestedType1Structure(String field_name)
Checks whether the field with the specified name is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout

Specified by:
isNestedType1Structure in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is a nested TYPE1 structure, false otherwise
Since:
JCo 2.0.5

isTable

public boolean isTable(int index)
Checks whether this field is a table parameter

Specified by:
isTable in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is table parameter, false otherwise

isTable

public boolean isTable(String field_name)
Checks whether this field is a table parameter

Specified by:
isTable in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is table parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isException

public boolean isException(int index)
Checks whether this field is a exception

Specified by:
isException in interface IMetaData
Parameters:
index - the index of the field
Returns:
true if the specified field is an exception parameter, false otherwise

isException

public boolean isException(String field_name)
Checks whether this field is a exception

Specified by:
isException in interface IMetaData
Parameters:
field_name - the name of the field
Returns:
true if the specified field is an exception parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

getTabLength

public int getTabLength()
Returns the total length of a structure or single row of a table

Specified by:
getTabLength in interface IMetaData
Returns:
The total length of the record

isNestedType1Structure

public boolean isNestedType1Structure()
Checks whether this MetaData is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout

Specified by:
isNestedType1Structure in interface IMetaData
Returns:
true if the MetaData is a nested TYPE1 structure, false otherwise
Since:
JCo 2.0.5

isActive

public boolean isActive(int index)
Checks whether the specified field is active

Parameters:
index - the index of the field
Returns:
true if the specified field is an activated parameter, false otherwise

isActive

public boolean isActive(String field_name)
Checks whether the specified field is active

Parameters:
field_name - the name of the field
Returns:
true if the specified field is an activated parameter, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

isInitialized

public boolean isInitialized(int index)
Checks whether this field has been initialized

Parameters:
index - the index of the field
Returns:
true if the specified field has been initialized, false otherwise

isInitialized

public boolean isInitialized(String field_name)
Checks whether this field has been initialized

Parameters:
field_name - the name of the field
Returns:
true if the specified field has been initialized, false otherwise
Throws:
JCO.Exception - thrown if a field with the specified name does not exist

setFlags

public void setFlags(int index,
                     int flags)
Sets the flags for the specified field

Parameters:
index - the index of the field
flags - the flags to set for the field

setTabLength

public void setTabLength(int tab_length)
Sets the total length of a structure or single row of a table

Parameters:
tab_length - the new tab length
Returns:
The total length of the record

setNestedType1Structure

public void setNestedType1Structure(boolean isType1)
Sets that this MetaData is a nested TYPE1 structure, which is a structure with a fixed length in memory, but with a nested layout

Parameters:
isType1 - true if the MetaData is a nested TYPE1 structure, false otherwise
Since:
JCo 2.0.5

toString

public String toString()
Converts to a string

Specified by:
toString in interface IMetaData

toString

protected String toString(int level)
Converts to a string


writeHTML

public void writeHTML(String html_filename)
Dump the meta data to a file This method comes in handy for debugging purposes.

Parameters:
html_filename - the file to write to
Throws:
JCO.Exception - thrown if something went wrong

writeHTML

public void writeHTML(Writer writer)
               throws IOException
Dump the meta data to a stream This method comes in handy for debugging purposes.

Parameters:
writer - the stream to write to
Throws:
IOException - thrown if an I/O error occurred
JCO.Exception - thrown if something else went wrong
Since:
JCo 2.0

printHTML

protected void printHTML(PrintWriter os,
                         IMetaData m,
                         int level)
Outputs record as a HTML table

Parameters:
os - the PrintWriter output stream

printHTML

protected void printHTML(PrintWriter os,
                         IMetaData m,
                         int level,
                         int print_flags)
Outputs record as a HTML table

Parameters:
os - the PrintWriter output stream


Copyright 2006 SAP AG Complete Copyright Notice