Class ImportCustomizerFactory
java.lang.Object
groovy.util.AbstractFactory
org.codehaus.groovy.control.customizers.builder.ImportCustomizerFactory
- All Implemented Interfaces:
Factory
This factory allows the generation of an
import customizer. You may embed several
elements:
- normal for "regular" imports
- star for "star" imports
- staticStar for "static star" imports
- alias for imports with alias
- staticMember for static imports of individual members
- module for module imports (JEP 476)
builder.imports {
alias 'AI', 'java.util.concurrent.atomic.AtomicInteger'
alias 'AL', 'java.util.concurrent.atomic.AtomicLong'
}- Since:
- 2.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates that import customizer nodes accept nested closure content.newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) Creates an import customizer and applies any inline import value.booleanonNodeChildren(FactoryBuilderSupport builder, Object node, Closure childContent) Executes nested builder content against a helper bound to the import customizer.Methods inherited from class groovy.util.AbstractFactory
isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeCompleted, setChild, setParent
-
Constructor Details
-
ImportCustomizerFactory
public ImportCustomizerFactory()
-
-
Method Details
-
isHandlesNodeChildren
public boolean isHandlesNodeChildren()Indicates that import customizer nodes accept nested closure content.- Specified by:
isHandlesNodeChildrenin interfaceFactory- Overrides:
isHandlesNodeChildrenin classAbstractFactory- Returns:
true
-
newInstance
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException Creates an import customizer and applies any inline import value.- Parameters:
builder- the active buildername- the node namevalue- the supplied node valueattributes- the node attributes- Returns:
- a configured
ImportCustomizer - Throws:
InstantiationException- if instantiation failsIllegalAccessException- if access fails
-
onNodeChildren
Executes nested builder content against a helper bound to the import customizer.- Specified by:
onNodeChildrenin interfaceFactory- Overrides:
onNodeChildrenin classAbstractFactory- Parameters:
builder- the active buildernode- the current nodechildContent- the nested closure content- Returns:
falseto continue normal processing
-