|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.4) E13801-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OracleValue
A generic holder for the value of a property. A OracleValue
object can be used without knowing the actual property type (STRING
, DOUBLE
, BINARY
etc.).
Any implementation of this interface must adhere to the following behavior:
OracleValue
object can be read using type-specific get
methods. These methods are divided into two groups:
get
methods getString()
, getDate()
, getLong()
, getDouble()
and getBoolean()
.getStream()
.OracleValue
object has been read once using getStream()
, all subsequent calls to getStream()
will return the same Stream
object. This may mean, for example, that the stream returned is fully or partially consumed. In order to get a fresh stream the Value
object must be reacquired via OracleProperty.getValue()
or OracleProperty.getValues()
.OracleValue
object has been read once using getStream()
, any subsequent call to any of the non-stream get
methods will throw an IllegalStateException
. In order to successfully invoke a non-stream get
method, the Value
must be reacquired.OracleValue
object has been read once using a non-stream get method, any subsequent call to getStream()
will throw an IllegalStateException
. In order to successfully invoke getStream()
, the Value
must be reacquired.<p/> Two OracleValue
instances, v1
and v2
, are considered equal if and only if:
v1.getType() == v2.getType()
, and,v1.getString().equals(v2.getString())
Actually comparing two Value
instances by converting them to string form may not be practical in some cases (for example, if the values are very large binaries). Consequently, the above is intended as a normative definition of Value
equality but not as a procedural test of equality. It is assumed that implementations will have efficient means of determining equality that conform with the above definition.
Method Summary | |
---|---|
boolean |
getBoolean() Returns a Boolean representation of this value. |
java.util.Calendar |
getDate() Returns a Calendar representation of this value. |
double |
getDouble() Returns a double representation of this value. |
long |
getLong() Returns a long representation of this value. |
java.io.InputStream |
getStream() Returns an InputStream representation of this value. |
java.lang.String |
getString() Returns a String representation of this value. |
int |
getType() Returns the type of this Value . |
Method Detail |
---|
java.lang.String getString() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
String
representation of this value.
If this value cannot be converted to a string, a ValueFormatException
is thrown.
If getStream
has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getString
.
A RepositoryException
is thrown if another error occurs.
getString
in interface javax.jcr.Value
String
representation of the value of this property.javax.jcr.ValueFormatException
- if conversion to a String
is not possible.java.lang.IllegalStateException
- if getStream
has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.java.io.InputStream getStream() throws java.lang.IllegalStateException, javax.jcr.RepositoryException
InputStream
representation of this value. Uses the standard conversion to binary (see JCR specification)
If a non-stream get
method has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getStream
.
A RepositoryException
is thrown if another error occurs.
getStream
in interface javax.jcr.Value
InputStream
representation of this value.java.lang.IllegalStateException
- if a non-stream get
method has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.long getLong() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
long
representation of this value.
If this value cannot be converted to a long
, a ValueFormatException
is thrown.
If getStream
has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getLong
.
A RepositoryException
is thrown if another error occurs.
getLong
in interface javax.jcr.Value
long
representation of this value.javax.jcr.ValueFormatException
- if conversion to an long
is not possible.java.lang.IllegalStateException
- if getStream
has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.double getDouble() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
double
representation of this value.
If this value cannot be converted to a double
, a ValueFormatException
is thrown.
If getStream
has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getDouble
.
A RepositoryException
is thrown if another error occurs.
getDouble
in interface javax.jcr.Value
double
representation of this value.javax.jcr.ValueFormatException
- if conversion to a double
is not possible.java.lang.IllegalStateException
- if getStream
has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.java.util.Calendar getDate() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
Calendar
representation of this value.
The object returned is a copy of the stored value, so changes to it are not reflected in internal storage.
If this value cannot be converted to a Calendar
, a ValueFormatException
is thrown.
If getStream
has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getDate
.
A RepositoryException
is thrown if another error occurs.
getDate
in interface javax.jcr.Value
Calendar
representation of this value.javax.jcr.ValueFormatException
- if conversion to a Calendar
is not possible.java.lang.IllegalStateException
- if getStream
has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.boolean getBoolean() throws javax.jcr.ValueFormatException, java.lang.IllegalStateException, javax.jcr.RepositoryException
Boolean
representation of this value.
If this value cannot be converted to a Boolean
, a ValueFormatException
is thrown.
If getStream
has previously been called on this Value
instance, an IllegalStateException
is thrown. In this case a new Value
instance must be acquired in order to successfully call getBoolean
.
A RepositoryException
is thrown if another error occurs.
getBoolean
in interface javax.jcr.Value
Boolean
representation of this value.javax.jcr.ValueFormatException
- if conversion to a Boolean
is not possible.java.lang.IllegalStateException
- if getStream
has previously been called on this Value
instance.javax.jcr.RepositoryException
- if another error occurs.int getType()
type
of this Value
. One of:
PropertyType.STRING
PropertyType.DATE
PropertyType.BINARY
PropertyType.DOUBLE
PropertyType.LONG
PropertyType.BOOLEAN
PropertyType.NAME
PropertyType.PATH
PropertyType.REFERENCE
javax.jcr.PropertyType
.
The type returned is that which was set at property creation.
getType
in interface javax.jcr.Value
|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.4) E13801-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |