|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.rmi.value.BaseNonStreamValue
public abstract class BaseNonStreamValue
The BaseNonStreamValue class implements the basic committed
value state for non-stream values as a part of the State design pattern (Gof)
used by this package.
This class implements all methods of the
org.apache.jackrabbit.rmi.value.StatefullValue except
getString and getType interface by always
throwing an appropriate exception. Extensions of this class should overwrite
methods as appropriate except for the getStream() which must throw
an IllegalStateException for this line of committed non-stream
states.
| Constructor Summary | |
|---|---|
protected |
BaseNonStreamValue()
Default constructor with no special tasks. |
| Method Summary | |
|---|---|
boolean |
getBoolean()
Always throws a ValueFormatException. |
Calendar |
getDate()
Always throws a ValueFormatException. |
double |
getDouble()
Always throws a ValueFormatException. |
long |
getLong()
Always throws a ValueFormatException. |
InputStream |
getStream()
Always throws IllegalStateException because only non-stream
getters are available from this implementation. |
protected ValueFormatException |
getValueFormatException(String destType)
Returns a ValueFormatException with a message indicating
what kind of type conversion is not supported. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jcr.Value |
|---|
getString, getType |
| Constructor Detail |
|---|
protected BaseNonStreamValue()
| Method Detail |
|---|
public final InputStream getStream()
throws IllegalStateException
IllegalStateException because only non-stream
getters are available from this implementation.
This method is declared final to mark that this line of implementations
does not provide access to InputStreams.
getStream in interface ValueIllegalStateException - as defined above.
public boolean getBoolean()
throws ValueFormatException
ValueFormatException. Implementations should
overwrite if conversion to boolean is supported.
getBoolean in interface ValueValueFormatException - If the value cannot be converted to a
boolean.
public Calendar getDate()
throws ValueFormatException
ValueFormatException. Implementations should
overwrite if conversion to Calender is supported.
getDate in interface ValueValueFormatException - If the value cannot be converted to a
Calendar instance.
public double getDouble()
throws ValueFormatException
ValueFormatException. Implementations should
overwrite if conversion to double is supported.
getDouble in interface ValueValueFormatException - If the value cannot be converted to a
double.
public long getLong()
throws ValueFormatException
ValueFormatException. Implementations should
overwrite if conversion to long is supported.
getLong in interface ValueValueFormatException - If the value cannot be converted to a
long.protected ValueFormatException getValueFormatException(String destType)
ValueFormatException with a message indicating
what kind of type conversion is not supported.
destType - The name of the value type to which this value cannot
be converted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||