Top Methods
groovy.util

public Interface Factory

Known Direct Implementers
groovy.util.AbstractFactory
Imports
groovy.lang.Closure, java.util.Map

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the factory should have onContentClosure() called, false if the builder should handle it
isHandlesNodeChildren
()

Does this factory "Own" its child closure.

public boolean

Returns:

true if no child closures should be processed
isLeaf
()

public Object

Returns:

the object created for the builder
newInstance
(FactoryBuilderSupport
the FactoryBuilder
builder
,
Object
the name of the node being built
name
,
Object
the 'value' argument in the build node
value
,
Map<K, V>
the attributes of the build arg
attributes
)

public void
onFactoryRegistration(FactoryBuilderSupport
the build the factory has been registered to
builder
,
String
the name the factory has been registered under
registeredName
,
String registeredGroupName)

Called when a factory is registered to a builder

public boolean

Returns:

true if the factory builder should use standard bean property matching for the remaining attributes
onHandleNodeAttributes
(FactoryBuilderSupport
the FactoryBuilder
builder
,
Object
the node (returned from newINstance) to consider the attributes for
node
,
Map<K, V>
the attributes, a mutable set
attributes
)

public boolean

Returns:

true if the factory builder should apply default node processing to the content child
onNodeChildren
(FactoryBuilderSupport
the FactoryBuilder
builder
,
Object
the node (returned from newINstance) to consider the attributes for
node
,
Closure<V>
the child content closure of the builder
childContent
)

Only called if it isLeaf is false and isHandlesNodeChildren is true

public void
onNodeCompleted(FactoryBuilderSupport
the FactoryBuilder
builder
,
Object
the parent node (null if 'root')
parent
,
Object
the node just completed
node
)

public void
setChild(FactoryBuilderSupport builder, Object parent, Object child)

public void
setParent(FactoryBuilderSupport builder, Object parent, Object child)

Method Detail

isHandlesNodeChildrenback to summary
public boolean isHandlesNodeChildren()

Does this factory "Own" its child closure.

Returns:boolean

true if the factory should have onContentClosure() called, false if the builder should handle it

isLeafback to summary
public boolean isLeaf()
Returns:boolean

true if no child closures should be processed

newInstanceback to summary
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map<K, V> attributes) throws InstantiationException, IllegalAccessException
Parameters
builder:FactoryBuilderSupport

the FactoryBuilder

name:Object

the name of the node being built

value:Object

the 'value' argument in the build node

attributes:Map<K, V>

the attributes of the build arg

Returns:Object

the object created for the builder

Exceptions
InstantiationException:
if attempting to instantiate an interface or abstract class
IllegalAccessException:
if the instance can't be created due to a security violation
onFactoryRegistrationback to summary
public void onFactoryRegistration(FactoryBuilderSupport builder, String registeredName, String registeredGroupName)

Called when a factory is registered to a builder

Parameters
builder:FactoryBuilderSupport

the build the factory has been registered to

registeredName:String

the name the factory has been registered under

onHandleNodeAttributesback to summary
public boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map<K, V> attributes)
Parameters
builder:FactoryBuilderSupport

the FactoryBuilder

node:Object

the node (returned from newINstance) to consider the attributes for

attributes:Map<K, V>

the attributes, a mutable set

Returns:boolean

true if the factory builder should use standard bean property matching for the remaining attributes

onNodeChildrenback to summary
public boolean onNodeChildren(FactoryBuilderSupport builder, Object node, Closure<V> childContent)

Only called if it isLeaf is false and isHandlesNodeChildren is true

Parameters
builder:FactoryBuilderSupport

the FactoryBuilder

node:Object

the node (returned from newINstance) to consider the attributes for

childContent:Closure<V>

the child content closure of the builder

Returns:boolean

true if the factory builder should apply default node processing to the content child

onNodeCompletedback to summary
public void onNodeCompleted(FactoryBuilderSupport builder, Object parent, Object node)
Parameters
builder:FactoryBuilderSupport

the FactoryBuilder

parent:Object

the parent node (null if 'root')

node:Object

the node just completed

setChildback to summary
public void setChild(FactoryBuilderSupport builder, Object parent, Object child)
setParentback to summary
public void setParent(FactoryBuilderSupport builder, Object parent, Object child)