org.picocontainer.script.groovy.nodes
Class ConfigNode

java.lang.Object
  extended by org.picocontainer.script.groovy.nodes.AbstractBuilderNode
      extended by org.picocontainer.script.groovy.nodes.ConfigNode
All Implemented Interfaces:
Serializable, BuilderNode

public class ConfigNode
extends AbstractBuilderNode

Config node adds configuration entry to mutable pico container. It requires two named parameters: key and value. Example usage

 config(key:'foo',value:'bar')
 

Author:
k.pribluda
See Also:
Serialized Form

Field Summary
static String KEY
          attribute name for key attribute ( Required )
static String NODE_NAME
           
static String VALUE
          attribute name for value attribute ( Required )
 
Constructor Summary
ConfigNode()
           
 
Method Summary
 Object createNewNode(Object current, Map<String,Object> attributes)
          Creates a new node .
 void validateScriptedAttributes(Map<String,Object> specifiedAttributes)
          ansure that node has proper attributes
 
Methods inherited from class org.picocontainer.script.groovy.nodes.AbstractBuilderNode
addAttribute, getNodeName, getSupportedAttributeNames, isAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_NAME

public static final String NODE_NAME
See Also:
Constant Field Values

KEY

public static final String KEY
attribute name for key attribute ( Required )

See Also:
Constant Field Values

VALUE

public static final String VALUE
attribute name for value attribute ( Required )

See Also:
Constant Field Values
Constructor Detail

ConfigNode

public ConfigNode()
Method Detail

createNewNode

public Object createNewNode(Object current,
                            Map<String,Object> attributes)
Description copied from interface: BuilderNode
Creates a new node .

Parameters:
current - the current Object - may be null for no parent container.
attributes - the Map of scripted attributes for the builder node - may be null
Returns:
The newly created node

validateScriptedAttributes

public void validateScriptedAttributes(Map<String,Object> specifiedAttributes)
                                throws ScriptedPicoContainerMarkupException
ansure that node has proper attributes

Specified by:
validateScriptedAttributes in interface BuilderNode
Overrides:
validateScriptedAttributes in class AbstractBuilderNode
Parameters:
specifiedAttributes - the attributes as passed in by the groovy script.
Throws:
ScriptedPicoContainerMarkupException - if an attribute is specified that is not recognized.


Copyright © 2003-2010 Codehaus. All Rights Reserved.