public class SAXBuilder
extends BuilderSupport
A builder for generating W3C SAX events. Use similar to MarkupBuilder.
| Constructor and description |
|---|
SAXBuilder(ContentHandler handler)Creates a builder that forwards markup events to the supplied SAX content handler. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Object |
createNode(Object name)Builder lifecycle callback that starts an element with no attributes or body text. |
|
protected Object |
createNode(Object name, Object value)Builder lifecycle callback that starts an element and immediately emits text content. |
|
protected Object |
createNode(Object name, Map attributeMap, Object text)Builder lifecycle callback that starts an element, emits attributes and optionally emits text content. |
|
protected Object |
createNode(Object name, Map attributes)Builder lifecycle callback that starts an element and emits attributes without body text. |
|
protected void |
doStartElement(Object name, Attributes attributes)Emits a SAX startElement event for the supplied node name.
|
|
protected void |
handleException(SAXException e)Handles checked SAXExceptions raised while emitting SAX events. |
|
protected void |
nodeCompleted(Object parent, Object name)Builder lifecycle callback invoked when the current node is complete. |
|
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 builder that forwards markup events to the supplied SAX content handler.
handler - the content handler receiving generated SAX eventsBuilder lifecycle callback that starts an element with no attributes or body text.
name - the node nameBuilder lifecycle callback that starts an element and immediately emits text content.
name - the node namevalue - the text content to emitBuilder lifecycle callback that starts an element, emits attributes and optionally emits text content.
name - the node nameattributeMap - the attributes to expose through the SAX eventtext - the optional text content to emit after the start elementBuilder lifecycle callback that starts an element and emits attributes without body text.
name - the node nameattributes - the attributes to expose through the SAX event Emits a SAX startElement event for the supplied node name.
Subclasses may override to customize how start-element events are generated.
name - the node nameattributes - the attributes to include with the start-element eventHandles checked SAXExceptions raised while emitting SAX events. Subclasses may override to translate them differently.
ee - the SAX exception to handleBuilder lifecycle callback invoked when the current node is complete.
parent - the parent node markername - the completed node nameCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.