com.sap.mw.jco
Class JCO.Record

java.lang.Object
  |
  +--com.sap.mw.jco.JCO.MetaData
        |
        +--com.sap.mw.jco.JCO.Record
All Implemented Interfaces:
java.lang.Cloneable, IMetaData, java.io.Serializable
Direct Known Subclasses:
JCO.ParameterList, JCO.Structure, JCO.Table
Enclosing class:
JCO

public static class JCO.Record
extends JCO.MetaData
implements java.lang.Cloneable, java.io.Serializable

Base class for all data-structures used throughout the JCO toolkit. The class takes care of internal bookkeeping of buffers, meta data, etc. In addition it provides a rich set of get/set methods which allow a convenient access to the individual fields that make up a record. Getters and Setters support conversion of field values which are summarized by the following table:
method/type JCO.TYPE_CHAR JCO.TYPE_INT1 JCO.TYPE_INT2 JCO.TYPE_INT JCO.TYPE_NUM JCO.TYPE_BCD JCO.TYPE_FLOAT JCO.TYPE_BYTE JCO.TYPE_DATE JCO.TYPE_TIME JCO.TYPE_STRINGJCO.TYPE_XSTRING JCO.TYPE_STRUCTUREJCO.TYPE_TABLE
Object getValue() String Integer Integer Integer String String Double byte[] Date Date String byte[] JCO.Structure JCO.Table
String getString() String String String String String String String String (hex) String String String String (hex) String (Name) String (Name)
char getChar() char --- --- --- --- --- --- --- --- --- char --- --- ---
short getShort() short short short short short --- --- short --- --- short short --- ---
int getInt() int int int int int --- --- int --- --- int int --- ---
long getLong() long long long long long --- --- long --- --- long long --- ---
BigInteger getBigInteger() BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger --- --- --- --- BigInteger --- --- ---
double getDouble() double double double double double double double --- --- --- double --- --- ---
BigDecimal getBigDecimal() BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal --- --- --- BigDecimal --- --- ---
Date getDate() Date --- --- --- --- --- --- --- Date Date Date --- --- ---
Date getTime() Date --- --- --- --- --- --- --- Date Date Date --- --- ---
byte[] getByteArray() byte[] --- --- --- --- --- --- byte[] --- --- byte[] byte[] --- ---
JCO.Structure getStructure() --- --- --- --- --- --- --- --- --- --- --- --- JCO.Structure ---
JCO.Table getTable() --- --- --- --- --- --- --- --- --- --- --- --- --- JCO.Table

See Also:
Serialized Form

Fields inherited from interface com.sap.mw.jco.IMetaData
EXPORT_PARAMETER, IMPORT_PARAMETER, INACTIVE_PARAMETER, 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
JCO.Record(IMetaData meta_data)
          Creates a record with a layout as specified by the meta data
JCO.Record(int type)
          Creates a record of the specified type
JCO.Record(int rec_type, IMetaData meta_data)
          Creates a record with a layout as specified by the meta data
 
Method Summary
 void addInfo(java.lang.String name, int type, int length, int offset, int decimals, java.lang.String sdefault, java.lang.String description, int flags, java.lang.Object tab_meta, com.sap.mw.jco.IExtendedFieldMetaData extended)
          Adds a new field descriptor to the meta data object
 void clear()
          Clears the record, i.e. resets everything to its initial state
 java.lang.Object clone()
          Creates a clone of this record
 int copyFrom(JCO.Record source)
          Copies the matching fields from the source record into this record Data fields are considered to be equivalent if the name and type of two fields match.
 boolean equals(java.lang.Object obj)
          Compares the specified object with this record for equality.
 JCO.FieldIterator fields()
          Returns an iterator for the fields
 void fromXML(java.lang.String data)
          Sets the whole record from a XML string.
 java.math.BigDecimal getBigDecimal(int index)
          Returns the value of the i'th field as a BigDecimal object
 java.math.BigDecimal getBigDecimal(java.lang.String field_name)
          Returns the value of the i'th field as a BigDecimal object
 java.math.BigInteger getBigInteger(int index)
          Returns the value of the i'th field as a BigInteger object
 java.math.BigInteger getBigInteger(java.lang.String field_name)
          Returns the value of the i'th field as a BigInteger object
 java.io.InputStream getBinaryStream(int index)
          Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. an java.io.InputStream object
 java.io.InputStream getBinaryStream(java.lang.String field_name)
          Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. a java.io.InputStream object
 byte[] getByteArray(int index)
          Returns the value of the i'th field as a byte array
 byte[] getByteArray(java.lang.String field_name)
          Returns the value of the i'th field as a byte[] array
 char getChar(int index)
          Returns the value of the i'th field as a char
 char getChar(java.lang.String field_name)
          Returns the value of the named field as a char
 java.io.Reader getCharacterStream(int index)
          Returns the value of the i'th field as a java.io.Reader object
 java.io.Reader getCharacterStream(java.lang.String field_name)
          Returns the value of the i'th field as a stream of characters, i.e. a java.io.Reader object
 java.lang.String getClassNameOfValue(int index)
          Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String field_name) are called to retrieve a calue from the field.
 java.lang.String getClassNameOfValue(java.lang.String field_name)
          Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String field_name) are called to retrieve a calue from the field.
 java.util.Date getDate(int index)
          Returns the value of the i'th field as a date
 java.util.Date getDate(java.lang.String field_name)
          Returns the value of the named field as a Date object
 double getDouble(int index)
          Returns the value of the i'th field as a double
 double getDouble(java.lang.String field_name)
          Returns the value of the named field as a double
 JCO.Field getField(int index)
          Returns the i'th field as an JCO.Field object
 JCO.Field getField(java.lang.String field_name)
          Returns the named field as a JCO.Field object
 int getInt(int index)
          Returns the value of the i'th field as an integer
 int getInt(java.lang.String field_name)
          Returns the value of the named field as an integer
 long getLong(int index)
          Returns the value of the i'th field as a long
 long getLong(java.lang.String field_name)
          Returns the value of the named field as a long
 short getShort(int index)
          Returns the value of the i'th field as a short
 short getShort(java.lang.String field_name)
          Returns the value of the named field as a short
 java.lang.String getString(int index)
          Returns the value of the i'th field as a string
 java.lang.String getString(java.lang.String field_name)
          Returns the value of the named field as a java.lang.String object
 JCO.Structure getStructure(int index)
          Returns the value of the i'th field as a JCO.Structure
 JCO.Structure getStructure(java.lang.String field_name)
          Returns the value of the named field as a JCO.Structure object
 JCO.Table getTable(int index)
          Returns the value of the i'th field as a table
 JCO.Table getTable(java.lang.String field_name)
          Returns the value of the named field as a JCO.Table object
 java.util.Date getTime(int index)
          Returns the value of the i'th field as a date
 java.util.Date getTime(java.lang.String field_name)
          Returns the value of the named field as a Date object
 java.lang.Object getValue(int index)
          Generic method that returns the value of the i'th field as an object.
 java.lang.Object getValue(java.lang.String field_name)
          Returns the value of the named field as an object
 int hashCode()
          Returns the hash code value for this record
 void readXML(java.io.Reader reader)
          Read the
 void readXML(java.lang.String xml_filename)
          Loads the request or response and all parameters and tables from the specified XML file.
 void setValue(byte[] value, int index)
          Sets the byte array as the value for the i'th field
 void setValue(byte[] value, java.lang.String name)
          Sets the byte array as the value for the named field
 void setValue(char value, int index)
          Sets the specified character as the field's value.
 void setValue(char value, java.lang.String name)
          Sets the character as the value for the named field.
 void setValue(double value, int index)
          Sets the double as the value for the i'th field
 void setValue(double value, java.lang.String name)
          Sets the double as the value for the named field
 void setValue(int value, int index)
          Sets the int as the value for the i'th field
 void setValue(int value, java.lang.String name)
          Sets the int as the value for the named field
 void setValue(JCO.Structure value, int index)
          Sets the structure as the value for the i'th field
 void setValue(JCO.Structure value, java.lang.String name)
          Sets the structure as the value for the named field
 void setValue(JCO.Table value, int index)
          Sets the table as the value for the i'th field
 void setValue(JCO.Table value, java.lang.String name)
          Sets the table as the value for the named field
 void setValue(long value, int index)
          Sets the long as the value for the i'th field
 void setValue(long value, java.lang.String name)
          Sets the long as the value for the named field.
 void setValue(java.lang.Object value, int index)
          Sets the object as the value for the i'th field
 void setValue(java.lang.Object value, java.lang.String name)
          Sets the object as the value for the named field
 void setValue(short value, int index)
          Sets the short as the value for the i'th field
 void setValue(short value, java.lang.String name)
          Sets the short as the value for the named field.
 void setValue(java.lang.String value, int index)
          Sets the specified string as the field's value.
 void setValue(java.lang.String value, java.lang.String name)
          Sets the string as the value for the named field.
 java.lang.String toString()
          Returns the record as a string
 java.lang.String toXML()
          Returns the whole record in XML format. Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:
The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
 java.lang.String toXML(int index)
          Returns the value of the i'th field as a XML string. Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:
The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
 java.lang.String toXML(java.lang.String field_name)
          Returns the value of named field as a XML string. Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:
The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
 void writeHTML(java.lang.String html_filename)
          Dump the table to a file.
 void writeHTML(java.io.Writer writer)
          Dump the table to a file.
 void writeXML(java.lang.String xml_filename)
          Dump the request or response and all parameters and tables to the specified XML file.
 void writeXML(java.io.Writer writer)
          Constructs an XML document from the record and writes it to the specified output writer
 void writeXML(java.io.Writer writer, boolean with_header)
          Constructs an XML document from the record and writes it to the specified output writer
 void writeXML(java.io.Writer writer, java.lang.String namespace_urn, boolean with_header)
          Constructs an XML document from the record and writes it to the specified output writer
 
Methods inherited from class com.sap.mw.jco.JCO.MetaData
addInfo, addInfo, addInfo, addInfo, addInfo, addInfo, addInfo, getCapacity, getDecimals, getDecimals, getDefault, getDefault, getDescription, getDescription, getExtendedFieldMetaData, getExtendedFieldMetaData, getFieldCount, getFlags, getFlags, getInternalLength, getInternalLength, getLength, getLength, getMetaData, getMetaData, getMetaData, getName, getName, getNumFields, getOffset, getOffset, getTabLength, getTabName, getTabName, getType, getType, getTypeAsString, getTypeAsString, hasField, indexOf, isActive, isActive, isException, isException, isExport, isExport, isImport, isImport, isInitialized, isInitialized, isOptional, isOptional, isStructure, isStructure, isTable, isTable, setExtendedFieldMetaData, setExtendedFieldMetaData, setFlags, setTabLength
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JCO.Record

public JCO.Record(int type)
Creates a record of the specified type
Parameters:
type - the type of the record

JCO.Record

public JCO.Record(IMetaData meta_data)
Creates a record with a layout as specified by the meta data
Parameters:
meta_data - the meta data which describe the layout of the record

JCO.Record

public JCO.Record(int rec_type,
                  IMetaData meta_data)
Creates a record with a layout as specified by the meta data
Parameters:
type - the type of the record
meta_data - the meta data which describe the layout of the record
Method Detail

clone

public java.lang.Object clone()
Creates a clone of this record
Overrides:
clone in class JCO.MetaData
Following copied from class: com.sap.mw.jco.JCO.MetaData
Returns:
A clone of this MetaData object.

equals

public boolean equals(java.lang.Object obj)
Compares the specified object with this record for equality. A record is considered to be "equal" to another if the meta data and the contents are equal.
Overrides:
equals in class JCO.MetaData
Parameters:
obj - the object to compare for equality with this record
Returns:
true if the records are equal, false otherwise.

hashCode

public int hashCode()
Returns the hash code value for this record
Overrides:
hashCode in class JCO.MetaData
Returns:
the hash code for the record
Since:
JCo 2.0

addInfo

public void addInfo(java.lang.String name,
                    int type,
                    int length,
                    int offset,
                    int decimals,
                    java.lang.String sdefault,
                    java.lang.String description,
                    int flags,
                    java.lang.Object tab_meta,
                    com.sap.mw.jco.IExtendedFieldMetaData extended)
Adds a new field descriptor to the meta data object
Overrides:
addInfo in class JCO.MetaData
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
extended - extended meta data for this field or null if none available.

clear

public void clear()
Clears the record, i.e. resets everything to its initial state
Since:
JCo 2.0

copyFrom

