ariba.util.fieldvalue
Class FieldValue_JavaHashtable

java.lang.Object
  extended by ariba.util.core.ClassExtension
      extended by ariba.util.fieldvalue.FieldValue
          extended by ariba.util.fieldvalue.FieldValue_Object
              extended by ariba.util.fieldvalue.FieldValue_JavaHashtable
All Implemented Interfaces:
java.lang.Cloneable

public class FieldValue_JavaHashtable
extends FieldValue_Object

The JavaHashtableFieldValueClassExtension converts the behavior of java.util.Map so that using fieldValue accessors on them does not attempt to access the fields or methods of the Map itself, but will access the values stored in the Map. The fieldName in the FieldPath will be treated as a key into the receiver hashtable.


Field Summary
 
Fields inherited from class ariba.util.fieldvalue.FieldValue
Getter, Setter
 
Fields inherited from class ariba.util.core.ClassExtension
forClass
 
Constructor Summary
FieldValue_JavaHashtable()
           
 
Method Summary
 FieldValueAccessor createAccessor(java.lang.Object receiver, java.lang.String fieldName, int type)
          Overridden to disable.
 FieldValueAccessor getAccessor(java.lang.Object receiver, java.lang.String fieldName, int type)
          Overridden to disable.
 java.lang.Object getFieldValuePrimitive(java.lang.Object receiver, FieldPath fieldPath)
          Uses the fieldName of the first node of fieldPath as the key to the receiver (which MUST be a java.util.Map) to get the return value from the receiver.
 java.lang.Object getFieldValuePrimitive(java.lang.Object receiver, java.lang.String key)
          Uses the key to access the value in the receiver (which MUST be a java.util.Map).
 boolean hasFieldValuePrimitive(java.lang.Object receiver, java.lang.String key)
           
 void setFieldValue(java.lang.Object target, FieldPath fieldPath, java.lang.Object value)
          Recursively calls getFieldValuePrimitive() with the head of the fieldPath list up to the last fieldPath node and then calls setFieldValuePrimitive().
 void setFieldValuePrimitive(java.lang.Object receiver, FieldPath fieldPath, java.lang.Object value)
          Uses the fieldName of the first node of fieldPath as the key to the receiver (which MUST be a java.util.Map) to put the value into the receiver.
 void setFieldValuePrimitive(java.lang.Object receiver, java.lang.String key, java.lang.Object value)
          Uses the key to put the value into the receiver (which MUST be a java.util.Map).
 
Methods inherited from class ariba.util.fieldvalue.FieldValue_Object
getFieldValue, populateFieldInfo
 
Methods inherited from class ariba.util.fieldvalue.FieldValue
get, get, getFieldValue, registerClassExtension, setFieldValue
 
Methods inherited from class ariba.util.core.ClassExtension
clone, forClass, getRealClass, setForClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldValue_JavaHashtable

public FieldValue_JavaHashtable()
Method Detail

createAccessor

public FieldValueAccessor createAccessor(java.lang.Object receiver,
                                         java.lang.String fieldName,
                                         int type)
Overridden to disable. This throws an exception if called.

Overrides:
createAccessor in class FieldValue_Object
Parameters:
receiver - the object for which the accessor will be created
fieldName - the name of the field for which the accessor will be created
type - the type of accessor will be created (either FieldValue.Setter or FieldValue.Getter)
Returns:
a new FieldValueAccessor (ReflectionFieldValueAccessor by default)

getAccessor

public FieldValueAccessor getAccessor(java.lang.Object receiver,
                                      java.lang.String fieldName,
                                      int type)
Overridden to disable. This throws an exception if called.

Overrides:
getAccessor in class FieldValue_Object
Parameters:
receiver - the object for which the accessor will be looked up
fieldName - the name of the field for the accessor
type - the type of accessor will be created (either FieldValue.Setter or FieldValue.Getter)
Returns:
the cached FieldValueAccessor (ReflectionFieldValueAccessor by default)

setFieldValue

public void setFieldValue(java.lang.Object target,
                          FieldPath fieldPath,
                          java.lang.Object value)
Recursively calls getFieldValuePrimitive() with the head of the fieldPath list up to the last fieldPath node and then calls setFieldValuePrimitive(). Each time the recursion iterates, the receiver is the value of the previous getFieldValuePrimitive(). Unlike the base implementation, if a dotted path assigment is made to a missing property, the intermediate Map is created on-demand (i.e. a set to "a.b" where there is no "a" defined will create a map for a, then recurse.

Overrides:
setFieldValue in class FieldValue_Object
Parameters:
target - a java.util.Map into which the value will be put at key
fieldPath - the key used to put value into receiver (a java.util.Map)
value - the value to put into the receiver (a java.util.Map)

setFieldValuePrimitive

public void setFieldValuePrimitive(java.lang.Object receiver,
                                   FieldPath fieldPath,
                                   java.lang.Object value)
Uses the fieldName of the first node of fieldPath as the key to the receiver (which MUST be a java.util.Map) to put the value into the receiver.

Overrides:
setFieldValuePrimitive in class FieldValue_Object
Parameters:
receiver - a java.util.Map into which the value will be put at key
fieldPath - the key used to put value into receiver (a java.util.Map)
value - the value to put into the receiver (a java.util.Map)

getFieldValuePrimitive

public java.lang.Object getFieldValuePrimitive(java.lang.Object receiver,
                                               FieldPath fieldPath)
Uses the fieldName of the first node of fieldPath as the key to the receiver (which MUST be a java.util.Map) to get the return value from the receiver.

Overrides:
getFieldValuePrimitive in class FieldValue_Object
Parameters:
receiver - a java.util.Map from which to get the value
fieldPath - the key used to get the value from receiver (a java.util.Map)
Returns:
the value found in the reciever (a java.util.Map)

setFieldValuePrimitive

public void setFieldValuePrimitive(java.lang.Object receiver,
                                   java.lang.String key,
                                   java.lang.Object value)
Uses the key to put the value into the receiver (which MUST be a java.util.Map).

Parameters:
receiver - a java.util.Map into which the value will be put at key
key - the key used to put value into receiver (a java.util.Map)
value - the value to put into the receiver (a java.util.Map)

getFieldValuePrimitive

public java.lang.Object getFieldValuePrimitive(java.lang.Object receiver,
                                               java.lang.String key)
Uses the key to access the value in the receiver (which MUST be a java.util.Map).

Parameters:
receiver - a java.util.Map from which to get the value
key - the key used to get the value from receiver (a java.util.Map)
Returns:
the value found in the reciever (a java.util.Map)

hasFieldValuePrimitive

public boolean hasFieldValuePrimitive(java.lang.Object receiver,
                                      java.lang.String key)
Parameters:
receiver - a Map from which to get the value
key - the key used to get the value from receiver
Returns:
true if receiver has a a value for the given key and false otherwise; note that receiver may have a null value for the requested key


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.