Top Description Fields Constructors Methods
groovy.xml

public Class MarkupBuilderHelper

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map

A helper class for MarkupBuilder.

Field Summary

Modifier and TypeField and Description
private final MarkupBuilder

Constructor Summary

AccessConstructor and Description
public
MarkupBuilderHelper(MarkupBuilder
the builder to delegate to
builder
)

Method Summary

Modifier and TypeMethod and Description
public void
comment(String
the text within the comment.
value
)

Produce a comment in the output.

public void
pi(Map<String, Map<String, Object>>
a map with a single entry whose key is the name of the processing instruction and whose value is the attributes for the processing instruction.
args
)

Produce an XML processing instruction in the output.

public void
xmlDeclaration(Map<String, Object>
the attributes for the declaration
args
)

Produce an XML declaration in the output.

public void
yield(Object
an Object whose toString() representation is to be printed
value
)

Prints data in the body of the current tag, escaping XML entities.

public void
yield(String
text to print
value
)

Prints data in the body of the current tag, escaping XML entities.

public void
yieldUnescaped(Object
an Object whose toString() representation is to be printed
value
)

Print data in the body of the current tag.

public void
yieldUnescaped(String
the text or markup to print.
value
)

Print data in the body of the current tag.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builderback to summary
private final MarkupBuilder builder

Constructor Detail

MarkupBuilderHelperback to summary
public MarkupBuilderHelper(MarkupBuilder builder)
Parameters
builder:MarkupBuilder

the builder to delegate to

Method Detail

commentback to summary
public void comment(String value)

Produce a comment in the output.

mkp.comment 'string' is equivalent to mkp.yieldUnescaped '<!-- string -->'. To create an element with the name 'comment', you need to supply empty attributes, e.g.:

comment('hello1')
or
mkp.comment('hello1')
will produce:
<!-- hello1 -->
while:
comment('hello2', [:])
will produce:
<comment>hello2</comment>
Parameters
value:String

the text within the comment.

piback to summary
public void pi(Map<String, Map<String, Object>> args)

Produce an XML processing instruction in the output. For example:

mkp.pi("xml-stylesheet":[href:"mystyle.css", type:"text/css"])
Parameters
args:Map<String, Map<String, Object>>

a map with a single entry whose key is the name of the processing instruction and whose value is the attributes for the processing instruction.

xmlDeclarationback to summary
public void xmlDeclaration(Map<String, Object> args)

Produce an XML declaration in the output. For example:

mkp.xmlDeclaration(version:'1.0')
Parameters
args:Map<String, Object>

the attributes for the declaration

yieldback to summary
public void yield(Object value)

Prints data in the body of the current tag, escaping XML entities. For example: mkp.yield('5 < 7')

Parameters
value:Object

an Object whose toString() representation is to be printed

yieldback to summary
public void yield(String value)

Prints data in the body of the current tag, escaping XML entities. For example: mkp.yield('5 < 7')

Parameters
value:String

text to print

yieldUnescapedback to summary
public void yieldUnescaped(Object value)

Print data in the body of the current tag. Does not escape XML entities. For example: mkp.yieldUnescaped('I am <i>happy</i>!').

Parameters
value:Object

an Object whose toString() representation is to be printed

yieldUnescapedback to summary
public void yieldUnescaped(String value)

Print data in the body of the current tag. Does not escape XML entities. For example: mkp.yieldUnescaped('I am <i>happy</i>!').

Parameters
value:String

the text or markup to print.