Package play.data.binding
Class ParamNode
- java.lang.Object
-
- play.data.binding.ParamNode
-
- Direct Known Subclasses:
RootParamNode
public class ParamNode extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParamNode.RemovedNode
-
Constructor Summary
Constructors Constructor Description ParamNode(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(ParamNode child)static RootParamNodeconvert(java.util.Map<java.lang.String,java.lang.String[]> params)java.util.Collection<ParamNode>getAllChildren()java.util.Set<java.lang.String>getAllChildrenKeys()ParamNodegetChild(java.lang.String name)ParamNodegetChild(java.lang.String name, boolean returnEmptyChildIfNotFound)java.lang.StringgetFirstValue(java.lang.Class<?> type)java.lang.StringgetName()java.lang.StringgetOriginalKey()java.lang.String[]getValues()booleanremoveChild(java.lang.String name, java.util.List<ParamNode.RemovedNode> removedNodesList)Removes a child from this node, but stores what is removed to list.static voidrestoreRemovedChildren(java.util.List<ParamNode.RemovedNode> removedNodesList)voidsetValue(java.lang.String[] value, java.lang.String originalKey)
-
-
-
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)
-
-