|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.rmi.value.NameValue
public class NameValue
The NameValue
class implements the committed value state for
Name values as a part of the State design pattern (Gof) used by this package.
Constructor Summary | |
---|---|
protected |
NameValue(java.lang.String value)
Creates an instance for the given name value . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
Compares values as defined in the JCR specification. |
javax.jcr.Binary |
getBinary()
Returns the binary representation of this value. |
boolean |
getBoolean()
Always throws a ValueFormatException . |
java.util.Calendar |
getDate()
Always throws a ValueFormatException . |
java.math.BigDecimal |
getDecimal()
Always throws a ValueFormatException . |
double |
getDouble()
Always throws a ValueFormatException . |
long |
getLong()
Always throws a ValueFormatException . |
java.io.InputStream |
getStream()
Returns the stream representation of this value. |
java.lang.String |
getString()
Returns the string representation of the Name value. |
int |
getType()
Returns PropertyType.NAME . |
protected javax.jcr.ValueFormatException |
getValueFormatException(java.lang.String destType)
Returns a ValueFormatException with a message indicating
what kind of type conversion is not supported. |
int |
hashCode()
Returns a hash code that's in line with how the equals(Object)
method is implemented. |
java.lang.String |
toString()
Returns a string representation of this value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected NameValue(java.lang.String value) throws javax.jcr.ValueFormatException
value
.
javax.jcr.ValueFormatException
Method Detail |
---|
public int getType()
PropertyType.NAME
.
public java.lang.String getString() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public final java.io.InputStream getStream() throws javax.jcr.RepositoryException
Binary
instance
returned by getBinary()
.
getStream
in interface javax.jcr.Value
javax.jcr.RepositoryException
- if the stream can not be createdpublic javax.jcr.Binary getBinary() throws javax.jcr.RepositoryException
Value.getString()
. Subclasses
getBinary
in interface javax.jcr.Value
javax.jcr.RepositoryException
public boolean getBoolean() throws javax.jcr.ValueFormatException
ValueFormatException
. Implementations should
overwrite if conversion to boolean is supported.
getBoolean
in interface javax.jcr.Value
javax.jcr.ValueFormatException
- If the value cannot be converted to a
boolean.public java.util.Calendar getDate() throws javax.jcr.ValueFormatException
ValueFormatException
. Implementations should
overwrite if conversion to Calender
is supported.
getDate
in interface javax.jcr.Value
javax.jcr.ValueFormatException
- If the value cannot be converted to a
Calendar
instance.public java.math.BigDecimal getDecimal() throws javax.jcr.RepositoryException
ValueFormatException
. Implementations should
overwrite if conversion to a BigDecimal
is supported.
getDecimal
in interface javax.jcr.Value
javax.jcr.ValueFormatException
- If the value cannot be converted to a
BigDecimal
.
javax.jcr.RepositoryException
public double getDouble() throws javax.jcr.ValueFormatException
ValueFormatException
. Implementations should
overwrite if conversion to double is supported.
getDouble
in interface javax.jcr.Value
javax.jcr.ValueFormatException
- If the value cannot be converted to a
double.public long getLong() throws javax.jcr.ValueFormatException
ValueFormatException
. Implementations should
overwrite if conversion to long is supported.
getLong
in interface javax.jcr.Value
javax.jcr.ValueFormatException
- If the value cannot be converted to a
long.protected javax.jcr.ValueFormatException getValueFormatException(java.lang.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.
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- value for comparison
true
if the values are equal,
false
otherwisepublic int hashCode()
equals(Object)
method is implemented.
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |