Groovy 2.2.0

groovy.util
[Java] Class BuilderSupport

java.lang.Object
  groovy.lang.GroovyObjectSupport
      groovy.util.BuilderSupport

public abstract class BuilderSupport
extends GroovyObjectSupport

An abstract base class for creating arbitrary nested trees of objects or events

Authors:
James Strachan
Version:
\$Revision\$


Constructor Summary
BuilderSupport()

BuilderSupport(BuilderSupport proxyBuilder)

BuilderSupport(Closure nameMappingClosure, BuilderSupport proxyBuilder)

 
Method Summary
protected Object createNode(Object name)

protected Object createNode(Object name, Object value)

protected Object createNode(Object name, Map attributes)

protected Object createNode(Object name, Map attributes, Object value)

protected Object doInvokeMethod(String methodName, Object name, Object args)

protected Object getCurrent()

protected Object getName(String methodName)

Object invokeMethod(String methodName)

Convenience method when no arguments are required

Object invokeMethod(String methodName, Object args)

protected void nodeCompleted(Object parent, Object node)

A hook to allow nodes to be processed once they have had all of their children applied.

protected Object postNodeCompletion(Object parent, 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

protected void setClosureDelegate(Closure closure, Object node)

A strategy method to allow derived builders to use builder-trees and switch in different kinds of builders.

protected void setCurrent(Object current)

protected void setParent(Object parent, Object child)

 
Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

BuilderSupport

public BuilderSupport()


BuilderSupport

public BuilderSupport(BuilderSupport proxyBuilder)


BuilderSupport

public BuilderSupport(Closure nameMappingClosure, BuilderSupport proxyBuilder)


 
Method Detail

createNode

protected Object createNode(Object name)


createNode

protected Object createNode(Object name, Object value)


createNode

protected Object createNode(Object name, Map attributes)


createNode

protected Object createNode(Object name, Map attributes, Object value)


doInvokeMethod

protected Object doInvokeMethod(String methodName, Object name, Object args)


getCurrent

protected Object getCurrent()


getName

protected Object getName(String methodName)


invokeMethod

public Object invokeMethod(String methodName)
Convenience method when no arguments are required
Parameters:
methodName - the name of the method to invoke
Returns:
the result of the call


invokeMethod

public Object invokeMethod(String methodName, Object args)


nodeCompleted

protected void nodeCompleted(Object parent, 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


postNodeCompletion

protected Object postNodeCompletion(Object parent, 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


setClosureDelegate

protected void setClosureDelegate(Closure closure, 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


setCurrent

protected void setCurrent(Object current)


setParent

protected void setParent(Object parent, Object child)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.