Package groovy.util
Class BuilderSupport
- java.lang.Object
- 
- groovy.lang.GroovyObjectSupport
- 
- groovy.util.BuilderSupport
 
 
- 
- All Implemented Interfaces:
- GroovyObject
 - Direct Known Subclasses:
- AntBuilder,- DOMBuilder,- MarkupBuilder,- NamespaceBuilderSupport,- NodeBuilder,- SAXBuilder
 
 public abstract class BuilderSupport extends GroovyObjectSupport An abstract base class for creating arbitrary nested trees of objects or events
- 
- 
Constructor SummaryConstructors Constructor Description BuilderSupport()BuilderSupport(Closure nameMappingClosure, BuilderSupport proxyBuilder)BuilderSupport(BuilderSupport proxyBuilder)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.ObjectcreateNode(java.lang.Object name)protected abstract java.lang.ObjectcreateNode(java.lang.Object name, java.lang.Object value)protected abstract java.lang.ObjectcreateNode(java.lang.Object name, java.util.Map attributes)protected abstract java.lang.ObjectcreateNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)protected java.lang.ObjectdoInvokeMethod(java.lang.String methodName, java.lang.Object name, java.lang.Object args)protected java.lang.ObjectgetCurrent()protected java.lang.ObjectgetName(java.lang.String methodName)A hook to allow names to be converted into some other object such as a QName in XML or ObjectName in JMX.java.lang.ObjectinvokeMethod(java.lang.String methodName)Convenience method when no arguments are requiredjava.lang.ObjectinvokeMethod(java.lang.String methodName, java.lang.Object args)Invokes the given method.protected voidnodeCompleted(java.lang.Object parent, java.lang.Object node)A hook to allow nodes to be processed once they have had all of their children applied.protected java.lang.ObjectpostNodeCompletion(java.lang.Object parent, java.lang.Object node)A hook to allow nodes to be processed once they have had all of their children applied and allows the actual node object that represents the Markup element to be changedprotected voidsetClosureDelegate(Closure closure, java.lang.Object node)A strategy method to allow derived builders to use builder-trees and switch in different kinds of builders.protected voidsetCurrent(java.lang.Object current)protected abstract voidsetParent(java.lang.Object parent, java.lang.Object child)- 
Methods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, getProperty, setMetaClass, setProperty
 
- 
 
- 
- 
- 
Constructor Detail- 
BuilderSupportpublic BuilderSupport() 
 - 
BuilderSupportpublic BuilderSupport(BuilderSupport proxyBuilder) 
 - 
BuilderSupportpublic BuilderSupport(Closure nameMappingClosure, BuilderSupport proxyBuilder) 
 
- 
 - 
Method Detail- 
invokeMethodpublic java.lang.Object invokeMethod(java.lang.String methodName) Convenience method when no arguments are required- Parameters:
- methodName- the name of the method to invoke
- Returns:
- the result of the call
 
 - 
invokeMethodpublic java.lang.Object invokeMethod(java.lang.String methodName, java.lang.Object args)Description copied from interface:GroovyObjectInvokes the given method.- Specified by:
- invokeMethodin interface- GroovyObject
- Overrides:
- invokeMethodin class- GroovyObjectSupport
- Parameters:
- methodName- the name of the method to call
- args- the arguments to use for the method call
- Returns:
- the result of invoking the method
 
 - 
doInvokeMethodprotected java.lang.Object doInvokeMethod(java.lang.String methodName, java.lang.Object name, java.lang.Object args)
 - 
setClosureDelegateprotected void setClosureDelegate(Closure closure, java.lang.Object node) A strategy method to allow derived builders to use builder-trees and switch in different kinds of builders. This method should call the setDelegate() method on the closure which by default passes in this but if node is-a builder we could pass that in instead (or do something wacky too)- Parameters:
- closure- the closure on which to call setDelegate()
- node- the node value that we've just created, which could be a builder
 
 - 
setParentprotected abstract void setParent(java.lang.Object parent, java.lang.Object child)
 - 
createNodeprotected abstract java.lang.Object createNode(java.lang.Object name) 
 - 
createNodeprotected abstract java.lang.Object createNode(java.lang.Object name, java.lang.Object value)
 - 
createNodeprotected abstract java.lang.Object createNode(java.lang.Object name, java.util.Map attributes)
 - 
createNodeprotected abstract java.lang.Object createNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)
 - 
getNameprotected java.lang.Object getName(java.lang.String methodName) A hook to allow names to be converted into some other object such as a QName in XML or ObjectName in JMX.- Parameters:
- methodName- the name of the desired method
- Returns:
- the object representing the name
 
 - 
nodeCompletedprotected void nodeCompleted(java.lang.Object parent, java.lang.Object node)A hook to allow nodes to be processed once they have had all of their children applied.- Parameters:
- node- the current node being processed
- parent- the parent of the node being processed
 
 - 
postNodeCompletionprotected java.lang.Object postNodeCompletion(java.lang.Object parent, java.lang.Object node)A hook to allow nodes to be processed once they have had all of their children applied and allows the actual node object that represents the Markup element to be changed- Parameters:
- node- the current node being processed
- parent- the parent of the node being processed
- Returns:
- the node, possibly new, that represents the markup element
 
 - 
getCurrentprotected java.lang.Object getCurrent() 
 - 
setCurrentprotected void setCurrent(java.lang.Object current) 
 
- 
 
-