com.sap.mw.jco
Class JCO.Field

java.lang.Object
  |
  +--com.sap.mw.jco.JCO.Field
Enclosing class:
JCO

public static final class JCO.Field
extends java.lang.Object

Class to represent a data field in a record (i.e. parameter list, table, structure).


Method Summary
 java.math.BigDecimal getBigDecimal()
          Returns the value of the i'th field as a BigDecimal object
 java.math.BigInteger getBigInteger()
          Returns the value of the i'th field as a BigInteger object
 java.io.InputStream getBinaryStream()
          Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. an java.io.InputStream object
 byte[] getByteArray()
          Returns the value of the i'th field as a byte[] array
 char getChar()
          Returns the field's value as a character
 java.io.Reader getCharacterStream()
          Returns the value of the i'th field as a stream of characeters, i.e. an java.io.Reader object
 java.lang.String getClassNameOfValue()
          Returns the fully-qualified name of the Java class whose instances are manufactured if the method Field.getValue() is called to retrieve a value from a field.
 java.util.Date getDate()
          Returns the value of the i'th field as a Date object
 int getDecimals()
          Returns the number of decimals of the field Decimals are only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT.
 java.lang.String getDefault()
          Returns the default value of this field
 java.lang.String getDescription()
          Returns a textual description for this field
 double getDouble()
          Returns the field's value as a double
 com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData()
          Returns the extended field meta data object
 int getInt()
          Returns the field's value as an int
 int getLength()
          Returns the length of this field
 long getLong()
          Returns the field's value as a long
 java.lang.String getName()
          Returns the name of this field
 int getOffset()
          Deprecated. Only used internally. This method might be removed or changed in the next release without notice
 short getShort()
          Returns the field's value as a short
 java.lang.String getString()
          Returns the field's value as a string
 JCO.Structure getStructure()
          Returns the field's value as a JCO.Structure object
 JCO.Table getTable()
          Returns the field's value as a JCO.Table object
 java.util.Date getTime()
          Returns the value of the i'th field as a Date object
 int getType()
          Returns the type of this field
 java.lang.String getTypeAsString()
          Returns the field's type as a string
 java.lang.Object getValue()
          Returns the field's value as an object
 boolean isActive()
          Checks whether this field is active
 boolean isExport()
          Checks whether this field is an export parameter
 boolean isImport()
          Checks whether this field is an import parameter
 boolean isInitialized()
          Checks whether this field has been initialized
 boolean isOptional()
          Checks whether this field is an optional parameter
 boolean isStructure()
          Checks whether this field is a structure parameter
 boolean isTable()
          Checks whether this field is a table parameter
 void setValue(byte[] value)
          Sets the specified byte array as the field's value
 void setValue(char value)
          Sets the specified character as the field's value.
 void setValue(double value)
          Sets the specified double as the field's value
 void setValue(int value)
          Sets the specified integer as the field's value
 void setValue(JCO.Structure value)
          Sets the specified structure as the field's value
 void setValue(JCO.Table value)
          Sets the specified table as the field's value
 void setValue(long value)
          Sets the specified long as the field's value
 void setValue(java.lang.Object value)
          Sets the specified object as the field's value
 void setValue(short value)
          Sets the specified short as the field's value
 void setValue(java.lang.String value)
          Sets the specified string as the field's value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isActive

public boolean isActive()
Checks whether this field is active
Returns:
true if the field is an activated parameter, false otherwise

isInitialized

public boolean isInitialized()
Checks whether this field has been initialized
Returns:
true if the field has been initialized, false otherwise

isOptional

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

isImport

public boolean isImport()
Checks whether this field is an import parameter
Returns:
true if the field is an import parameter, false otherwise

isExport

public boolean isExport()
Checks whether this field is an export parameter
Returns:
true if the field is an export parameter, false otherwise

isStructure

public boolean isStructure()
Checks whether this field is a structure parameter
Returns:
true if the field is a structure parameter, false otherwise

isTable

public boolean isTable()
Checks whether this field is a table parameter
Returns:
true if the field is a table parameter, false otherwise

getName

public java.lang.String getName()
Returns the name of this field
Returns:
the name of this field

getType

public int getType()
Returns the type of this field
Returns:
the field type

getOffset

public int getOffset()
Deprecated. Only used internally. This method might be removed or changed in the next release without notice

Returns the offset of this field
Returns:
the offset of the field

getLength

public int getLength()
Returns the length of this field
Returns:
the length of the field

getDecimals

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

getDefault

public java.lang.String getDefault()
Returns the default value of this field
Returns:
the field type

getDescription

public java.lang.String getDescription()
Returns a textual description for this field
Returns:
a text that describes the field or null if none available

getTypeAsString

public java.lang.String getTypeAsString()
Returns the field's type as a string
Returns:
the field's type as a string

getExtendedFieldMetaData

public com.sap.mw.jco.IExtendedFieldMetaData getExtendedFieldMetaData()
Returns the extended field meta data object
Returns:
the extended field meta data object or null if not available

getClassNameOfValue

public final java.lang.String getClassNameOfValue()
Returns the fully-qualified name of the Java class whose instances are manufactured if the method Field.getValue() is called to retrieve a value from a 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 java.lang.Object getValue()
Returns the field's value as an object
Returns:
the field's value as an object
Throws:
JCO.ConversionException - thrown if the value could not be converted to an Object

getString

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

getChar

public char getChar()
Returns the field's value as a character
Returns:
the field's value as a char
Throws:
JCO.ConversionException - thrown if the value could not be converted to a char
Since:
JCo 2.0

getShort

public short getShort()
Returns the field's value as a short
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()
Returns the field's value as an int
Returns:
the field's value as an int
Throws:
JCO.ConversionException - thrown if the value could not be converted to a int

getLong

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

getBigInteger

public java.math.BigInteger getBigInteger()
Returns the value of the i'th field as a BigInteger object
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()
Returns the field's value as a double
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()
Returns the value of the i'th field as a BigDecimal object
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()
Returns the value of the i'th field as a Date object
Returns:
the field's value as a Date object
Throws:
JCO.ConversionException - thrown if the value could not be converted to a Date

getTime

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

getByteArray

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

getBinaryStream

public java.io.InputStream getBinaryStream()
Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. an java.io.InputStream object
Returns:
the field's value as an java.io.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()
Returns the value of the i'th field as a stream of characeters, i.e. an java.io.Reader object
Returns:
the field's value as an java.io.Reader
Throws:
JCO.ConversionException - thrown if the value could not be converted to an java.io.Reader
Since:
JCo 2.0

getTable

public JCO.Table getTable()
Returns the field's value as a JCO.Table object
Returns:
the field's value as a table
Throws:
JCO.ConversionException - thrown if the value could not be converted to a JCO.Table

getStructure

public JCO.Structure getStructure()
Returns the field's value as a JCO.Structure object
Returns:
the field's value as a structure
Throws:
JCO.ConversionException - thrown if the value could not be converted to a JCO.Structure

setValue

public void setValue(java.lang.Object value)
Sets the specified object as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(java.lang.String value)
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 new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(char value)
Sets the specified character as the field's value.
Parameters:
value - the new value of this 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)
Sets the specified short as the field's value
Parameters:
value - the new value of this 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)
Sets the specified integer as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(long value)
Sets the specified long as the field's value
Parameters:
value - the new value of this 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)
Sets the specified double as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(byte[] value)
Sets the specified byte array as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(JCO.Structure value)
Sets the specified structure as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation

setValue

public void setValue(JCO.Table value)
Sets the specified table as the field's value
Parameters:
value - the new value of this field
Throws:
JCO.ConversionException - thrown if the value could not be converted to its internal representation