|
Groovy 1.6.4 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.util.BuilderSupport
groovy.xml.MarkupBuilder
class MarkupBuilder extends BuilderSupport
A helper class for creating XML or HTML markup
Constructor Summary | |
MarkupBuilder()
|
|
MarkupBuilder(PrintWriter writer)
|
|
MarkupBuilder(Writer writer)
|
|
MarkupBuilder(IndentPrinter out)
|
Method Summary | |
---|---|
protected Object
|
createNode(Object name)
|
protected Object
|
createNode(Object name, Object value)
|
protected Object
|
createNode(Object name, Map attributes, Object value)
|
protected Object
|
createNode(Object name, Map attributes)
|
boolean
|
getDoubleQuotes()
Returns |
Object
|
getMkp()
|
protected Object
|
getName(String methodName)
|
protected IndentPrinter
|
getPrinter()
|
boolean
|
isOmitEmptyAttributes()
Determine whether empty attributes will appear in the produced markup. |
boolean
|
isOmitNullAttributes()
Determine whether null attributes will appear in the produced markup. |
protected void
|
nodeCompleted(Object parent, Object node)
|
protected void
|
print(Object node)
|
void
|
setDoubleQuotes(boolean useDoubleQuotes)
Sets whether the builder outputs attribute values in double quotes or single quotes. |
void
|
setOmitEmptyAttributes(boolean omitEmptyAttributes)
Allows empty attributes to be removed the produced markup. |
void
|
setOmitNullAttributes(boolean omitNullAttributes)
Allows null attributes to be removed the produced markup. |
protected void
|
setParent(Object parent, Object child)
|
protected String
|
transformValue(String value)
Returns a String with special XML characters escaped as entities so that output XML is valid. |
void
|
yield(String value)
|
void
|
yieldUnescaped(String value)
|
Methods inherited from class BuilderSupport | |
---|---|
createNode, createNode, createNode, createNode, doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, postNodeCompletion, setClosureDelegate, setCurrent, setParent |
Methods inherited from class GroovyObjectSupport | |
---|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Constructor Detail |
---|
public MarkupBuilder()
public MarkupBuilder(PrintWriter writer)
public MarkupBuilder(Writer writer)
public MarkupBuilder(IndentPrinter out)
Method Detail |
---|
protected Object createNode(Object name)
protected Object createNode(Object name, Object value)
protected Object createNode(Object name, Map attributes, Object value)
protected Object createNode(Object name, Map attributes)
public boolean getDoubleQuotes()
true
if attribute values are output with
double quotes; false
if single quotes are used.
By default, single quotes are used.
public Object getMkp()
protected Object getName(String methodName)
protected IndentPrinter getPrinter()
public boolean isOmitEmptyAttributes()
true
, if empty attributes will be
removed from the resulting markup.
public boolean isOmitNullAttributes()
true
, if null attributes will be
removed from the resulting markup.
protected void nodeCompleted(Object parent, Object node)
protected void print(Object node)
public void setDoubleQuotes(boolean useDoubleQuotes)
true
,
double quotes are used; otherwise, single quotes are.
public void setOmitEmptyAttributes(boolean omitEmptyAttributes)
true
, empty
attributes will not be included in the resulting markup.
Defaults to false
.
public void setOmitNullAttributes(boolean omitNullAttributes)
true
, null
attributes will not be included in the resulting markup.
If false
null attributes will be included in the
markup as empty strings regardless of the omitEmptyAttribute
setting. Defaults to false
.
protected void setParent(Object parent, Object child)
protected String transformValue(String value)
public void yield(String value)
public void yieldUnescaped(String value)
Copyright © 2003-2009 The Codehaus. All rights reserved.