|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
org.exoplatform.services.jcr.rmi.api.value.BinaryValue
public class BinaryValue
The BinaryValue class implements the committed value state for Binary values as a
part of the State design pattern (Gof) used by this package.
NOTE: This class forwards the InputStream from which it was created through the
getStream() method but does not close the stream. It is the sole responsibility of the
user of this value to close the stream if not needed anymore to prevent memory loss.
This class implements readObject(ObjectInputStream) and
writeObject(ObjectOutputStream) methods to (de-)serialize the data.
SerialValue,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue |
|---|
orderNumber |
| Constructor Summary | |
|---|---|
protected |
BinaryValue(java.io.InputStream stream)
Creates an instance on the given InputStream. |
protected |
BinaryValue(java.lang.String value)
Creates an instance providing the UTF-8 representation of the given string value. |
| Method Summary | |
|---|---|
boolean |
getBoolean()
Always throws IllegalStateException because only an InputStream is
available from this implementation. |
java.util.Calendar |
getDate()
Always throws IllegalStateException because only an InputStream is
available from this implementation. |
double |
getDouble()
Always throws IllegalStateException because only an InputStream is
available from this implementation. |
long |
getLength()
|
long |
getLong()
Always throws IllegalStateException because only an InputStream is
available from this implementation. |
int |
getOrderNumber()
|
java.lang.String |
getReference()
|
java.io.InputStream |
getStream()
Returns the InputStream from which this instance has been created. |
java.lang.String |
getString()
Always throws IllegalStateException because only an InputStream is
available from this implementation. |
int |
getType()
Returns PropertyType.BINARY. |
void |
setOrderNumber(int arg0)
|
protected static java.io.InputStream |
toStream(java.lang.String value)
Helper method to convert a string value into an InputStream from which the UTF-8
representation can be read. |
| Methods inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue |
|---|
getValueFormatException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected BinaryValue(java.io.InputStream stream)
InputStream. This exact stream will be provided
by the getStream(), thus care must be taken to not inadvertendly read or close the
stream.
stream - The InputStream providing the value.
protected BinaryValue(java.lang.String value)
throws javax.jcr.ValueFormatException
value - The string whose UTF-8 representation is provided as the value of this instance.
javax.jcr.ValueFormatException - If the platform does not support UTF-8 encoding (which is unlikely as UTF-8 is
required to be available on all platforms).| Method Detail |
|---|
protected static java.io.InputStream toStream(java.lang.String value)
throws javax.jcr.ValueFormatException
InputStream from which the UTF-8
representation can be read.
value - The string value to be made available through a stream.
InputStream from which the UTF-8 representation of the
value may be read.
javax.jcr.ValueFormatException - If the platform does not support UTF-8 encoding (which is unlikely as UTF-8 is
required to be available on all platforms).public java.io.InputStream getStream()
InputStream from which this instance has been created.
getStream in interface javax.jcr.ValuegetStream in class BaseNonStreamValuepublic int getType()
PropertyType.BINARY.
public java.lang.String getString()
throws java.lang.IllegalStateException
IllegalStateException because only an InputStream is
available from this implementation.
java.lang.IllegalStateException - as defined above.
public long getLong()
throws java.lang.IllegalStateException
IllegalStateException because only an InputStream is
available from this implementation.
getLong in interface javax.jcr.ValuegetLong in class BaseNonStreamValuejava.lang.IllegalStateException - as defined above.
public double getDouble()
throws java.lang.IllegalStateException
IllegalStateException because only an InputStream is
available from this implementation.
getDouble in interface javax.jcr.ValuegetDouble in class BaseNonStreamValuejava.lang.IllegalStateException - as defined above.
public java.util.Calendar getDate()
throws java.lang.IllegalStateException
IllegalStateException because only an InputStream is
available from this implementation.
getDate in interface javax.jcr.ValuegetDate in class BaseNonStreamValuejava.lang.IllegalStateException - as defined above.
public boolean getBoolean()
throws java.lang.IllegalStateException
IllegalStateException because only an InputStream is
available from this implementation.
getBoolean in interface javax.jcr.ValuegetBoolean in class BaseNonStreamValuejava.lang.IllegalStateException - as defined above.public long getLength()
public int getOrderNumber()
getOrderNumber in interface ExtendedValuegetOrderNumber in class BaseNonStreamValue
public java.lang.String getReference()
throws javax.jcr.ValueFormatException,
java.lang.IllegalStateException,
javax.jcr.RepositoryException
getReference in interface ExtendedValuegetReference in class BaseNonStreamValuejavax.jcr.ValueFormatException - , IllegalStateException, RepositoryException
java.lang.IllegalStateException
javax.jcr.RepositoryExceptionpublic void setOrderNumber(int arg0)
setOrderNumber in interface ExtendedValuesetOrderNumber in class BaseNonStreamValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||