groovy.xml
Class MarkupBuilder
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
groovy.xml.MarkupBuilder
- All Implemented Interfaces:
- GroovyObject
- public class MarkupBuilder
- extends BuilderSupport
A helper class for creating XML or HTML markup
- Version:
- $Revision: 1.10 $
- Author:
- James Strachan, Stefan Matthias Aust, Scott Stirling
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MarkupBuilder
public MarkupBuilder()
MarkupBuilder
public MarkupBuilder(PrintWriter writer)
MarkupBuilder
public MarkupBuilder(Writer writer)
MarkupBuilder
public MarkupBuilder(IndentPrinter out)
getPrinter
protected IndentPrinter getPrinter()
setParent
protected void setParent(Object parent,
Object child)
- Specified by:
setParent
in class BuilderSupport
createNode
protected Object createNode(Object name)
- Specified by:
createNode
in class BuilderSupport
createNode
protected Object createNode(Object name,
Object value)
- Specified by:
createNode
in class BuilderSupport
createNode
protected Object createNode(Object name,
Map attributes,
Object value)
- Specified by:
createNode
in class BuilderSupport
createNode
protected Object createNode(Object name,
Map attributes)
- Specified by:
createNode
in class BuilderSupport
nodeCompleted
protected void nodeCompleted(Object parent,
Object node)
- Description copied from class:
BuilderSupport
- A hook to allow nodes to be processed once they have had all of their
children applied
- Overrides:
nodeCompleted
in class BuilderSupport
print
protected void print(Object node)
getName
protected Object getName(String methodName)
- Description copied from class:
BuilderSupport
- A hook to allow names to be converted into some other object
such as a QName in XML or ObjectName in JMX
- Overrides:
getName
in class BuilderSupport
- Parameters:
methodName
-
- Returns:
transformName
protected String transformName(String name)
transformValue
protected String transformValue(String value)
- Returns a String with special XML characters escaped as entities so that
output XML is valid. Escapes the following characters as corresponding
entities:
- \' as "
- & as &
- < as <
- > as >
- Parameters:
value
- to be searched and replaced for XML special characters.
- Returns:
- value with XML characters escaped
Copyright © 2003-2005 The Codehaus. All Rights Reserved.