Package groovy.util
Class FactoryBuilderSupport
- java.lang.Object
- 
- groovy.lang.GroovyObjectSupport
- 
- groovy.lang.Binding
- 
- groovy.util.FactoryBuilderSupport
 
 
 
- 
- All Implemented Interfaces:
- GroovyObject
 - Direct Known Subclasses:
- ObjectGraphBuilder
 
 public abstract class FactoryBuilderSupport extends Binding Mix of BuilderSupport and SwingBuilder's factory support. Warning: this implementation is not thread safe and should not be used across threads in a multi-threaded environment. A locking mechanism should be implemented by the subclass if use is expected across multiple threads.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.LinkedList<Closure>attributeDelegatesprotected booleanautoRegistrationCompleteprotected booleanautoRegistrationRunningstatic java.lang.StringCHILD_BUILDERstatic java.lang.StringCURRENT_BUILDERstatic java.lang.StringCURRENT_FACTORYstatic java.lang.StringCURRENT_NAMEstatic java.lang.StringCURRENT_NODEprotected java.util.Map<java.lang.String,Closure>explicitMethodsprotected java.util.Map<java.lang.String,Closure[]>explicitPropertiesprotected ClosuremethodMissingDelegatestatic java.lang.StringOWNERstatic java.lang.StringPARENT_BUILDERstatic java.lang.StringPARENT_CONTEXTstatic java.lang.StringPARENT_FACTORYstatic java.lang.StringPARENT_NAMEstatic java.lang.StringPARENT_NODEprotected java.util.LinkedList<Closure>postInstantiateDelegatesprotected java.util.LinkedList<Closure>postNodeCompletionDelegatesprotected java.util.LinkedList<Closure>preInstantiateDelegatesprotected ClosurepropertyMissingDelegateprotected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>registrationGroupprotected java.lang.StringregistrationGroupNamestatic java.lang.StringSCRIPT_CLASS_NAME
 - 
