Package groovy.util
Class AbstractFactory
java.lang.Object
groovy.util.AbstractFactory
- All Implemented Interfaces:
Factory
- Direct Known Subclasses:
CustomizersFactory,ImportCustomizerFactory,InlinedASTCustomizerFactory,SecureASTCustomizerFactory,SourceAwareCustomizerFactory
public abstract class AbstractFactory extends java.lang.Object implements Factory
-
Constructor Summary
Constructors Constructor Description AbstractFactory() -
Method Summary
Modifier and Type Method Description booleanisHandlesNodeChildren()Does this factory "Own" its child closure.booleanisLeaf()voidonFactoryRegistration(FactoryBuilderSupport builder, java.lang.String registeredName, java.lang.String group)Called when a factory is registered to a builderbooleanonHandleNodeAttributes(FactoryBuilderSupport builder, java.lang.Object node, java.util.Map attributes)booleanonNodeChildren(FactoryBuilderSupport builder, java.lang.Object node, Closure childContent)Only called if it isLeaf is false and isHandlesNodeChildren is truevoidonNodeCompleted(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object node)voidsetChild(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object child)voidsetParent(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object child)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.util.Factory
newInstance
-
Constructor Details
-
AbstractFactory
public AbstractFactory()
-
-
Method Details
-
isLeaf
public boolean isLeaf() -
isHandlesNodeChildren
public boolean isHandlesNodeChildren()Description copied from interface:FactoryDoes this factory "Own" its child closure.- Specified by:
isHandlesNodeChildrenin interfaceFactory- Returns:
- true if the factory should have onContentClosure() called, false if the builder should handle it
-
onFactoryRegistration
public void onFactoryRegistration(FactoryBuilderSupport builder, java.lang.String registeredName, java.lang.String group)Description copied from interface:FactoryCalled when a factory is registered to a builder- Specified by:
onFactoryRegistrationin interfaceFactory- Parameters:
builder- the build the factory has been registered toregisteredName- the name the factory has been registered under
-
onHandleNodeAttributes
public boolean onHandleNodeAttributes(FactoryBuilderSupport builder, java.lang.Object node, java.util.Map attributes)- Specified by:
onHandleNodeAttributesin interfaceFactory- Parameters:
builder- the FactoryBuildernode- the node (returned from newINstance) to consider the attributes forattributes- the attributes, a mutable set- Returns:
- true if the factory builder should use standard bean property matching for the remaining attributes
-
onNodeChildren
public boolean onNodeChildren(FactoryBuilderSupport builder, java.lang.Object node, Closure childContent)Description copied from interface:FactoryOnly called if it isLeaf is false and isHandlesNodeChildren is true- Specified by:
onNodeChildrenin interfaceFactory- Parameters:
builder- the FactoryBuildernode- the node (returned from newINstance) to consider the attributes forchildContent- the child content closure of the builder- Returns:
- true if the factory builder should apply default node processing to the content child
-
onNodeCompleted
public void onNodeCompleted(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object node)- Specified by:
onNodeCompletedin interfaceFactory- Parameters:
builder- the FactoryBuilderparent- the parent node (null if 'root')node- the node just completed
-
setParent
public void setParent(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object child) -
setChild
public void setChild(FactoryBuilderSupport builder, java.lang.Object parent, java.lang.Object child)
-