org.loom.binding
Class SetNode

java.lang.Object
  extended by org.loom.binding.Node
      extended by org.loom.binding.SetNode

public class SetNode
extends Node

Node that corresponds with a Set property. Set properties cannot be traversed. Since there is no way to identify a concrete node inside a Set, property paths like child.friends[1].name are not allowed if friends is a Set (since there is no way to use the index in any meaningful way). Sets can be used to identify "bags of things", provided that these are simple objects (Strings, Integers, etc) and are tipically handled by inputCheckbox tags.


Constructor Summary
SetNode()
           
 
Method Summary
protected  void applyValidationImpl(java.lang.Object container, ValidationRequest request)
          Applies a validation.
 java.lang.Object getValue(java.lang.Object container, java.lang.String[] propertyPath, int propertyIndex)
          Gets the value of the property at the end of this chain
 void setChild(Node child)
           
 void setPropertyWrapper(PropertyWrapper wrapper)
           
 void setValue(java.lang.Object container, java.lang.Object value, java.lang.String[] propertyPath, int index)
          Sets a value to the property at the end of this chain
 
Methods inherited from class org.loom.binding.Node
applyValidation, getChild, getIndex, getIndexAsInt, getNextNodeClass, getPropertyName, getPropertyWrapper, isLeaf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetNode

public SetNode()
Method Detail

setValue

public void setValue(java.lang.Object container,
                     java.lang.Object value,
                     java.lang.String[] propertyPath,
                     int index)
Description copied from class: Node
Sets a value to the property at the end of this chain

Specified by:
setValue in class Node
Parameters:
container - The current property node (starts at the root of the chain)
value - the value to assign
index - the current index inside the property chain

getValue

public java.lang.Object getValue(java.lang.Object container,
                                 java.lang.String[] propertyPath,
                                 int propertyIndex)
Description copied from class: Node
Gets the value of the property at the end of this chain

Specified by:
getValue in class Node
Parameters:
container - The current property node (starts at the root of the chain)
propertyPath - the full path to the requested property
propertyIndex - the current index inside the property chain
Returns:
the value at the end of this chain, may be null

applyValidationImpl

protected void applyValidationImpl(java.lang.Object container,
                                   ValidationRequest request)
Description copied from class: Node
Applies a validation. If there is more than one value involved in this validation (i.e. lists, maps, or arrays), validates every node.

Specified by:
applyValidationImpl in class Node
Parameters:
container - the container where to apply this validation. It cannot be null.
request - the validation to be performed

setPropertyWrapper

public void setPropertyWrapper(PropertyWrapper wrapper)
Overrides:
setPropertyWrapper in class Node
Parameters:
wrapper - the propertyWrapper of this field.

setChild

public void setChild(Node child)
Overrides:
setChild in class Node