public class ValueHandle extends java.lang.Object implements java.lang.Comparable<ValueHandle>
getValue(Class)
).
A representation is one of three things:
Converter
; or
The implementations of the equals(Object)
, hashCode()
, and
compareTo(ValueHandle)
methods use only the name
;
they ignore both value and representation.
Constructor and Description |
---|
ValueHandle(java.lang.String name,
java.lang.Object representation,
java.lang.Object value)
Creates a value handle from a representation and/or a value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ValueHandle that) |
boolean |
equals(java.lang.Object object) |
java.lang.String |
getName()
Gets the name of the value.
|
java.lang.Object |
getRepresentation()
Gets the externalizable representation of the value.
|
java.lang.Object |
getValue(java.lang.Class<?> type)
Gets the value.
|
java.lang.Object |
getValueForProperty(java.lang.Object bean)
Gets the value.
|
int |
hashCode() |
boolean |
isTrue()
Gets whether the value is Boolean.TRUE.
|
java.lang.String |
toString() |
static boolean |
valueEquals(ValueHandle left,
ValueHandle right)
Gets whether two handles represent the same value.
|
public ValueHandle(java.lang.String name, java.lang.Object representation, java.lang.Object value)
name
- The name of the value.representation
- The possibly null representation.value
- The possibly null value.public java.lang.String getName()
public java.lang.Object getRepresentation()
java.lang.Exception
- if the representation has not been determined and the
necessary reflection and/or conversion fails.public boolean isTrue()
public java.lang.Object getValueForProperty(java.lang.Object bean) throws java.lang.Exception
bean
- the bean from which to introspect the type of the value.java.lang.Exception
- if reflection and/or conversion fails.public java.lang.Object getValue(java.lang.Class<?> type) throws java.lang.Exception
type
- the expected type of the value.java.lang.Exception
- if reflection and/or conversion fails.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(ValueHandle that)
compareTo
in interface java.lang.Comparable<ValueHandle>
public static boolean valueEquals(ValueHandle left, ValueHandle right)
public java.lang.String toString()
toString
in class java.lang.Object