public int copyFrom(JCO.Record source)
Copies the matching fields from the source record into this record Data fields are considered to be equivalent if the name and type of two fields match. The data will be copied and converted as best as can, i.e. strings will be cut off if the source field is longer than the destination field, or they will be filled with spaces if the source is shorter than the destination, etc. If a single conversion fails so will the whole copy operation and the record will be left untouched. If this record is a table the data from the source will be appended. If this record is a structure or parameter list the data will be overriden.
Parameters:
source - the source record from which to copy the data
Returns:
the number of matching fields (columns)
Throws:
JCO.Exception - if something went wrong

getField

public final JCO.Field getField(int index)
Returns the i'th field as an JCO.Field object
Parameters:
index - the field index
Returns:
the field object at the specified index

getClassNameOfValue

public final java.lang.String getClassNameOfValue(int index)
Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String field_name) are called to retrieve a calue from the field.
Parameters:
index - the field index
Returns:
the fully-qualified class name of the value object
Since:
JCo 2.0

getValue

public java.lang.Object getValue(int index)
Generic method that returns the value of the i'th field as an object. Depending on the type of the field the method returns the following object:
type JCO.TYPE_CHAR JCO.TYPE_INT1 JCO.TYPE_INT2 JCO.TYPE_INT JCO.TYPE_NUM JCO.TYPE_BCD JCO.TYPE_FLOAT JCO.TYPE_BYTE JCO.TYPE_DATE JCO.TYPE_TIME JCO.TYPE_STRINGJCO.TYPE_XSTRING JCO.TYPE_STRUCTUREJCO.TYPE_TABLE
object String Integer Integer Integer String String Double byte[] Date Date String byte[] JCO.Structure JCO.Table
Parameters:
index - the field index
Returns:
the value of the specified field
Throws:
JCO.ConversionException - thrown if the value could not be converted to an object

getString

public java.lang.String getString(int index)
Returns the value of the i'th field as a string
Parameters:
index - the index of the field
Throws:
JCO.ConversionException - thrown if the value could not be converted to a String

getChar

public char getChar(int index)
Returns the value of the i'th field as a char
Parameters:
index - the index of the field
Returns:
the character of the field or ' ' if the field was empty.
Throws:
JCO.ConversionException - thrown if the value could not be converted to a char, i.e. if the underlying field contained more than one character
Since:
JCo 2.0

getShort

public short getShort(int index)
Returns the value of the i'th field as a short
Parameters:
index - the index of the field
Returns:
the field's value as a short
Throws:
JCO.ConversionException - thrown if the value could not be converted to a short
Since:
JCo 2.0

getInt

public int getInt(int index)
Returns the value of the i'th field as an integer
Parameters:
index - the index of the field
Returns:
the field's value as an integer
Throws:
JCO.ConversionException - thrown if the value could not be converted to an int

getLong

public long getLong(int index)
Returns the value of the i'th field as a long
Parameters:
index - the index of the field
Returns:
the field's value as a long
Throws:
JCO.ConversionException - thrown if the value could not be converted to an long
Since:
JCo 2.0

getBigInteger

public java.math.BigInteger getBigInteger(int index)
Returns the value of the i'th field as a BigInteger object
Parameters:
index - the index of the field
Returns:
the field's value as a BigInteger object
Throws:
JCO.ConversionException - thrown if the value could not be converted to a BigInteger
Since:
JCo 2.0

getDouble

public double getDouble(int index)
Returns the value of the i'th field as a double
Parameters:
index - the index of the field
Returns:
the field's value as a double
Throws:
JCO.ConversionException - thrown if the value could not be converted to a double

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index)
Returns the value of the i'th field as a BigDecimal object
Parameters:
index - the index of the field
Returns:
the field's value as a BigDecimal object
Throws:
JCO.ConversionException - thrown if the value could not be converted to a BigDecimal

getDate

public java.util.Date getDate(int index)
Returns the value of the i'th field as a date
Parameters:
index - the index of the field
Throws:
JCO.ConversionException - thrown if the value could not be converted to a Date

getTime

public java.util.Date getTime(int index)
Returns the value of the i'th field as a date
Parameters:
index - the index of the field
Throws:
JCO.ConversionException - thrown if the value could not be converted to a Date

getByteArray

public byte[] getByteArray(int index)
Returns the value of the i'th field as a byte array
Parameters:
index - the field index
Returns:
the value of the specified field
Throws:
JCO.ConversionException - thrown if the value could not be converted to a byte array

getBinaryStream

