Business Components

oracle.jbo.domain
Class Char

java.lang.Object
  |
  +--oracle.sql.Datum
        |
        +--oracle.sql.CHAR
              |
              +--oracle.jbo.domain.Char

public class Char
extends oracle.sql.CHAR
implements DomainInterface, KeyAttributeInterface, oracle.sql.CustomDatum, java.io.Serializable

This class provides a lightweight wrapper for oracle.sql.CHAR, the Java representation of the CHAR database type. This wrapper allows an instance of the oracle.sql.CHAR to be used as an immutable Domain object.

The intent of many of the methods in this class is to wrap the corresponding method in the oracle.sql class such that it returns an instance of an oracle.jbo.domain.* object.

The oracle.jbo.domain.CHAR class is the Java representation of the underlying database type that you must use if you want to exploit the domain feature of Business Components for Java.

Since:
JDeveloper 3.0
See Also:
Serialized Form

Fields inherited from class oracle.sql.CHAR
DEFAULT_CHARSET
 
Constructor Summary
Char()
          Creates a Char Domain object representing the null string.
Char(byte[] val, oracle.sql.CharacterSet charset)
          Creates a Char Domain object from a byte array representing a string of a given character set.
Char(byte[] val, int p1, int p2, oracle.sql.CharacterSet charset)
          Internal: Applications should not invoke this method.
Char(Char val)
          Creates a Char identical to an existing Char.
Char(oracle.sql.CHAR val)
          Creates a Char Domain object from a SQL CHAR.
Char(java.lang.Object val)
          Creates a Char Domain object from an Object.
Char(java.lang.Object val, oracle.sql.CharacterSet charset)
          Creates a Char Domain object from an Object interpreted as a string of a given character set.
Char(java.lang.String val)
          Creates a Char Domain object from a String.
Char(java.lang.String val, oracle.sql.CharacterSet charset)
          Creates a Char Domain object from a String interpreted as a string of a given character set.
 
Method Summary
 java.math.BigDecimal bigDecimalValue()
          Calls CHAR.bigDecimalValue() to convert this object into a Java BigDecimal.
 java.math.BigInteger bigIntegerValue()
          Converts this data object into a BigInteger.
 boolean booleanValue()
          Converts this data object into a boolean.
 double doubleValue()
          Converts this data object into a double.
 boolean equals(java.lang.Object other)
          Tests this for equality with another object.
 float floatValue()
          Converts this data object into a float.
static oracle.sql.CustomDatumFactory getCustomDatumFactory()
          Internal: Applications should not invoke this method.
 java.lang.Object getData()
          Internal: Applications should not use this method.
 int hashCode()
          Computes a hash code for this CharDomain object.
 int intValue()
          Convert this data object into a int.
 boolean isConvertibleTo(java.lang.Class jClass)
          Tests whether this data object can be converted to the specified Java data type.
 long longValue()
          Converts this data object into a long.
static void main(java.lang.String[] argv)
          Internal: Applications should not invoke this method.
 void setContext(DomainOwnerInterface owner, Transaction trans, java.lang.Object ctx)
          Internal: Applications should not use this method.
 oracle.sql.Datum toDatum(oracle.jdbc.driver.OracleConnection conn)
          Internal: Applications should not invoke this method.
 
Methods inherited from class oracle.sql.CHAR
asciiStreamValue, binaryStreamValue, byteValue, characterStreamValue, dateValue, getCharacterSet, getString, getStringWithReplacement, makeJdbcArray, stringValue, timestampValue, timeValue, toJdbc, toString
 
Methods inherited from class oracle.sql.Datum
compareBytes, getBytes, getLength, getStream, setBytes, setShareBytes, shareBytes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Char

public Char()
     throws java.sql.SQLException
Creates a Char Domain object representing the null string.

This constructor does not create a null object: use one of the NullValue objects to indicate null.

Throws:
SQLException - if the empty string is not defined as a character in DEFAULT_CHARSET.

Char

public Char(Char val)
     throws java.sql.SQLException
Creates a Char identical to an existing Char.
Parameters:
value - a Char Domain object.
Throws:
java.sql.SQLException - never.

Char

public Char(oracle.sql.CHAR val)
     throws java.sql.SQLException
Creates a Char Domain object from a SQL CHAR.
Parameters:
value - a CHAR SQL object.
Throws:
java.sql.SQLException - never.

Char

public Char(java.lang.String val)
     throws java.sql.SQLException
Creates a Char Domain object from a String.
Parameters:
val - A unicode string interpreted as a DEFAULT_CHARSET string.
Throws:
SQLException - if val does not represent a character.

Char

public Char(java.lang.Object val)
     throws java.sql.SQLException
Creates a Char Domain object from an Object.
Parameters:
val - An object that will be converted using toString() into a DEFAULT_CHARSET string.
Throws:
SQLException - if the string does not represent a character.

Char

public Char(byte[] val,
            oracle.sql.CharacterSet charset)

Creates a Char Domain object from a byte array representing a string of a given character set.

No validation is performed.

Parameters:
val - A byte array representing a charset string.
charset - An Oracle character set.

Char

public Char(byte[] val,
            int p1,
            int p2,
            oracle.sql.CharacterSet charset)
Internal: Applications should not invoke this method.

Creates a Char Domain object from a range of a byte array representing a string of a given character set.

No validation is performed.

Parameters:
val - A byte array representing a charset string.
p1 - The index of the first byte in the range.
p2 - The number of bytes in the range.
charset - An Oracle character set.

Char

public Char(java.lang.String val,
            oracle.sql.CharacterSet charset)
     throws java.sql.SQLException
Creates a Char Domain object from a String interpreted as a string of a given character set.
Parameters:
val - A unicode string interpreted as a charset string.
charset - An Oracle character set.
Throws:
SQLException - if val does not represent a character.

Char

public Char(java.lang.Object val,
            oracle.sql.CharacterSet charset)
     throws java.sql.SQLException
Creates a Char Domain object from an Object interpreted as a string of a given character set.
Parameters:
val - An object that will be converted using toString() into a charset string.
charset - An Oracle character set.
Throws:
SQLException - if the string does not represent a character.
Method Detail

getCustomDatumFactory

public static oracle.sql.CustomDatumFactory getCustomDatumFactory()
Internal: Applications should not invoke this method.

Initializes the Char Domain.

This method is invoked when Business Components for Java is initialized. Applications should not call this method directly.

Returns:
the CustomDatumFactory for the Char Domain.

toDatum

public oracle.sql.Datum toDatum(oracle.jdbc.driver.OracleConnection conn)
                         throws java.sql.SQLException
Internal: Applications should not invoke this method.

Converts this Char Domain object back into an SQL CHAR object.

Specified by:
toDatum in interface oracle.sql.CustomDatum
Returns:
A Datum containing CHAR object.
Throws:
SQLException. -  

getData

public java.lang.Object getData()
Internal: Applications should not use this method.

Converts this to a String.

Specified by:
getData in interface DomainInterface
Returns:
A String converted to a String. Only the data of this is converted; the Domain type is ignored.

setContext

public void setContext(DomainOwnerInterface owner,
                       Transaction trans,
                       java.lang.Object ctx)
Internal: Applications should not use this method.
Specified by:
setContext in interface DomainInterface

hashCode

public int hashCode()
Computes a hash code for this CharDomain object. The Domain type is ignored.
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this CharDomain object.

equals

public boolean equals(java.lang.Object other)
Tests this for equality with another object.
Overrides:
equals in class oracle.sql.CHAR
Parameters:
other - An arbitrary Object.
Returns:
true if conversion was successful and the converted argument is identical to this.

main

public static void main(java.lang.String[] argv)
                 throws java.sql.SQLException
Internal: Applications should not invoke this method.

For testing purposes only.


isConvertibleTo

public boolean isConvertibleTo(java.lang.Class jClass)
Tests whether this data object can be converted to the specified Java data type.
Overrides:
isConvertibleTo in class oracle.sql.CHAR
Parameters:
jClass - specifies the Java data type to test against.
Returns:
true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.

intValue

public int intValue()
Convert this data object into a int.
Overrides:
intValue in class oracle.sql.CHAR
Returns:
the data value in int representation.

longValue

public long longValue()
Converts this data object into a long.
Overrides:
longValue in class oracle.sql.CHAR
Returns:
the data value in long representation.

floatValue

public float floatValue()
Converts this data object into a float.
Overrides:
floatValue in class oracle.sql.CHAR
Returns:
the data value in float representation.

doubleValue

public double doubleValue()
Converts this data object into a double.
Overrides:
doubleValue in class oracle.sql.CHAR
Returns:
the data value in double representation.

bigIntegerValue

public java.math.BigInteger bigIntegerValue()
Converts this data object into a BigInteger.
Returns:
the data value in BigInteger representation.

booleanValue

public boolean booleanValue()
Converts this data object into a boolean.
Overrides:
booleanValue in class oracle.sql.CHAR
Returns:
the data value in boolean representation.

bigDecimalValue

public java.math.BigDecimal bigDecimalValue()
Calls CHAR.bigDecimalValue() to convert this object into a Java BigDecimal.
Overrides:
bigDecimalValue in class oracle.sql.CHAR
Returns:
a Java BigDecimal value

Business Components