Constructor SummaryConstructors Constructor Description FactoryBuilderSupport()FactoryBuilderSupport(boolean init)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClosureaddAttributeDelegate(Closure attrDelegate)Add an attribute delegate so it can intercept attributes being set.voidaddDisposalClosure(Closure closure)ClosureaddPostInstantiateDelegate(Closure delegate)Add a postInstantiate delegate so it can intercept nodes after they are created.ClosureaddPostNodeCompletionDelegate(Closure delegate)Add a nodeCompletion delegate so it can intercept nodes after they done with building.ClosureaddPreInstantiateDelegate(Closure delegate)Add a preInstantiate delegate so it can intercept nodes before they are created.voidautoRegisterNodes()Ask the nodes to be registeredjava.lang.Objectbuild(Script script)java.lang.Objectbuild(java.lang.Class viewClass)java.lang.Objectbuild(java.lang.String script, GroovyClassLoader loader)protected booleancheckExplicitMethod(java.lang.String methodName, java.lang.Object args, Reference result)static voidcheckValueIsNull(java.lang.Object value, java.lang.Object name)Throws an exception if value is null.static booleancheckValueIsType(java.lang.Object value, java.lang.Object name, java.lang.Class type)Checks type of value against builder typestatic booleancheckValueIsTypeNotString(java.lang.Object value, java.lang.Object name, java.lang.Class type)Checks values against factory's typeprotected java.lang.ObjectcreateNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)This method is responsible for instantiating a node and configure its properties.protected java.lang.ObjectdispatchNodeCall(java.lang.Object name, java.lang.Object args)protected java.lang.ObjectdispathNodeCall(java.lang.Object name, java.lang.Object args)Deprecated.voiddispose()java.util.List<Closure>getAttributeDelegates()FactoryBuilderSupportgetChildBuilder()java.util.Map<java.lang.String,java.lang.Object>getContext()java.lang.ObjectgetContextAttribute(java.lang.String key)protected java.util.LinkedList<java.util.Map<java.lang.String,java.lang.Object>>getContexts()protected java.util.Map<java.lang.String,java.lang.Object>getContinuationData()Stores the thread local states in a Map that can be passed across threadsjava.lang.ObjectgetCurrent()FactoryBuilderSupportgetCurrentBuilder()FactorygetCurrentFactory()java.lang.StringgetCurrentName()java.util.List<Closure>getDisposalClosures()java.util.Map<java.lang.String,Closure>getExplicitMethods()java.util.Map<java.lang.String,Closure[]>getExplicitProperties()java.util.Map<java.lang.String,Factory>getFactories()java.util.Map<java.lang.String,Closure>getLocalExplicitMethods()java.util.Map<java.lang.String,Closure[]>getLocalExplicitProperties()java.util.Map<java.lang.String,Factory>getLocalFactories()ClosuregetMethodMissingDelegate()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.ClosuregetNameMappingClosure()java.util.MapgetParentContext()FactorygetParentFactory()java.lang.StringgetParentName()java.lang.ObjectgetParentNode()java.util.List<Closure>getPostInstantiateDelegates()java.util.List<Closure>getPostNodeCompletionDelegates()java.util.List<Closure>getPreInstantiateDelegates()java.lang.ObjectgetProperty(java.lang.String property)Overloaded to make variables appear as bean properties or via the subscript operatorClosuregetPropertyMissingDelegate()protected FactoryBuilderSupportgetProxyBuilder()Proxy builders are useful for changing the building context, thus enabling mix & match builders.java.util.Set<java.lang.String>getRegistrationGroupItems(java.lang.String group)java.util.Set<java.lang.String>getRegistrationGroups()java.lang.ObjectgetVariable(java.lang.String name)java.util.MapgetVariables()protected voidhandleNodeAttributes(java.lang.Object node, java.util.Map attributes)Assigns any existing properties to the node.
 It will call attributeDelegates before passing control to the factory that built the node.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 voidnewContext()Pushes a new context on the stack.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.util.Map<java.lang.String,java.lang.Object>popContext()Removes the last context from the stack.protected voidpostInstantiate(java.lang.Object name, java.util.Map attributes, java.lang.Object node)A hook after the factory creates the node and before attributes are set.
 It will call any registered postInstantiateDelegates, if you override this method be sure to call this impl somewhere in your code.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 changed.
 It will call any registered postNodeCompletionDelegates, if you override this method be sure to call this impl at the end of your code.protected voidpreInstantiate(java.lang.Object name, java.util.Map attributes, java.lang.Object value)A hook before the factory creates the node.
 It will call any registered preInstantiateDelegates, if you override this method be sure to call this impl somewhere in your code.voidregisterBeanFactory(java.lang.String theName, java.lang.Class beanClass)Registers a factory for a JavaBean.
 The JavaBean class should have a no-args constructor.voidregisterBeanFactory(java.lang.String theName, java.lang.String groupName, java.lang.Class beanClass)Registers a factory for a JavaBean.
 The JavaBean class should have a no-args constructor.voidregisterExplicitMethod(java.lang.String name, Closure closure)voidregisterExplicitMethod(java.lang.String name, java.lang.String groupName, Closure closure)voidregisterExplicitProperty(java.lang.String name, Closure getter, Closure setter)voidregisterExplicitProperty(java.lang.String name, java.lang.String groupName, Closure getter, Closure setter)voidregisterFactory(java.lang.String name, Factory factory)Registers a factory for a node name.voidregisterFactory(java.lang.String name, java.lang.String groupName, Factory factory)Registers a factory for a node name.voidremoveAttributeDelegate(Closure attrDelegate)Remove the most recently added instance of the attribute delegate.voidremovePostInstantiateDelegate(Closure delegate)Remove the most recently added instance of the postInstantiate delegate.voidremovePostNodeCompletionDelegate(Closure delegate)Remove the most recently added instance of the nodeCompletion delegate.voidremovePreInstantiateDelegate(Closure delegate)Remove the most recently added instance of the preInstantiate delegate.protected voidreset()Clears the context stack.protected ClosureresolveExplicitMethod(java.lang.String methodName, java.lang.Object args)This is a hook for subclasses to plugin a custom strategy for mapping names to explicit methods.protected Closure[]resolveExplicitProperty(java.lang.String propertyName)This is a hook for subclasses to plugin a custom strategy for mapping names to property methods.protected FactoryresolveFactory(java.lang.Object name, java.util.Map attributes, java.lang.Object value)This is a hook for subclasses to plugin a custom strategy for mapping names to factories.protected voidrestoreFromContinuationData(java.util.Map<java.lang.String,java.lang.Object> data)Restores the state of the current builder to the same state as an older build.protected 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.voidsetMethodMissingDelegate(Closure delegate)voidsetNameMappingClosure(Closure nameMappingClosure)protected voidsetNodeAttributes(java.lang.Object node, java.util.Map attributes)Maps attributes key/values to properties on node.protected voidsetParent(java.lang.Object parent, java.lang.Object child)Strategy method to establish parent/child relationships.voidsetProperty(java.lang.String property, java.lang.Object newValue)Overloaded to make variables appear as bean properties or via the subscript operatorvoidsetPropertyMissingDelegate(Closure delegate)protected voidsetProxyBuilder(FactoryBuilderSupport proxyBuilder)Sets the builder to be used as a proxy.voidsetVariable(java.lang.String name, java.lang.Object value)Sets the value of the given variablejava.lang.ObjectwithBuilder(FactoryBuilderSupport builder, Closure closure)Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup.java.lang.ObjectwithBuilder(FactoryBuilderSupport builder, java.lang.String name, Closure closure)Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup.java.lang.ObjectwithBuilder(java.util.Map attributes, FactoryBuilderSupport builder, java.lang.String name, Closure closure)Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup.- 
Methods inherited from class groovy.lang.BindinghasVariable
 - 
Methods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, setMetaClass
 
- 
 
- 
- 
- 
Field Detail- 
CURRENT_FACTORYpublic static final java.lang.String CURRENT_FACTORY - See Also:
- Constant Field Values
 
 - 
PARENT_FACTORYpublic static final java.lang.String PARENT_FACTORY - See Also:
- Constant Field Values
 
 - 
PARENT_NODEpublic static final java.lang.String PARENT_NODE - See Also:
- Constant Field Values
 
 - 
CURRENT_NODEpublic static final java.lang.String CURRENT_NODE - See Also:
- Constant Field Values
 
 - 
PARENT_CONTEXTpublic static final java.lang.String PARENT_CONTEXT - See Also:
- Constant Field Values
 
 - 
PARENT_NAMEpublic static final java.lang.String PARENT_NAME - See Also:
- Constant Field Values
 
 - 
CURRENT_NAMEpublic static final java.lang.String CURRENT_NAME - See Also:
- Constant Field Values
 
 - 
OWNERpublic static final java.lang.String OWNER - See Also:
- Constant Field Values
 
 - 
PARENT_BUILDERpublic static final java.lang.String PARENT_BUILDER - See Also:
- Constant Field Values
 
 - 
CURRENT_BUILDERpublic static final java.lang.String CURRENT_BUILDER - See Also:
- Constant Field Values
 
 - 
CHILD_BUILDERpublic static final java.lang.String CHILD_BUILDER - See Also:
- Constant Field Values
 
 - 
SCRIPT_CLASS_NAMEpublic static final java.lang.String SCRIPT_CLASS_NAME - See Also:
- Constant Field Values
 
 - 
attributeDelegatesprotected java.util.LinkedList<Closure> attributeDelegates 
 - 
preInstantiateDelegatesprotected java.util.LinkedList<Closure> preInstantiateDelegates 
 - 
postInstantiateDelegatesprotected java.util.LinkedList<Closure> postInstantiateDelegates 
 - 
postNodeCompletionDelegatesprotected java.util.LinkedList<Closure> postNodeCompletionDelegates 
 - 
methodMissingDelegateprotected Closure methodMissingDelegate 
 - 
propertyMissingDelegateprotected Closure propertyMissingDelegate 
 - 
explicitPropertiesprotected java.util.Map<java.lang.String,Closure[]> explicitProperties 
 - 
explicitMethodsprotected java.util.Map<java.lang.String,Closure> explicitMethods 
 - 
registrationGroupprotected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> registrationGroup 
 - 
registrationGroupNameprotected java.lang.String registrationGroupName 
 - 
autoRegistrationRunningprotected boolean autoRegistrationRunning 
 - 
autoRegistrationCompleteprotected boolean autoRegistrationComplete 
 
- 
 - 
Method Detail- 
checkValueIsNullpublic static void checkValueIsNull(java.lang.Object value, java.lang.Object name)Throws an exception if value is null.- Parameters:
- value- the node's value
- name- the node's name
 
 - 
checkValueIsTypepublic static boolean checkValueIsType(java.lang.Object value, java.lang.Object name, java.lang.Class type)Checks type of value against builder type- Parameters:
- value- the node's value
- name- the node's name
- type- a Class that may be assignable to the value's class
- Returns:
- true if type is assignable to the value's class, false if value is null.
 
 - 
checkValueIsTypeNotStringpublic static boolean checkValueIsTypeNotString(java.lang.Object value, java.lang.Object name, java.lang.Class type)Checks values against factory's type- Parameters:
- value- the node's value
- name- the node's name
- type- a Class that may be assignable to the value's class
- Returns:
- Returns true if type is assignable to the value's class, false if value is null or a String.
 
 - 
autoRegisterNodespublic void autoRegisterNodes() Ask the nodes to be registered
 - 
getVariablepublic java.lang.Object getVariable(java.lang.String name) - Overrides:
- getVariablein class- Binding
- Parameters:
- name- the name of the variable to lookup
- Returns:
- the variable value
 
 - 
setVariablepublic void setVariable(java.lang.String name, java.lang.Object value)Sets the value of the given variable- Overrides:
- setVariablein class- Binding
- Parameters:
- name- the name of the variable to set
- value- the new value for the given variable
 
 - 
getVariablespublic java.util.Map getVariables() - Overrides:
- getVariablesin class- Binding
 
 - 
getPropertypublic java.lang.Object getProperty(java.lang.String property) Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
- getPropertyin interface- GroovyObject
- Overrides:
- getPropertyin class- Binding
- Parameters:
- property- the name of the property of interest
- Returns:
- the given property
 
 - 
setPropertypublic void setProperty(java.lang.String property, java.lang.Object newValue)Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
- setPropertyin interface- GroovyObject
- Overrides:
- setPropertyin class- Binding
- Parameters:
- property- the name of the property of interest
- newValue- the new value for the property
 
 - 
getFactoriespublic java.util.Map<java.lang.String,Factory> getFactories() - Returns:
- the factory map (Unmodifiable Map).
 
 - 
getExplicitMethodspublic java.util.Map<java.lang.String,Closure> getExplicitMethods() - Returns:
- the explicit methods map (Unmodifiable Map).
 
 - 
getExplicitPropertiespublic java.util.Map<java.lang.String,Closure[]> getExplicitProperties() - Returns:
- the explicit properties map (Unmodifiable Map).
 
 - 
getLocalFactoriespublic java.util.Map<java.lang.String,Factory> getLocalFactories() - Returns:
- the factory map (Unmodifiable Map).
 
 - 
getLocalExplicitMethodspublic java.util.Map<java.lang.String,Closure> getLocalExplicitMethods() - Returns:
- the explicit methods map (Unmodifiable Map).
 
 - 
getLocalExplicitPropertiespublic java.util.Map<java.lang.String,Closure[]> getLocalExplicitProperties() - Returns:
- the explicit properties map (Unmodifiable Map).
 
 - 
getRegistrationGroupspublic java.util.Set<java.lang.String> getRegistrationGroups() 
 - 
getRegistrationGroupItemspublic java.util.Set<java.lang.String> getRegistrationGroupItems(java.lang.String group) 
 - 
getAttributeDelegatespublic java.util.List<Closure> getAttributeDelegates() 
 - 
getPreInstantiateDelegatespublic java.util.List<Closure> getPreInstantiateDelegates() 
 - 
getPostInstantiateDelegatespublic java.util.List<Closure> getPostInstantiateDelegates() 
 - 
getPostNodeCompletionDelegatespublic java.util.List<Closure> getPostNodeCompletionDelegates() 
 - 
getMethodMissingDelegatepublic Closure getMethodMissingDelegate() 
 - 
setMethodMissingDelegatepublic void setMethodMissingDelegate(Closure delegate) 
 - 
getPropertyMissingDelegatepublic Closure getPropertyMissingDelegate() 
 - 
setPropertyMissingDelegatepublic void setPropertyMissingDelegate(Closure delegate) 
 - 
getContextpublic java.util.Map<java.lang.String,java.lang.Object> getContext() - Returns:
- the context of the current node.
 
 - 
getCurrentpublic java.lang.Object getCurrent() - Returns:
- the current node being built.
 
 - 
getCurrentFactorypublic Factory getCurrentFactory() - Returns:
- the factory that built the current node.
 
 - 
getCurrentNamepublic java.lang.String getCurrentName() - Returns:
- the factory of the parent of the current node.
 
 - 
getCurrentBuilderpublic FactoryBuilderSupport getCurrentBuilder() - Returns:
- the builder that built the current node.
 
 - 
getParentNodepublic java.lang.Object getParentNode() - Returns:
- the node of the parent of the current node.
 
 - 
getParentFactorypublic Factory getParentFactory() - Returns:
- the factory of the parent of the current node.
 
 - 
getParentContextpublic java.util.Map getParentContext() - Returns:
- the context of the parent of the current node.
 
 - 
getParentNamepublic java.lang.String getParentName() - Returns:
- the name of the parent of the current node.
 
 - 
getChildBuilderpublic FactoryBuilderSupport getChildBuilder() 
 - 
getContextAttributepublic java.lang.Object getContextAttribute(java.lang.String key) 
 - 
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
 
 - 
addAttributeDelegatepublic Closure addAttributeDelegate(Closure attrDelegate) Add an attribute delegate so it can intercept attributes being set. Attribute delegates are fired in a FILO pattern, so that nested delegates get first crack.- Parameters:
- attrDelegate- the closure to be called
- Returns:
- attrDelegate
 
 - 
removeAttributeDelegatepublic void removeAttributeDelegate(Closure attrDelegate) Remove the most recently added instance of the attribute delegate.- Parameters:
- attrDelegate- the instance of the closure to be removed
 
 - 
addPreInstantiateDelegatepublic Closure addPreInstantiateDelegate(Closure delegate) Add a preInstantiate delegate so it can intercept nodes before they are created. PreInstantiate delegates are fired in a FILO pattern, so that nested delegates get first crack.- Parameters:
- delegate- the closure to invoke
- Returns:
- delegate
 
 - 
removePreInstantiateDelegatepublic void removePreInstantiateDelegate(Closure delegate) Remove the most recently added instance of the preInstantiate delegate.- Parameters:
- delegate- the closure to invoke
 
 - 
addPostInstantiateDelegatepublic Closure addPostInstantiateDelegate(Closure delegate) Add a postInstantiate delegate so it can intercept nodes after they are created. PostInstantiate delegates are fired in a FILO pattern, so that nested delegates get first crack.- Parameters:
- delegate- the closure to invoke
- Returns:
- delegate
 
 - 
removePostInstantiateDelegatepublic void removePostInstantiateDelegate(Closure delegate) Remove the most recently added instance of the postInstantiate delegate.- Parameters:
- delegate- the closure to invoke
 
 - 
addPostNodeCompletionDelegatepublic Closure addPostNodeCompletionDelegate(Closure delegate) Add a nodeCompletion delegate so it can intercept nodes after they done with building. NodeCompletion delegates are fired in a FILO pattern, so that nested delegates get first crack.- Parameters:
- delegate- the closure to invoke
- Returns:
- delegate
 
 - 
removePostNodeCompletionDelegatepublic void removePostNodeCompletionDelegate(Closure delegate) Remove the most recently added instance of the nodeCompletion delegate.- Parameters:
- delegate- the closure to be removed
 
 - 
registerExplicitPropertypublic void registerExplicitProperty(java.lang.String name, Closure getter, Closure setter)
 - 
registerExplicitPropertypublic void registerExplicitProperty(java.lang.String name, java.lang.String groupName, Closure getter, Closure setter)
 - 
registerExplicitMethodpublic void registerExplicitMethod(java.lang.String name, Closure closure)
 - 
registerExplicitMethodpublic void registerExplicitMethod(java.lang.String name, java.lang.String groupName, Closure closure)
 - 
registerBeanFactorypublic void registerBeanFactory(java.lang.String theName, java.lang.Class beanClass)Registers a factory for a JavaBean.
 The JavaBean class should have a no-args constructor.- Parameters:
