com.sap.mw.jco

Class JCO.Record

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

public static class JCO.Record
extends JCO.MetaData
implements Cloneable, 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 --- --- ---
char getCharArray() 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

Nested Class Summary
protected  class JCO.Record.Type1Record
           
protected static class JCO.Record.XMLReader
          Converts an XML document into a record
protected static class JCO.Record.XMLWriter
          Converts a record to an XML document
 
Nested classes inherited from class com.sap.mw.jco.JCO.MetaData
JCO.MetaData.Type1Data
 
Field Summary
protected  char[] data
          Buffer that holds the actual data
protected  int[] delta
           
protected  boolean modified
          Flag that indicates whether this tables has been modified
protected  int num_rows
          No. of rows encoded in the data buffer
protected  Object[] odata
          Buffer that holds complex data like structures and tables
protected  byte[] opcode
           
protected static byte PARAMETER
          This record represents a JCO parameter
protected  byte rec_type
          Specifies the type of this record
protected static byte REQUEST
          This record represents a request
protected static byte RESPONSE
          This record represents a response
protected  int row
          Currently active row
protected  int row_length
          Length of a single row of data in chars
protected static byte SEGMENT
          This record represents a JCO IDOC segment
protected static byte STRUCTURE
          This record represents a JCO structure
protected static byte TABLE
          This record represents a JCO table
protected  JCO.Record.Type1Record type1_record
           
 
Fields inherited from class com.sap.mw.jco.JCO.MetaData
blength, boffset, decimals, defaults, description, extended_field_meta_data, flags, hash_of_indices, last_active_timestamp, length, name, num_fields, num_odata, offset, oindex, PRINT_HEADER_ALL, PRINT_HEADER_DECIMALS, PRINT_HEADER_DEFAULT, PRINT_HEADER_INTERNAL_LENGTH, PRINT_HEADER_INTERNAL_OFFSET, PRINT_HEADER_LENGTH, PRINT_HEADER_NAME, PRINT_HEADER_OFFSET, PRINT_HEADER_TYPE, rec_name, tab_length, tab_meta, type, type_handle, type_name, type1_data, 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
  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
protected JCO.Record(int rec_type, String rec_name)
          Creates a record with a layout as specified by the meta data
protected JCO.Record(JCO.Record value)
          Creates an new instance of a record which has the same contents as the record argument
 
Method Summary
 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.
protected  boolean checkIfInitialized()
          Checks for initialized parameters
protected  void checkRowCapacity()
          Check if the rows have been allocated properly.
 void clear()
          Clears the record, i.e. resets everything to its initial state
 Object clone()
          Creates a clone of this record
protected  void copyContent(JCO.Record src, JCO.Record dest)
          Copies the data from src to dest
 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.
protected  JCO.ConversionException createConversionException(int index, String to_type)
          Creates a conversion exception
protected  JCO.ConversionException createConversionException(int index, String from_type, String value)
          Creates a conversion exception
protected  void encodeGENERIC(char[] value, int voffset, int vlength, int index)
          Generic encoder used by XML parser
protected  void ensureBufferCapacity()
          Checks the size of the buffer and allocates new memory if necessary.
 boolean equals(Object obj)
          Compares the specified object with this record for equality.
 JCO.FieldIterator fields()
          Returns an iterator for the fields
protected  void finalize()
           
 void fromXML(String data)
          Sets the whole record from an XML string.
 BigDecimal getBigDecimal(int index)
          Returns the value of the i'th field as a BigDecimal object
 BigDecimal getBigDecimal(String field_name)
          Returns the value of the i'th field as a BigDecimal object
 BigInteger getBigInteger(int index)
          Returns the value of the i'th field as a BigInteger object
 BigInteger getBigInteger(String field_name)
          Returns the value of the i'th field as a BigInteger object
 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
 InputStream getBinaryStream(String field_name)
          Returns the value of the named field as a stream of uninterpreted bytes, i.e. a java.io.InputStream object
 byte getByte(int index)
          Returns the value of the i'th field as a byte
 byte getByte(String field_name)
          Returns the value of the named field as a byte
 byte[] getByteArray(int index)
          Returns the value of the i'th field as a byte array
 byte[] getByteArray(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(String field_name)
          Returns the value of the named field as a char
 Reader getCharacterStream(int index)
          Returns the value of the i'th field as a java.io.Reader object
 Reader getCharacterStream(String field_name)
          Returns the value of the named field as a stream of characters, i.e. a java.io.Reader object
 char[] getCharArray(int index)
          Returns the value of the i'th field as a char array
 char[] getCharArray(String field_name)
          Returns the value of the i'th field as a char[] array
 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.
 String getClassNameOfValue(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.
protected  char[] getDataBuffer()
          This method is for internal use only.
protected  int getDataBufferOffset(int index)
          This method is for internal use only.
protected  int getDataBufferRowLength()
          This method is for internal use only.
 Date getDate(int index)
          Returns the value of the i'th field as a date
 Date getDate(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(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(String field_name)
          Returns the named field as a JCO.Field object
 float getFloat(int index)
          Returns the value of the i'th field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 float getFloat(String field_name)
          Returns the value of the named field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
protected  String getHTMLString(int index)
          Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML().
 int getInt(int index)
          Returns the value of the i'th field as an integer
 int getInt(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(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(String field_name)
          Returns the value of the named field as a short
 String getString(int index)
          Returns the value of the i'th field as a string.
 String getString(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(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(String field_name)
          Returns the value of the named field as a JCO.Table object
 Date getTime(int index)
          Returns the value of the i'th field as a date
 Date getTime(String field_name)
          Returns the value of the named field as a Date object
 Object getValue(int index)
          Generic method that returns the value of the i'th field as an object.
 Object getValue(String field_name)
          Returns the value of the named field as an object
 int hashCode()
          Returns the hash code value for this record
protected  void initializeRow(int irow)
          Initializes a row
protected  void internalSize(com.sap.mw.jco.JCO.DataSize size)
           
protected  void printHTML(PrintWriter os)
          Outputs record as a HTML table
protected  void printHTML(PrintWriter os, String text, int level)
          Outputs record as a HTML table
protected  void printHTML(PrintWriter os, String text, int level, int print_flags)
          Outputs record as a HTML table
 void readXML(Reader reader)
          Read the
 void readXML(String xml_filename)
          Loads the request or response and all parameters and tables from the specified XML file.
protected  void setDefault(int index)
          Sets the default value for a field
protected  void setModified(int row)
          Sets the modified flag for the current row
 void setValue(byte[] value, int index)
          Sets the byte array as the value for the i'th field
 void setValue(byte[] value, String name)
          Sets the byte array as the value for the named field
 void setValue(byte value, int index)
          Sets the byte as the value for the i'th field
 void setValue(byte value, String name)
          Sets the byte as the value for the named field
 void setValue(char[] value, int index)
          Sets the specified character array as the field's value.
 void setValue(char[] value, int from, int length, int index)
          Sets the specified character array as the field's value.
 void setValue(char[] value, int from, int length, String name)
          Sets the specified character array as the value for the named field.
 void setValue(char[] value, String name)
          Sets the specified character 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, 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, String name)
          Sets the double as the value for the named field
 void setValue(float value, int index)
          Sets the float as the value for the i'th field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 void setValue(float value, String name)
          Sets the float as the value for the named field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 void setValue(int value, int index)
          Sets the int as the value for the i'th field
 void setValue(int value, 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, 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, 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, String name)
          Sets the long as the value for the named field.
 void setValue(Object value, int index)
          Sets the object as the value for the i'th field
 void setValue(Object value, 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, String name)
          Sets the short as the value for the named field.
 void setValue(String value, int index)
          Sets the specified string as the field's value.
 void setValue(String value, String name)
          Sets the string as the value for the named field.
 String toString()
          Returns the record as a string
 String toXML()
          Returns the whole record in XML format.
 String toXML(int index)
          Returns the value of the i'th field as a XML string.
 String toXML(String field_name)
          Returns the value of named field as a XML string.
 void writeHTML(String html_filename)
          Dump the table to a file.
 void writeHTML(Writer writer)
          Dump the table to a file.
 void writeXML(String xml_filename)
          Dump the request or response and all parameters and tables to the specified XML file.
 void writeXML(Writer writer)
          Constructs an XML document from the record and writes it to the specified output writer
 void writeXML(Writer writer, boolean with_header)
          Constructs an XML document from the record and writes it to the specified output writer
 void writeXML(Writer writer, 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, copy, getCapacity, getDataBufferLength, getDecimals, getDecimals, getDefault, getDefault, getDescription, getDescription, getExtendedFieldMetaData, getExtendedFieldMetaData, getFieldCount, getFlags, getFlags, getInternalLength, getInternalLength, getLength, getLength, getLineTypeName, getMetaData, getMetaData, getMetaData, getName, getName, getNumFields, getObjectId, getOffset, getOffset, getTabLength, getTabName, getTabName, getType, getType, getTypeAsString, getTypeAsString, getUnicodeType, getUnicodeTypeAsString, hasField, indexOf, isActive, isActive, isException, isException, isExport, isExport, isImport, isImport, isInitialized, isInitialized, isNestedType1Structure, isNestedType1Structure, isNestedType1Structure, isOptional, isOptional, isStructure, isStructure, isTable, isTable, printHTML, printHTML, setDataBufferLength, setDataBufferOffset, setExtendedFieldMetaData, setExtendedFieldMetaData, setFlags, setName, setNestedType1Structure, setTabLength, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER

protected static final byte PARAMETER
This record represents a JCO parameter

See Also:
Constant Field Values

STRUCTURE

protected static final byte STRUCTURE
This record represents a JCO structure

See Also:
Constant Field Values

TABLE

protected static final byte TABLE
This record represents a JCO table

See Also:
Constant Field Values

SEGMENT

protected static final byte SEGMENT
This record represents a JCO IDOC segment

See Also:
Constant Field Values

REQUEST

protected static final byte REQUEST
This record represents a request

See Also:
Constant Field Values

RESPONSE

protected static final byte RESPONSE
This record represents a response

See Also:
Constant Field Values

rec_type

protected byte rec_type
Specifies the type of this record


data

protected char[] data
Buffer that holds the actual data


odata

protected Object[] odata
Buffer that holds complex data like structures and tables


opcode

protected byte[] opcode

delta

protected int[] delta

type1_record

protected JCO.Record.Type1Record type1_record

row_length

protected int row_length
Length of a single row of data in chars


num_rows

protected int num_rows
No. of rows encoded in the data buffer


row

protected int row
Currently active row


modified

protected boolean modified
Flag that indicates whether this tables has been modified

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:
rec_type - the type of the record
meta_data - the meta data which describe the layout of the record

JCO.Record

protected JCO.Record(int rec_type,
                     String rec_name)
Creates a record with a layout as specified by the meta data

Parameters:
rec_type - the type of the record
rec_name - the name of the record

JCO.Record

protected JCO.Record(JCO.Record value)
Creates an new instance of a record which has the same contents as the record argument

Parameters:
value - the initial value of the record
Method Detail

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable

clone

public Object clone()
Creates a clone of this record

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

equals

public boolean equals(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

copyContent

protected void copyContent(JCO.Record src,
                           JCO.Record dest)
Copies the data from src to dest

Parameters:
src - the source record

createConversionException

protected JCO.ConversionException createConversionException(int index,
                                                            String to_type)
Creates a conversion exception

Parameters:
index - the index of the field for which the conversion failed
to_type - the data type which was the target of the conversion

createConversionException

protected JCO.ConversionException createConversionException(int index,
                                                            String from_type,
                                                            String value)
Creates a conversion exception

Parameters:
index - the index of the field for which the conversion failed
from_type - the data type which was the target of the conversion
value - the value whuch could not be converted

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.
Generally, it is better to create first a metadata object and then the instance of record class - JCO.Structure, JCO.Table, JCO.ParameterList.
IMetaData structureMD = new JCO.MetaData("structure name"); structureMD.addInfo(...); ... structureMD.addInfo(...); // create a structure from the metadata ... JCO.Structure structure = new JCO.Structure(structureMD); // ... or a table JCO.Table table = new JCO.Table(structureMD); It is possible to create more than one record instance from one metadata object.

Specified by:
addInfo in interface IMetaData
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.
See Also:
JCO.MetaData.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

setModified

protected void setModified(int row)
Sets the modified flag for the current row


checkIfInitialized

protected final boolean checkIfInitialized()
Checks for initialized parameters

Returns:
true if at least one field is initialized, false otherwise

initializeRow

protected void initializeRow(int irow)
Initializes a row

Parameters:
irow - the row pointer to the row which must be initialized

ensureBufferCapacity

protected void ensureBufferCapacity()
Checks the size of the buffer and allocates new memory if necessary.


checkRowCapacity

protected final void checkRowCapacity()
Check if the rows have been allocated properly.

Throws:
JCO.Exception - if no rows have not been allocated so far

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 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 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 String getString(int index)
Returns the value of the i'th field as a string. If the data type of the field is CHAR or STRING, the return value all trailing balancks

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

getByte

public byte getByte(int index)
Returns the value of the i'th field as a byte

Parameters:
index - the index of the field
Returns:
the field's value as a byte
Throws:
JCO.ConversionException - thrown if the value could not be converted to a byte
Since:
JCo 2.1

getByte

public final byte getByte(String field_name)
Returns the value of the named field as a byte

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 byte
JCO.Exception - thrown if a field with the specified name does not exist
Since:
JCo 2.1

getFloat

public float getFloat(int index)
Returns the value of the i'th field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same value.

Parameters:
index - the index of the field
Returns:
the field's value as a float
Throws:
JCO.ConversionException - thrown if the value could not be converted to a float
Since:
JCo 2.1

getFloat

public final float getFloat(String field_name)
Returns the value of the named field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same value.

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 float
JCO.Exception - thrown if a field with the specified name does not exist
Since:
JCo 2.1

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

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 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 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 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 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

getCharArray

public char[] getCharArray(int index)
Returns the value of the i'th field as a char 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 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 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

getHTMLString

protected String getHTMLString(int index)
Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML(). 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

toXML

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

Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML().

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
See Also:
fromXML(java.lang.String)

toXML

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

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
See Also:
fromXML(java.lang.String)

toXML

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

Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML().

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
See Also:
fromXML(java.lang.String)

fromXML

public void fromXML(String data)
Sets the whole record from an XML string.
Note: This is not a full-fledged XML parser. The given XML string will not be validated and will not be checked if it is well-formed. The following grammar is supported XML data := ELEMENT* | ELEMENT := VALUE | VALUE := LITERAL* | TABLE_ROW* | ELEMENT* TABLE_ROW := VALUE LITERAL := literal | &html_entity; | &#hex_coded_literal; 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 literal part of an element may contain the following sequences:
  • The characters '<', '&', and '>' are being mapped to '&#60;', '&#38;', and '&#62;', respectively.
  • The characters coded as html entities will be parsed and converted to the regarding character. Note: The xml data does not contain any meta data information regarding the structure of the record. So only the records with previously set meta data can be filled by this method. The parser will read the values from the given xml string and set them into the corresponding record fields by name. All other values from the xml string will be discarded.

    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(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(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 String getClassNameOfValue(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 Object getValue(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 String getString(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(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(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(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(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 BigInteger getBigInteger(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(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 BigDecimal getBigDecimal(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 Date getDate(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 Date getTime(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(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

    getCharArray

    public final char[] getCharArray(String field_name)
    Returns the value of the i'th field as a char[] array

    Parameters:
    field_name - the name of the field
    Returns:
    the field's value as a char 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 InputStream getBinaryStream(String field_name)
    Returns the value of the named field as a stream of uninterpreted bytes, i.e. a java.io.InputStream object

    Parameters:
    field_name - the name 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 Reader getCharacterStream(String field_name)
    Returns the value of the named field as a stream of characters, i.e. a java.io.Reader object

    Parameters:
    field_name - the name 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(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(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

    setDefault

    protected void setDefault(int index)
    Sets the default value for a field

    Parameters:
    index - the index of the field

    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(char[] value,
                         int index)
    Sets the specified character array 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 2.1

    setValue

    public void setValue(char[] value,
                         int from,
                         int length,
                         int index)
    Sets the specified character array as the field's value.
    Allowed for rfc types CHAR and STRING

    Parameters:
    value - the value to set for the field
    from - offset in the char array
    length - count of chars that will be set as field's value
    index - the index of the field
    Throws:
    JCO.ConversionException - thrown if the value could not be converted to its internal representation
    Since:
    JCo 2.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(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(String value,
                         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,
                         String name)
    Sets the specified character 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
    Since:
    JCo 2.1

    setValue

    public void setValue(char[] value,
                         int from,
                         int length,
                         String name)
    Sets the specified character 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
    Since:
    JCo 2.1

    setValue

    public void setValue(char value,
                         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,
                         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,
                         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,
                         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,
                         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(float value,
                         int index)
    Sets the float as the value for the i'th field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same 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 2.1

    setValue

    public void setValue(float value,
                         String name)
    Sets the float as the value for the named field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same value.

    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.1

    setValue

    public void setValue(byte value,
                         int index)
    Sets the byte 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.1

    setValue

    public void setValue(byte value,
                         String name)
    Sets the byte 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.1

    setValue

    public void setValue(byte[] value,
                         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,
                         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,
                         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(Object value,
                         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

    getDataBuffer

    protected char[] getDataBuffer()
    This method is for internal use only. Returns the record's internal data buffer char array.


    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.

    Overrides:
    getDataBufferOffset in class JCO.MetaData
    Parameters:
    index - the index of the field whose internal data buffer offset is to be returned.

    getDataBufferRowLength

    protected int getDataBufferRowLength()
    This method is for internal use only. Returns the record's internal data buffer row length.


    encodeGENERIC

    protected final void encodeGENERIC(char[] value,
                                       int voffset,
                                       int vlength,
                                       int index)
    Generic encoder used by XML parser

    Parameters:
    voffset - the offset into the value array
    vlength - the length of data to encode from the value array
    index - the field index

    internalSize

    protected void internalSize(com.sap.mw.jco.JCO.DataSize size)
    Overrides:
    internalSize in class JCO.MetaData

    fields

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


    writeHTML

    public void writeHTML(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(Writer writer)
                   throws 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:
    IOException - thrown in case of an I/O error
    JCO.Exception - thrown if something else went wrong
    Since:
    JCo 2.0

    printHTML

    protected void printHTML(PrintWriter os)
    Outputs record as a HTML table

    Parameters:
    os - the PrintWriter output stream

    printHTML

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

    Parameters:
    os - the PrintWriter output stream

    printHTML

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

    Parameters:
    os - the PrintWriter output stream
    text - the name of the record

    toString

    public String toString()
    Returns the record as a string

    Specified by:
    toString in interface IMetaData
    Overrides:
    toString in class JCO.MetaData

    readXML

    public void readXML(Reader reader)
                 throws IOException
    Read the

    Parameters:
    reader - the stream to read the xml document from
    Throws:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred

    readXML

    public void readXML(String xml_filename)
                 throws 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:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred

    writeXML

    public void writeXML(Writer writer)
                  throws 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:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(Writer writer,
                         boolean with_header)
                  throws 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:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(Writer writer,
                         String namespace_urn,
                         boolean with_header)
                  throws 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:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0

    writeXML

    public void writeXML(String xml_filename)
                  throws 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:
    IOException - thrown if an I/O error occurred
    JCO.Exception - thrown if another error occurred
    Since:
    JCo 2.0


    Copyright 2006 SAP AG Complete Copyright Notice