Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor and description |
---|
MarkupBuilderHelper
(MarkupBuilder builder) @param builder the builder to delegate to |
Type | Name and description |
---|---|
void |
comment(String value) Produce a comment in the output. |
void |
pi(Map<String, Map<String, Object>> args) Produce an XML processing instruction in the output. |
void |
xmlDeclaration(Map<String, Object> args) Produce an XML declaration in the output. |
void |
yield(Object value) Prints data in the body of the current tag, escaping XML entities. |
void |
yield(String value) Prints data in the body of the current tag, escaping XML entities. |
void |
yieldUnescaped(Object value) Print data in the body of the current tag. |
void |
yieldUnescaped(String value) Print data in the body of the current tag. |
builder
- the builder to delegate toProduce 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>
value
- the text within the comment.Produce an XML processing instruction in the output. For example:
mkp.pi("xml-stylesheet":[href:"mystyle.css", type:"text/css"])
args
- 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.Produce an XML declaration in the output. For example:
mkp.xmlDeclaration(version:'1.0')
args
- the attributes for the declaration Prints data in the body of the current tag, escaping XML entities.
For example: mkp.yield('5 < 7')
value
- an Object whose toString() representation is to be printed Prints data in the body of the current tag, escaping XML entities.
For example: mkp.yield('5 < 7')
value
- text to print Print data in the body of the current tag. Does not escape XML entities.
For example: mkp.yieldUnescaped('I am <i>happy</i>!')
.
value
- an Object whose toString() representation is to be printed Print data in the body of the current tag. Does not escape XML entities.
For example: mkp.yieldUnescaped('I am <i>happy</i>!')
.
value
- the text or markup to print.Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.