public java.io.InputStream getBinaryStream(int index)
Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. an java.io.InputStream object
Parameters:
index - the index of the field
Returns:
the field's value as an InputStream
Throws:
JCO.ConversionException - thrown if the value could not be converted to an java.io.InputStream
Since:
JCo 2.0

getCharacterStream

public java.io.Reader getCharacterStream(int index)
Returns the value of the i'th field as a java.io.Reader object
Parameters:
index - the index of the field
Returns:
the field's value as a java.io.Reader
Throws:
JCO.ConversionException - thrown if the value could not be converted to a java.io.Reader
Since:
JCo 2.0

getTable

public JCO.Table getTable(int index)
Returns the value of the i'th field as a table
Parameters:
index - the index of the field
Returns:
the field's value as a Table
Throws:
JCO.ConversionException - thrown if the value could not be converted to a JCO.Table
See Also:
JCO.Table

getStructure

public JCO.Structure getStructure(int index)
Returns the value of the i'th field as a JCO.Structure
Parameters:
index - the index of the field
Returns:
the field's value as a JCO.Structure
Throws:
JCO.ConversionException - thrown if the value could not be converted to a JCO.Structure
See Also:
JCO.Structure

toXML

public java.lang.String toXML(int index)
Returns the value of the i'th field as a XML string.

Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:

  • The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
  • The characters '0'-'9' or '.' are not mapped unless they appear as the first character in a element name.
  • '/' is mapped to '-_'
  • Any other ASCII character is mapped to the sequence '_--XX', where XX is the 2-digit hexadecimal code of the ASCII character
    (e.g. '&' is represented as '_--26'). The value part of an element may contain the following mappings:
  • The characters '<', '&', and '>' are being mapped to '&#60;', '&#38;', and '&#62;', respectively.
    Parameters:
    index - the index of the field
    Returns:
    the record in XML format
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a String
    JCO.Exception - thrown if another error occurred

  • toXML

    public java.lang.String toXML(java.lang.String field_name)
    Returns the value of named field as a XML string.

    Note: Field names in SAP system may contain characters which are illegal in XML element names.
    Legal elements names however can be assembled by using the following transformation rules:

  • The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
  • The characters '0'-'9' or '.' are not mapped unless they appear as the first character in a element name.
  • '/' is mapped to '-_'
  • Any other ASCII character is mapped to the sequence '_--XX', where XX is the 2-digit hexadecimal code of the ASCII character
    (e.g. '&' is represented as '_--26'). The value part of an element may contain the following mappings:
  • The characters '<', '&', and '>' are being mapped to '&#60;', '&#38;', and '&#62;', respectively.
    Parameters:
    field_name - the name of the field
    Returns:
    the record in XML format
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a String
    JCO.Exception - thrown if another error occurred

  • toXML

    public java.lang.String toXML()
    Returns the whole record in XML format.

    Note: Field names in SAP system may contain characters which are illegal in XML element names.
    Legal elements names however can be assembled by using the following transformation rules:

  • The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
  • The characters '0'-'9' or '.' are not mapped unless they appear as the first character in a element name.
  • '/' is mapped to '-_'
  • Any other ASCII character is mapped to the sequence '_--XX', where XX is the 2-digit hexadecimal code of the ASCII character
    (e.g. '&' is represented as '_--26').
    The value part of an element may contain the following mappings:
  • The characters '<', '&', and '>' are being mapped to '&#60;', '&#38;', and '&#62;', respectively.
    Returns:
    the record in XML format
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a String
    JCO.Exception - thrown if another error occurred

  • fromXML

    public void fromXML(java.lang.String data)
    Sets the whole record from a XML string. Note: This is not a full-fledged XML parser. All documents passed here must comply strictly to the encoding scheme as described for the method toXML().
    Parameters:
    data - the XML data
    Throws:
    JCO.Exception - thrown if an error occurred such as invalid XML format.
    See Also:
    toXML(int)

    setValue

    public void setValue(java.lang.String value,
                         int index)
    Sets the specified string as the field's value. To set a value back to its initial type specific setting pass "", i.e. an empty string, or null
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    getField

    public final JCO.Field getField(java.lang.String field_name)
    Returns the named field as a JCO.Field object
    Parameters:
    field_name - the name of the field
    Returns:
    the field object
    Throws:
    JCO.Exception - thrown if a field with the specified name does not exist

    getClassNameOfValue

    public final java.lang.String getClassNameOfValue(java.lang.String field_name)
    Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String field_name) are called to retrieve a calue from the field.
    Parameters:
    field_name - the name of the field
    Returns:
    the fully-qualified class name of the value object
    Throws:
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    getValue

    public final java.lang.Object getValue(java.lang.String field_name)
    Returns the value of the named field as an object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to an Object
    JCO.Exception - thrown if a field with the specified name does not exist

    getString

    public final java.lang.String getString(java.lang.String field_name)
    Returns the value of the named field as a java.lang.String object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a String
    JCO.Exception - thrown if a field with the specified name does not exist

    getChar

    public final char getChar(java.lang.String field_name)
    Returns the value of the named field as a char
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a char
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    getShort

    public final short getShort(java.lang.String field_name)
    Returns the value of the named field as a short
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a short
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    getInt

    public final int getInt(java.lang.String field_name)
    Returns the value of the named field as an integer
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to an int
    JCO.Exception - thrown if a field with the specified name does not exist

    getLong

    public final long getLong(java.lang.String field_name)
    Returns the value of the named field as a long
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a long
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    getBigInteger

    public final java.math.BigInteger getBigInteger(java.lang.String field_name)
    Returns the value of the i'th field as a BigInteger object
    Parameters:
    field_name - the name of the field
    Returns:
    the field's value as a BigInteger object
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a BigInteger
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    getDouble

    public final double getDouble(java.lang.String field_name)
    Returns the value of the named field as a double
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a double
    JCO.Exception - thrown if a field with the specified name does not exist

    getBigDecimal

    public final java.math.BigDecimal getBigDecimal(java.lang.String field_name)
    Returns the value of the i'th field as a BigDecimal object
    Parameters:
    field_name - the name of the field
    Returns:
    the field's value as a BigDecimal object
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a BigDecimal
    JCO.Exception - thrown if a field with the specified name does not exist

    getDate

    public final java.util.Date getDate(java.lang.String field_name)
    Returns the value of the named field as a Date object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a Date
    JCO.Exception - thrown if a field with the specified name does not exist

    getTime

    public final java.util.Date getTime(java.lang.String field_name)
    Returns the value of the named field as a Date object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a Date
    JCO.Exception - thrown if a field with the specified name does not exist

    getByteArray

    public final byte[] getByteArray(java.lang.String field_name)
    Returns the value of the i'th field as a byte[] array
    Parameters:
    field_name - the name of the field
    Returns:
    the field's value as a byte array
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a byte[] array
    JCO.Exception - thrown if a field with the specified name does not exist

    getBinaryStream

    public final java.io.InputStream getBinaryStream(java.lang.String field_name)
    Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. a java.io.InputStream object
    Parameters:
    index - the index of the field
    Returns:
    the field's value as a java.io.InputStream
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a java.io.InputStream
    Since:
    JCo 2.0

    getCharacterStream

    public final java.io.Reader getCharacterStream(java.lang.String field_name)
    Returns the value of the i'th field as a stream of characters, i.e. a java.io.Reader object
    Parameters:
    index - the index of the field
    Returns:
    the field's value as a java.io.Reader
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a java.io.Reader
    Since:
    JCo 2.0

    getTable

    public final JCO.Table getTable(java.lang.String field_name)
    Returns the value of the named field as a JCO.Table object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a JCO.Table
    JCO.Exception - thrown if a field with the specified name does not exist

    getStructure

    public final JCO.Structure getStructure(java.lang.String field_name)
    Returns the value of the named field as a JCO.Structure object
    Parameters:
    field_name - the name of the field
    Returns:
    the value of the specified field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to a JCO.Structure
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(char value,
                         int index)
    Sets the specified character as the field's value.
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    Since:
    JCo 1.1

    setValue

    public void setValue(short value,
                         int index)
    Sets the short as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    Since:
    JCo 2.0

    setValue

    public void setValue(int value,
                         int index)
    Sets the int as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(long value,
                         int index)
    Sets the long as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    Since:
    JCo 2.0

    setValue

    public void setValue(double value,
                         int index)
    Sets the double as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(byte[] value,
                         int index)
    Sets the byte array as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(JCO.Structure value,
                         int index)
    Sets the structure as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(JCO.Table value,
                         int index)
    Sets the table as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(java.lang.Object value,
                         int index)
    Sets the object as the value for the i'th field
    Parameters:
    value - the value to set for the field
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation

    setValue

    public void setValue(java.lang.String value,
                         java.lang.String name)
    Sets the string as the value for the named field. To set a value back to its initial type specific setting pass "", i.e. an empty string, or null
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(char value,
                         java.lang.String name)
    Sets the character as the value for the named field.
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 1.1

    setValue

    public void setValue(short value,
                         java.lang.String name)
    Sets the short as the value for the named field.
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    setValue

    public void setValue(int value,
                         java.lang.String name)
    Sets the int as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(long value,
                         java.lang.String name)
    Sets the long as the value for the named field.
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist
    Since:
    JCo 2.0

    setValue

    public void setValue(double value,
                         java.lang.String name)
    Sets the double as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(byte[] value,
                         java.lang.String name)
    Sets the byte array as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(JCO.Structure value,
                         java.lang.String name)
    Sets the structure as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(JCO.Table value,
                         java.lang.String name)
    Sets the table as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    setValue

    public void setValue(java.lang.Object value,
                         java.lang.String name)
    Sets the object as the value for the named field
    Parameters:
    value - the value to set for the field
    name - the name of the field to set
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    JCO.Exception - thrown if a field with the specified name does not exist

    fields

    public final JCO.FieldIterator fields()
    Returns an iterator for the fields

    writeHTML

    public void writeHTML(java.lang.String html_filename)
    Dump the table to a file. This method comes in handy for debugging purposes.
    The number of rows written is controlled by the property jco.html.table_maxrows" which has a default value of 100 and can be altered using JCO.setProperty("jco.html.table_maxrows","200"); for instance.
    Overrides:
    writeHTML in class JCO.MetaData
    Parameters:
    html_filename - the file to write to
    Throws:
    JCO.Exception - thrown if something went wrong

    writeHTML

    public void writeHTML(java.io.Writer writer)
                   throws java.io.IOException
    Dump the table to a file. This method comes in handy for debugging purposes.
    The number of rows written is controlled by the property jco.html.table_maxrows" which has a default value of 100 and can be altered using JCO.setProperty("jco.html.table_maxrows","200"); for instance.
    Overrides:
    writeHTML in class JCO.MetaData
    Parameters:
    writer - the stream to write to
    Throws:
    java.io.IOException - thrown in case of an I/O error
    JCO.Exception - thrown if something else went wrong
    Since:
    JCo 2.0

    toString

    public java.lang.String toString()
    Returns the record as a string
    Overrides:
    toString in class JCO.MetaData
    Following copied from interface: com.sap.mw.jco.IMetaData
    Returns:
    a printable representation of this object

    readXML

    public void readXML(java.io.Reader reader)
                 throws java.io.IOException
    Read the
    Parameters:
    reader - the stream to read the xml document from
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred

    readXML

    public void readXML(java.lang.String xml_filename)
                 throws java.io.IOException
    Loads the request or response and all parameters and tables from the specified XML file. This method comes in handy for debugging purposes.
    Parameters:
    xml_filename - the file to read from
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred

    writeXML

    public void writeXML(java.io.Writer writer)
                  throws java.io.IOException
    Constructs an XML document from the record and writes it to the specified output writer
    Parameters:
    writer - the stream to dump the XML document to
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(java.io.Writer writer,
                         boolean with_header)
                  throws java.io.IOException
    Constructs an XML document from the record and writes it to the specified output writer
    Parameters:
    writer - the stream to dump the XML document to
    with_header - if true prepends the XML header,
    i.e. <?xml version="1.0" encoding="UTF-8"?>
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(java.io.Writer writer,
                         java.lang.String namespace_urn,
                         boolean with_header)
                  throws java.io.IOException
    Constructs an XML document from the record and writes it to the specified output writer
    Parameters:
    writer - the stream to dump the XML document to
    with_header - if true prepends the XML header,
    i.e. <?xml version="1.0" encoding="UTF-8"?>
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(java.lang.String xml_filename)
                  throws java.io.IOException
    Dump the request or response and all parameters and tables to the specified XML file. This method comes in handy for debugging purposes.
    Parameters:
    xml_filename - the file to write to
    Throws:
    java.io.IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0