Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.jdeveloper.audit.service
Class ValueHandle

java.lang.Object
  extended by oracle.jdeveloper.audit.service.ValueHandle

All Implemented Interfaces:
java.lang.Comparable<ValueHandle>

public class ValueHandle
extends java.lang.Object
implements java.lang.Comparable<ValueHandle>

A handle to a named serializable value (e.g., the value of a JavaBeans property). A value handle supplies both a value and an serializable representation of that value, and can be created from either a value or a representation. The representation does not describe the type of a value; the type must be explicitly supplied when the value is needed (see getValue(java.lang.Class )).

A representation is one of three things:

  1. null, the value is null;
  2. String, the value can be created from the String by a registered Converter; or
  3. Collection<ValueHandle>, the value can be created from the collection by invoking a default constructor and setting the properties of the object to the matching named values in the collection.

The implementations of the equals(java.lang.Object), hashCode(), and compareTo(oracle.jdeveloper.audit.service.ValueHandle) methods use only the name; they ignore both value and representation.


Constructor Summary
ValueHandle(java.lang.String name, java.lang.Object representation, java.lang.Object value)
          Creates a value handle from a representation and/or a value.

 

Method Summary
 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.Class<?> type)
          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.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ValueHandle

public ValueHandle(java.lang.String name,
                   java.lang.Object representation,
                   java.lang.Object value)
Creates a value handle from a representation and/or a value. If both the representation and value are null, the value is null. If only one is null, the other will be computed on demand.
Parameters:
name - The name of the value.
representation - The possibly null representation.
value - The possibly null value.

Method Detail

getName

public java.lang.String getName()
Gets the name of the value.

getRepresentation

public java.lang.Object getRepresentation()
Gets the externalizable representation of the value. The representation, once determined, is cached.
Throws:
java.lang.Exception - if the representation has not been determined and the necessary reflection and/or conversion fails.

isTrue

public boolean isTrue()
Gets whether the value is Boolean.TRUE.

getValueForProperty

public java.lang.Object getValueForProperty(java.lang.Class<?> type)
                                     throws java.lang.Exception
Gets the value. The value, once determined, is cached.
Parameters:
type - the type from which to introspect the type of the value.
Throws:
java.lang.Exception - if reflection and/or conversion fails.

getValue

public java.lang.Object getValue(java.lang.Class<?> type)
                          throws java.lang.Exception
Gets the value. The value, once determined, is cached.
Parameters:
type - the expected type of the value.
Throws:
java.lang.Exception - if reflection and/or conversion fails.

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(ValueHandle that)
Specified by:
compareTo in interface java.lang.Comparable<ValueHandle>

valueEquals

public static boolean valueEquals(ValueHandle left,
                                  ValueHandle right)
Gets whether two handles represent the same value. Without an externally supplied value type, actual values are compared only if one of the handles is already carrying a value; otherwise, representations are compared.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.