public class NamespaceBuilderSupport
extends BuilderSupport
A helper class for creating namespaced GroovyMarkup
| Constructor and description |
|---|
NamespaceBuilderSupport(BuilderSupport builder)Creates a namespace-aware wrapper around the supplied builder. |
NamespaceBuilderSupport(BuilderSupport builder, String uri)Creates a namespace-aware wrapper and binds the default prefix to the supplied namespace URI. |
NamespaceBuilderSupport(BuilderSupport builder, String uri, String prefix)Creates a namespace-aware wrapper and binds the supplied prefix to the supplied namespace URI. |
NamespaceBuilderSupport(BuilderSupport builder, String uri, String prefix, boolean autoPrefix)Creates a namespace-aware wrapper with optional automatic prefixing for unqualified method names. |
NamespaceBuilderSupport(BuilderSupport builder, Map nsMap)Creates a namespace-aware wrapper using the supplied prefix-to-URI mappings. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Object |
createNode(Object name)Builder lifecycle callback that keeps the resolved node name for the wrapped builder. |
|
protected Object |
createNode(Object name, Object value)Builder lifecycle callback that keeps the resolved node name for the wrapped builder. |
|
protected Object |
createNode(Object name, Map attributes)Builder lifecycle callback that keeps the resolved node name for the wrapped builder. |
|
protected Object |
createNode(Object name, Map attributes, Object value)Builder lifecycle callback that keeps the resolved node name for the wrapped builder. |
|
public NamespaceBuilderSupport |
declareNamespace(Map nsMap)Replaces the current namespace mappings used to resolve subsequent builder calls. |
|
protected Object |
getCurrent()Builder lifecycle callback that exposes the wrapped builder's current node. |
|
protected Object |
getName(String methodName)Resolves a builder method name into a namespace-aware node name. |
|
public Object |
invokeMethod(String methodName, Object args)Allow automatic detection of namespace declared in the attributes |
|
public NamespaceBuilderSupport |
namespace(String namespaceURI)Associates the default prefix with the supplied namespace URI. |
|
public NamespaceBuilderSupport |
namespace(String namespaceURI, String prefix)Associates the supplied prefix with the supplied namespace URI. |
|
protected void |
setCurrent(Object current)Builder lifecycle callback that updates the wrapped builder's current node marker. |
|
protected void |
setParent(Object parent, Object child)Builder lifecycle callback invoked after a child node has been created. |
| Methods inherited from class | Name |
|---|---|
class BuilderSupport |
createNode, createNode, createNode, createNode, doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, postNodeCompletion, setClosureDelegate, setCurrent, setParent |
class GroovyObjectSupport |
getMetaClass, setMetaClass |
Creates a namespace-aware wrapper around the supplied builder.
builder - the builder to wrapCreates a namespace-aware wrapper and binds the default prefix to the supplied namespace URI.
builder - the builder to wrapuri - the namespace URI to bind to the default prefixCreates a namespace-aware wrapper and binds the supplied prefix to the supplied namespace URI.
builder - the builder to wrapuri - the namespace URI to bindprefix - the prefix to associate with uriCreates a namespace-aware wrapper with optional automatic prefixing for unqualified method names.
builder - the builder to wrapuri - the namespace URI to bindprefix - the prefix to associate with uriautoPrefix - whether the configured prefix should be applied automaticallyCreates a namespace-aware wrapper using the supplied prefix-to-URI mappings.
builder - the builder to wrapnsMap - the namespace mappings to useBuilder lifecycle callback that keeps the resolved node name for the wrapped builder.
name - the resolved node nameBuilder lifecycle callback that keeps the resolved node name for the wrapped builder.
name - the resolved node namevalue - the node value supplied by the builder callBuilder lifecycle callback that keeps the resolved node name for the wrapped builder.
name - the resolved node nameattributes - the attributes supplied by the builder callBuilder lifecycle callback that keeps the resolved node name for the wrapped builder.
name - the resolved node nameattributes - the attributes supplied by the builder callvalue - the node value supplied by the builder callReplaces the current namespace mappings used to resolve subsequent builder calls.
nsMap - the prefix-to-URI mappings to useBuilder lifecycle callback that exposes the wrapped builder's current node. Subclasses may override to customize how builder state is shared.
Resolves a builder method name into a namespace-aware node name. Subclasses may override to customize method-to-QName resolution.
methodName - the method name invoked on the wrapperAllow automatic detection of namespace declared in the attributes
methodName - the builder method being invokedargs - the builder arguments, including any attribute mapAssociates the default prefix with the supplied namespace URI.
namespaceURI - the namespace URI to bindAssociates the supplied prefix with the supplied namespace URI.
namespaceURI - the namespace URI to bindprefix - the prefix to associate with namespaceURIBuilder lifecycle callback that updates the wrapped builder's current node marker. Subclasses may override to customize how builder state is shared.
current - the new current node markerCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.