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
Mix of BuilderSupport and SwingBuilder's factory support.
Warning: this implementation is not thread safe and should not be used
across threads in a multithreaded environment. A locking mechanism
should be implemented by the subclass if use is expected across
multiple threads.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<Closure>Delegates that can preprocess node attributes.protected booleanTracks whether auto-registration has completed.protected booleanTracks whether auto-registration is currently in progress.static final StringContext key for the builder used to create child nodes.static final StringContext key for the builder of the current node.static final StringContext key for the factory creating the current node.static final StringContext key for the current node name.static final StringContext key for the current node.Explicit methods exposed by the builder.Explicit property accessors exposed by the builder.protected ClosureFallback invoked when a builder method cannot be resolved.static final StringContext key for a nested closure owner.static final StringContext key for the builder of the parent node.static final StringContext key for the parent node context.static final StringContext key for the factory that created the parent node.static final StringContext key for the parent node name.static final StringContext key for the parent node.protected LinkedList<Closure>Delegates invoked after a factory creates a node.protected LinkedList<Closure>Delegates invoked after a node and its children are complete.protected LinkedList<Closure>Delegates invoked before a factory creates a node.protected ClosureFallback invoked when a builder property cannot be resolved.Registered names grouped by registration phase.protected StringName of the registration group currently being populated.static final StringBinding key for the currently executing script class name. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a builder without performing automatic node registration.FactoryBuilderSupport(boolean init) Creates a builder and optionally performs automatic node registration. -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeDelegate(Closure attrDelegate) Add an attribute delegate so it can intercept attributes being set.voidaddDisposalClosure(Closure closure) Registers a closure to run when the builder is disposed.addPostInstantiateDelegate(Closure delegate) Add a postInstantiate delegate so it can intercept nodes after they are created.addPostNodeCompletionDelegate(Closure delegate) Add a nodeCompletion delegate so it can intercept nodes after they done with building.addPreInstantiateDelegate(Closure delegate) Add a preInstantiate delegate so it can intercept nodes before they are created.voidAsk the nodes to be registeredRuns a script instance using this builder as its binding.Runs a script class using this builder as its binding.build(String script, GroovyClassLoader loader) Parses and runs an inline script using the supplied class loader.protected booleancheckExplicitMethod(String methodName, Object args, Reference result) Resolves and invokes an explicit builder method if one is registered.static voidcheckValueIsNull(Object value, Object name) Throws an exception if value is null.static booleancheckValueIsType(Object value, Object name, Class type) Checks type of value against builder typestatic booleancheckValueIsTypeNotString(Object value, Object name, Class type) Checks values against factory's typeprotected ObjectcreateNode(Object name, Map attributes, Object value) This method is responsible for instantiating a node and configure its properties.protected ObjectdispatchNodeCall(Object name, Object args) Dispatches a builder method call to node creation and nested closure handling.protected ObjectdispathNodeCall(Object name, Object args) Deprecated.voiddispose()Invokes registered disposal closures in reverse registration order.Returns the active attribute delegates.Returns the builder currently used for child node creation.Looks up a value from the current builder context.protected LinkedList<Map<String,Object>> Stores the thread local states in a Map that can be passed across threadsReturns the registered disposal closures.Returns the method-missing fallback closure.A hook to allow names to be converted into some other object such as a QName in XML or ObjectName in JMX.Returns the closure that maps method names to builder names.Returns the active post-instantiation delegates.Returns the active post-node-completion delegates.Returns the active pre-instantiation delegates.getProperty(String property) Overloaded to make variables appear as bean properties or via the subscript operatorReturns the property-missing fallback closure.protected FactoryBuilderSupportProxy builders are useful for changing the building context, thus enabling mix & match builders.getRegistrationGroupItems(String group) Returns the names registered in the supplied group.Returns the available registration group names.getVariable(String name) Returns the variables map, creating it on first access.protected voidhandleNodeAttributes(Object node, Map attributes) Assigns any existing properties to the node.
It will call attributeDelegates before passing control to the factory that built the node.invokeMethod(String methodName) Convenience method when no arguments are requiredinvokeMethod(String methodName, Object args) Invokes the given method.protected voidPushes a new context on the stack.protected voidnodeCompleted(Object parent, Object node) A hook to allow nodes to be processed once they have had all of their children applied.Removes the last context from the stack.protected voidpostInstantiate(Object name, Map attributes, 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 ObjectpostNodeCompletion(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.
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(Object name, Map attributes, 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(String theName, Class beanClass) Registers a factory for a JavaBean.
The JavaBean class should have a no-arg constructor.voidregisterBeanFactory(String theName, String groupName, Class beanClass) Registers a factory for a JavaBean.
The JavaBean class should have a no-arg constructor.voidregisterExplicitMethod(String name, Closure closure) Registers an explicit method in the current registration group.voidregisterExplicitMethod(String name, String groupName, Closure closure) Registers an explicit method and tracks it in the supplied group.voidregisterExplicitProperty(String name, Closure getter, Closure setter) Registers an explicit property in the current registration group.voidregisterExplicitProperty(String name, String groupName, Closure getter, Closure setter) Registers an explicit property and tracks any generated accessor names.voidregisterFactory(String name, Factory factory) Registers a factory for a node name.voidregisterFactory(String name, 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(String methodName, Object args) This is a hook for subclasses to plug in a custom strategy for mapping names to explicit methods.protected Closure[]resolveExplicitProperty(String propertyName) This is a hook for subclasses to plug in a custom strategy for mapping names to property methods.protected FactoryresolveFactory(Object name, Map attributes, Object value) This is a hook for subclasses to plug in a custom strategy for mapping names to factories.protected voidRestores the state of the current builder to the same state as an older build.protected voidsetClosureDelegate(Closure closure, Object node) A strategy method to allow derived builders to use builder-trees and switch in different kinds of builders.voidsetMethodMissingDelegate(Closure delegate) Sets the method-missing fallback closure.voidsetNameMappingClosure(Closure nameMappingClosure) Sets the closure used to map method names to builder names.protected voidsetNodeAttributes(Object node, Map attributes) Maps attributes key/values to properties on node.protected voidStrategy method to establish parent/child relationships.voidsetProperty(String property, Object newValue) Overloaded to make variables appear as bean properties or via the subscript operatorvoidsetPropertyMissingDelegate(Closure delegate) Sets the property-missing fallback closure.protected voidsetProxyBuilder(FactoryBuilderSupport proxyBuilder) Sets the builder to be used as a proxy.voidsetVariable(String name, Object value) Sets the value of the given variablewithBuilder(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.withBuilder(FactoryBuilderSupport builder, 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.withBuilder(Map attributes, FactoryBuilderSupport builder, 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.Binding
hasVariable, removeVariableMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
-
Field Details
-
CURRENT_FACTORY
Context key for the factory creating the current node.- See Also:
-
PARENT_FACTORY
Context key for the factory that created the parent node.- See Also:
-
PARENT_NODE
Context key for the parent node.- See Also:
-
CURRENT_NODE
Context key for the current node.- See Also:
-
PARENT_CONTEXT
Context key for the parent node context.- See Also:
-
PARENT_NAME
Context key for the parent node name.- See Also:
-
CURRENT_NAME
Context key for the current node name.- See Also:
-
OWNER
Context key for a nested closure owner.- See Also:
-
PARENT_BUILDER
Context key for the builder of the parent node.- See Also:
-
CURRENT_BUILDER
Context key for the builder of the current node.- See Also:
-
CHILD_BUILDER
Context key for the builder used to create child nodes.- See Also:
-
SCRIPT_CLASS_NAME
Binding key for the currently executing script class name.- See Also:
-
attributeDelegates
Delegates that can preprocess node attributes. -
preInstantiateDelegates
Delegates invoked before a factory creates a node. -
postInstantiateDelegates
Delegates invoked after a factory creates a node. -
postNodeCompletionDelegates
Delegates invoked after a node and its children are complete. -
methodMissingDelegate
Fallback invoked when a builder method cannot be resolved. -
propertyMissingDelegate
Fallback invoked when a builder property cannot be resolved. -
explicitProperties
Explicit property accessors exposed by the builder. -
explicitMethods
Explicit methods exposed by the builder. -
registrationGroup
Registered names grouped by registration phase. -
registrationGroupName
Name of the registration group currently being populated. -
autoRegistrationRunning
protected boolean autoRegistrationRunningTracks whether auto-registration is currently in progress. -
autoRegistrationComplete
protected boolean autoRegistrationCompleteTracks whether auto-registration has completed.
-
-
Constructor Details
-
FactoryBuilderSupport
public FactoryBuilderSupport()Creates a builder without performing automatic node registration. -
FactoryBuilderSupport
public FactoryBuilderSupport(boolean init) Creates a builder and optionally performs automatic node registration.- Parameters:
init-trueto invokeautoRegisterNodes()
-
-
Method Details
-
checkValueIsNull
Throws an exception if value is null.- Parameters:
value- the node's valuename- the node's name
-
checkValueIsType
Checks type of value against builder type- Parameters:
value- the node's valuename- the node's nametype- 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.
-
checkValueIsTypeNotString
Checks values against factory's type- Parameters:
value- the node's valuename- the node's nametype- 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.
-
autoRegisterNodes
public void autoRegisterNodes()Ask the nodes to be registered -
getVariable
- Overrides:
getVariablein classBinding- Parameters:
name- the name of the variable to lookup- Returns:
- the variable value
-
setVariable
Sets the value of the given variable- Overrides:
setVariablein classBinding- Parameters:
name- the name of the variable to setvalue- the new value for the given variable
-
getVariables
Returns the variables map, creating it on first access.- Overrides:
getVariablesin classBinding- Returns:
- the backing variables map
-
getProperty
Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
getPropertyin interfaceGroovyObject- Overrides:
getPropertyin classBinding- Parameters:
property- the name of the property of interest- Returns:
- the given property
-
setProperty
Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
setPropertyin interfaceGroovyObject- Overrides:
setPropertyin classBinding- Parameters:
property- the name of the property of interestnewValue- the new value for the property
-
getFactories
- Returns:
- the factory map (Unmodifiable Map).
-
getExplicitMethods
- Returns:
- the explicit methods map (Unmodifiable Map).
-
getExplicitProperties
- Returns:
- the explicit properties map (Unmodifiable Map).
-
getLocalFactories
- Returns:
- the factory map (Unmodifiable Map).
-
getLocalExplicitMethods
- Returns:
- the explicit methods map (Unmodifiable Map).
-
getLocalExplicitProperties
- Returns:
- the explicit properties map (Unmodifiable Map).
-
getRegistrationGroups
Returns the available registration group names.- Returns:
- an unmodifiable view of the registration groups
-
getRegistrationGroupItems
Returns the names registered in the supplied group.- Parameters:
group- the registration group name- Returns:
- an unmodifiable view of the registered names
-
getAttributeDelegates
Returns the active attribute delegates.- Returns:
- the attribute delegates in invocation order
-
getPreInstantiateDelegates
Returns the active pre-instantiation delegates.- Returns:
- the pre-instantiation delegates in invocation order
-
getPostInstantiateDelegates
Returns the active post-instantiation delegates.- Returns:
- the post-instantiation delegates in invocation order
-
getPostNodeCompletionDelegates
Returns the active post-node-completion delegates.- Returns:
- the node completion delegates in invocation order
-
getMethodMissingDelegate
Returns the method-missing fallback closure.- Returns:
- the method-missing delegate, or
null
-
setMethodMissingDelegate
Sets the method-missing fallback closure.- Parameters:
delegate- the delegate to invoke for unresolved methods
-
getPropertyMissingDelegate
Returns the property-missing fallback closure.- Returns:
- the property-missing delegate, or
null
-
setPropertyMissingDelegate
Sets the property-missing fallback closure.- Parameters:
delegate- the delegate to invoke for unresolved properties
-
getContext
- Returns:
- the context of the current node.
-
getCurrent
- Returns:
- the current node being built.
-
getCurrentFactory
- Returns:
- the factory that built the current node.
-
getCurrentName
- Returns:
- the factory of the parent of the current node.
-
getCurrentBuilder
- Returns:
- the builder that built the current node.
-
getParentNode
- Returns:
- the node of the parent of the current node.
-
getParentFactory
- Returns:
- the factory of the parent of the current node.
-
getParentContext
- Returns:
- the context of the parent of the current node.
-
getParentName
- Returns:
- the name of the parent of the current node.
-
getChildBuilder
Returns the builder currently used for child node creation.- Returns:
- the child builder from the current context
-
getContextAttribute
Looks up a value from the current builder context.- Parameters:
key- the context key- Returns:
- the associated value, or
null
-
invokeMethod
Convenience method when no arguments are required- Parameters:
methodName- the name of the method to invoke- Returns:
- the result of the call
-
invokeMethod
Invokes the given method.- Parameters:
methodName- the name of the method to callargs- the arguments to use for the method call- Returns:
- the result of invoking the method
-
addAttributeDelegate
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
-
removeAttributeDelegate
Remove the most recently added instance of the attribute delegate.- Parameters:
attrDelegate- the instance of the closure to be removed
-
addPreInstantiateDelegate
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
-
removePreInstantiateDelegate
Remove the most recently added instance of the preInstantiate delegate.- Parameters:
delegate- the closure to invoke
-
addPostInstantiateDelegate
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
-
removePostInstantiateDelegate
Remove the most recently added instance of the postInstantiate delegate.- Parameters:
delegate- the closure to invoke
-
addPostNodeCompletionDelegate
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
-
removePostNodeCompletionDelegate
Remove the most recently added instance of the nodeCompletion delegate.- Parameters:
delegate- the closure to be removed
-
registerExplicitProperty
Registers an explicit property in the current registration group.- Parameters:
name- the property namegetter- the optional getter closuresetter- the optional setter closure
-
registerExplicitProperty
Registers an explicit property and tracks any generated accessor names.- Parameters:
name- the property namegroupName- the registration group namegetter- the optional getter closuresetter- the optional setter closure
-
registerExplicitMethod
Registers an explicit method in the current registration group.- Parameters:
name- the method nameclosure- the implementation closure
-
registerExplicitMethod
Registers an explicit method and tracks it in the supplied group.- Parameters:
name- the method namegroupName- the registration group nameclosure- the implementation closure
-
registerBeanFactory
Registers a factory for a JavaBean.
The JavaBean class should have a no-arg constructor.- Parameters:
theName- name of the nodebeanClass- the factory to handle the name
-
registerBeanFactory
Registers a factory for a JavaBean.
The JavaBean class should have a no-arg constructor.- Parameters:
theName- name of the nodegroupName- thr group to register this node inbeanClass- the factory to handle the name
-
registerFactory
Registers a factory for a node name.- Parameters:
name- the name of the nodefactory- the factory to return the values
-
registerFactory
Registers a factory for a node name.- Parameters:
name- the name of the nodegroupName- thr group to register this node infactory- the factory to return the values
-
createNode
This method is responsible for instantiating a node and configure its properties.- Parameters:
name- the name of the nodeattributes- the attributes for the nodevalue- the value arguments for the node- Returns:
- the object return from the factory
-
resolveFactory
This is a hook for subclasses to plug in a custom strategy for mapping names to factories.- Parameters:
name- the name of the factoryattributes- the attributes from the nodevalue- value arguments from te node- Returns:
- the Factory associated with name.
-
resolveExplicitMethod
This is a hook for subclasses to plug in a custom strategy for mapping names to explicit methods.- Parameters:
methodName- the name of the explicit methodargs- the arguments for the method- Returns:
- the closure for the matched explicit method.
-
resolveExplicitProperty
This is a hook for subclasses to plug in 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.
-
checkExplicitMethod
Resolves and invokes an explicit builder method if one is registered.- Parameters:
methodName- the method name to resolveargs- the original method argumentsresult- receives the explicit method result when one is invoked- Returns:
trueif an explicit method handled the call
-
dispathNodeCall
Deprecated.UsedispatchNodeCall(Object, Object)instead. -
dispatchNodeCall
Dispatches a builder method call to node creation and nested closure handling.- Parameters:
name- the resolved node nameargs- the original method arguments- Returns:
- the created node
-
getName
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
-
getProxyBuilder
Proxy builders are useful for changing the building context, thus enabling mix & match builders.- Returns:
- the current builder that serves as a proxy.
-
setProxyBuilder
Sets the builder to be used as a proxy.- Parameters:
proxyBuilder- the new proxy
-
getNameMappingClosure
Returns the closure that maps method names to builder names.- Returns:
- the name mapping closure, or
null
-
setNameMappingClosure
Sets the closure used to map method names to builder names.- Parameters:
nameMappingClosure- the mapping closure to use
-
handleNodeAttributes
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 factoryattributes- the attributes for the node
-
newContext
protected void newContext()Pushes a new context on the stack. -
nodeCompleted
A hook to allow nodes to be processed once they have had all of their children applied.- Parameters:
node- the current node being processedparent- the parent of the node being processed
-
popContext
Removes the last context from the stack.- Returns:
- the content just removed
-
postInstantiate
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 nodeattributes- the attributes for the nodenode- the object created by the node factory
-
postNodeCompletion
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 processedparent- the parent of the node being processed- Returns:
- the node, possibly new, that represents the markup element
-
preInstantiate
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 nodeattributes- the attributes of the nodevalue- the value argument(s) of the node
-
reset
protected void reset()Clears the context stack. -
setClosureDelegate
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
-
setNodeAttributes
Maps attributes key/values to properties on node.- Parameters:
node- the object from the nodeattributes- the attributes to be set
-
setParent
Strategy method to establish parent/child relationships.- Parameters:
parent- the object from the parent nodechild- the object from the child node
-
getContexts
- Returns:
- the stack of available contexts.
-
getContinuationData
Stores the thread local states in a Map that can be passed across threads- Returns:
- the map
-
restoreFromContinuationData
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
-
build
Runs a script class using this builder as its binding.- Parameters:
viewClass- the script class to execute- Returns:
- the script result
-
build
Runs a script instance using this builder as its binding.- Parameters:
script- the script to execute- Returns:
- the script result
-
build
Parses and runs an inline script using the supplied class loader.- Parameters:
script- the script sourceloader- the class loader used to parse the script- Returns:
- the script result
-
withBuilder
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:
RuntimeException- - any exception the closure might have thrown during execution.
-
withBuilder
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:
RuntimeException- - any exception the closure might have thrown during execution.
-
withBuilder
public Object withBuilder(Map attributes, FactoryBuilderSupport builder, 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:
RuntimeException- - any exception the closure might have thrown during execution.
-
addDisposalClosure
Registers a closure to run when the builder is disposed.- Parameters:
closure- the disposal action
-
getDisposalClosures
Returns the registered disposal closures.- Returns:
- the disposal closures in execution order
-
dispose
public void dispose()Invokes registered disposal closures in reverse registration order.
-