- theName- name of the node
- beanClass- the factory to handle the name
 
 - 
registerBeanFactorypublic void registerBeanFactory(java.lang.String theName, java.lang.String groupName, java.lang.Class beanClass)Registers a factory for a JavaBean.
 The JavaBean class should have a no-args constructor.- Parameters:
- theName- name of the node
- groupName- thr group to register this node in
- beanClass- the factory to handle the name
 
 - 
registerFactorypublic void registerFactory(java.lang.String name, Factory factory)Registers a factory for a node name.- Parameters:
- name- the name of the node
- factory- the factory to return the values
 
 - 
registerFactorypublic void registerFactory(java.lang.String name, java.lang.String groupName, Factory factory)Registers a factory for a node name.- Parameters:
- name- the name of the node
- groupName- thr group to register this node in
- factory- the factory to return the values
 
 - 
createNodeprotected java.lang.Object createNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)This method is responsible for instantiating a node and configure its properties.- Parameters:
- name- the name of the node
- attributes- the attributes for the node
- value- the value arguments for the node
- Returns:
- the object return from the factory
 
 - 
resolveFactoryprotected Factory resolveFactory(java.lang.Object name, java.util.Map attributes, java.lang.Object value) This is a hook for subclasses to plugin a custom strategy for mapping names to factories.- Parameters:
- name- the name of the factory
- attributes- the attributes from the node
- value- value arguments from te node
- Returns:
- the Factory associated with name.
 
 - 
resolveExplicitMethodprotected Closure resolveExplicitMethod(java.lang.String methodName, java.lang.Object args) This is a hook for subclasses to plugin a custom strategy for mapping names to explicit methods.- Parameters:
- methodName- the name of the explicit method
- args- the arguments for the method
- Returns:
- the closure for the matched explicit method.
 
 - 
resolveExplicitPropertyprotected Closure[] resolveExplicitProperty(java.lang.String propertyName) This is a hook for subclasses to plugin a custom strategy for mapping names to property methods.- Parameters:
- propertyName- the name of the explicit method
- Returns:
- the get and set closures (in that order) for the matched explicit property.
 
 - 
checkExplicitMethodprotected boolean checkExplicitMethod(java.lang.String methodName, java.lang.Object args, Reference result)
 - 
dispathNodeCall@Deprecated protected java.lang.Object dispathNodeCall(java.lang.Object name, java.lang.Object args)Deprecated.UsedispatchNodeCall(Object, Object)instead.
 - 
dispatchNodeCallprotected java.lang.Object dispatchNodeCall(java.lang.Object name, java.lang.Object args)
 - 
getNamepublic 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
 
 - 
getProxyBuilderprotected FactoryBuilderSupport getProxyBuilder() Proxy builders are useful for changing the building context, thus enabling mix & match builders.- Returns:
- the current builder that serves as a proxy.
 
 - 
setProxyBuilderprotected void setProxyBuilder(FactoryBuilderSupport proxyBuilder) Sets the builder to be used as a proxy.- Parameters:
- proxyBuilder- the new proxy
 
 - 
getNameMappingClosurepublic Closure getNameMappingClosure() 
 - 
setNameMappingClosurepublic void setNameMappingClosure(Closure nameMappingClosure) 
 - 
handleNodeAttributesprotected void handleNodeAttributes(java.lang.Object node, java.util.Map attributes)Assigns any existing properties to the node.
 It will call attributeDelegates before passing control to the factory that built the node.- Parameters:
- node- the object returned by tne node factory
- attributes- the attributes for the node
 
 - 
newContextprotected void newContext() Pushes a new context on the stack.
 - 
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
 
 - 
popContextprotected java.util.Map<java.lang.String,java.lang.Object> popContext() Removes the last context from the stack.- Returns:
- the content just removed
 
 - 
postInstantiateprotected void postInstantiate(java.lang.Object name, java.util.Map attributes, java.lang.Object node)A hook after the factory creates the node and before attributes are set.
 It will call any registered postInstantiateDelegates, if you override this method be sure to call this impl somewhere in your code.- Parameters:
- name- the name of the node
- attributes- the attributes for the node
- node- the object created by the node factory
 
 - 
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.
 It will call any registered postNodeCompletionDelegates, if you override this method be sure to call this impl at the end of your code.- 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
 
 - 
preInstantiateprotected void preInstantiate(java.lang.Object name, java.util.Map attributes, java.lang.Object value)A hook before the factory creates the node.
 It will call any registered preInstantiateDelegates, if you override this method be sure to call this impl somewhere in your code.- Parameters:
- name- the name of the node
- attributes- the attributes of the node
- value- the value argument(s) of the node
 
 - 
resetprotected void reset() Clears the context stack.
 - 
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
 
 - 
setNodeAttributesprotected void setNodeAttributes(java.lang.Object node, java.util.Map attributes)Maps attributes key/values to properties on node.- Parameters:
- node- the object from the node
- attributes- the attributes to be set
 
 - 
setParentprotected void setParent(java.lang.Object parent, java.lang.Object child)Strategy method to establish parent/child relationships.- Parameters:
- parent- the object from the parent node
- child- the object from the child node
 
 - 
getContextsprotected java.util.LinkedList<java.util.Map<java.lang.String,java.lang.Object>> getContexts() - Returns:
- the stack of available contexts.
 
 - 
getContinuationDataprotected java.util.Map<java.lang.String,java.lang.Object> getContinuationData() Stores the thread local states in a Map that can be passed across threads- Returns:
- the map
 
 - 
restoreFromContinuationDataprotected void restoreFromContinuationData(java.util.Map<java.lang.String,java.lang.Object> data) Restores the state of the current builder to the same state as an older build. Caution, this will destroy rather than merge the current build context if there is any,- Parameters:
- data- the data retrieved from a compatible getContinuationData call
 
 - 
buildpublic java.lang.Object build(java.lang.Class viewClass) 
 - 
buildpublic java.lang.Object build(Script script) 
 - 
buildpublic java.lang.Object build(java.lang.String script, GroovyClassLoader loader)
 - 
withBuilderpublic java.lang.Object withBuilder(FactoryBuilderSupport builder, Closure closure) Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup. It will also take care of restoring the previous proxyBuilder when the execution finishes, even if an exception was thrown from inside the closure.- Parameters:
- builder- the temporary builder to switch to as proxyBuilder.
- closure- the closure to be executed under the temporary builder.
- Returns:
- the execution result of the closure.
- Throws:
- java.lang.RuntimeException- - any exception the closure might have thrown during execution.
 
 - 
withBuilderpublic java.lang.Object withBuilder(FactoryBuilderSupport builder, java.lang.String name, Closure closure) Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup. It will also take care of restoring the previous proxyBuilder when the execution finishes, even if an exception was thrown from inside the closure. Additionally it will use the closure's result as the value for the node identified by 'name'.- Parameters:
- builder- the temporary builder to switch to as proxyBuilder.
- name- the node to build on the 'parent' builder.
- closure- the closure to be executed under the temporary builder.
- Returns:
- a node that responds to value of name with the closure's result as its value.
- Throws:
- java.lang.RuntimeException- - any exception the closure might have thrown during execution.
 
 - 
withBuilderpublic java.lang.Object withBuilder(java.util.Map attributes, FactoryBuilderSupport builder, java.lang.String name, Closure closure)Switches the builder's proxyBuilder during the execution of a closure.
 This is useful to temporary change the building context to another builder without the need for a contrived setup. It will also take care of restoring the previous proxyBuilder when the execution finishes, even if an exception was thrown from inside the closure. Additionally it will use the closure's result as the value for the node identified by 'name' and assign any attributes that might have been set.- Parameters:
- attributes- additional properties for the node on the parent builder.
- builder- the temporary builder to switch to as proxyBuilder.
- name- the node to build on the 'parent' builder.
- closure- the closure to be executed under the temporary builder.
- Returns:
- a node that responds to value of name with the closure's result as its value.
- Throws:
- java.lang.RuntimeException- - any exception the closure might have thrown during execution.
 
 - 
addDisposalClosurepublic void addDisposalClosure(Closure closure) 
 - 
getDisposalClosurespublic java.util.List<Closure> getDisposalClosures() 
 - 
disposepublic void dispose() 
 
- 
 
-