play.data.binding
Class ParamNode

java.lang.Object
  extended by play.data.binding.ParamNode
Direct Known Subclasses:
RootParamNode

public class ParamNode
extends java.lang.Object


Nested Class Summary
static class ParamNode.RemovedNode
           
 
Constructor Summary
ParamNode(java.lang.String name)
           
 
Method Summary
 void addChild(ParamNode child)
           
static RootParamNode convert(java.util.Map<java.lang.String,java.lang.String[]> params)
           
 java.util.Collection<ParamNode> getAllChildren()
           
 java.util.Set<java.lang.String> getAllChildrenKeys()
           
 ParamNode getChild(java.lang.String name)
           
 ParamNode getChild(java.lang.String name, boolean returnEmptyChildIfNotFound)
           
 java.lang.String getFirstValue(java.lang.Class<?> type)
           
 java.lang.String getName()
           
 java.lang.String getOriginalKey()
           
 java.lang.String[] getValues()
           
 boolean removeChild(java.lang.String name, java.util.List<ParamNode.RemovedNode> removedNodesList)
          Removes a child from this node, but stores what is removed to list.
static void restoreRemovedChildren(java.util.List<ParamNode.RemovedNode> removedNodesList)
           
 void setValue(java.lang.String[] value, java.lang.String originalKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamNode

public ParamNode(java.lang.String name)
Method Detail

getName

public java.lang.String getName()

getValues

public java.lang.String[] getValues()

getFirstValue

public java.lang.String getFirstValue(java.lang.Class<?> type)

addChild

public void addChild(ParamNode child)

getChild

public ParamNode getChild(java.lang.String name)

getChild

public ParamNode getChild(java.lang.String name,
                          boolean returnEmptyChildIfNotFound)

removeChild

public boolean removeChild(java.lang.String name,
                           java.util.List<ParamNode.RemovedNode> removedNodesList)
Removes a child from this node, but stores what is removed to list. The we can later call which will add it back again. This is a "hack" related to #1195 which makes it possible to reuse the RootParamsNode-structure if you want to perform the bind-operation multiple times.

Parameters:
name - the name of the child-node in this paramNode which should be removed.
removedNodesList - a list where info about what is removed where is stored.
Returns:
true if anything was removed.

restoreRemovedChildren

public static void restoreRemovedChildren(java.util.List<ParamNode.RemovedNode> removedNodesList)

getAllChildren

public java.util.Collection<ParamNode> getAllChildren()

getAllChildrenKeys

public java.util.Set<java.lang.String> getAllChildrenKeys()

setValue

public void setValue(java.lang.String[] value,
                     java.lang.String originalKey)

getOriginalKey

public java.lang.String getOriginalKey()

convert

public static RootParamNode convert(java.util.Map<java.lang.String,java.lang.String[]> params)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly