public class MarkupBuilder extends BuilderSupport
| Constructor and Description |
|---|
MarkupBuilder() |
MarkupBuilder(IndentPrinter out) |
MarkupBuilder(java.io.PrintWriter writer) |
MarkupBuilder(java.io.Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
createNode(java.lang.Object name) |
protected java.lang.Object |
createNode(java.lang.Object name,
java.util.Map attributes) |
protected java.lang.Object |
createNode(java.lang.Object name,
java.util.Map attributes,
java.lang.Object value) |
protected java.lang.Object |
createNode(java.lang.Object name,
java.lang.Object value) |
boolean |
getDoubleQuotes()
Returns
true if attribute values are output with
double quotes; false if single quotes are used. |
java.lang.Object |
getMkp() |
protected java.lang.Object |
getName(java.lang.String methodName)
A hook to allow names to be converted into some other object
such as a QName in XML or ObjectName in JMX.
|
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(java.lang.Object parent,
java.lang.Object node)
A hook to allow nodes to be processed once they have had all of their
children applied.
|
protected void |
print(java.lang.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(java.lang.Object parent,
java.lang.Object child) |
protected java.lang.String |
transformValue(java.lang.String value)
Deprecated.
|
void |
yield(java.lang.String value) |
void |
yieldUnescaped(java.lang.String value) |
doInvokeMethod, getCurrent, invokeMethod, invokeMethod, postNodeCompletion, setClosureDelegate, setCurrentgetMetaClass, getProperty, setMetaClass, setPropertypublic MarkupBuilder()
public MarkupBuilder(java.io.PrintWriter writer)
public MarkupBuilder(java.io.Writer writer)
public MarkupBuilder(IndentPrinter out)
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 void setDoubleQuotes(boolean useDoubleQuotes)
useDoubleQuotes - If this parameter is true,
double quotes are used; otherwise, single quotes are.public boolean isOmitNullAttributes()
true, if null attributes will be
removed from the resulting markup.public void setOmitNullAttributes(boolean omitNullAttributes)
omitNullAttributes - if 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.public boolean isOmitEmptyAttributes()
true, if empty attributes will be
removed from the resulting markup.public void setOmitEmptyAttributes(boolean omitEmptyAttributes)
omitEmptyAttributes - if true, empty
attributes will not be included in the resulting markup.
Defaults to false.protected IndentPrinter getPrinter()
protected void setParent(java.lang.Object parent,
java.lang.Object child)
setParent in class BuilderSupportpublic java.lang.Object getMkp()
public void yield(java.lang.String value)
public void yieldUnescaped(java.lang.String value)
protected java.lang.Object createNode(java.lang.Object name)
createNode in class BuilderSupportprotected java.lang.Object createNode(java.lang.Object name,
java.lang.Object value)
createNode in class BuilderSupportprotected java.lang.Object createNode(java.lang.Object name,
java.util.Map attributes,
java.lang.Object value)
createNode in class BuilderSupportprotected java.lang.Object createNode(java.lang.Object name,
java.util.Map attributes)
createNode in class BuilderSupportprotected void nodeCompleted(java.lang.Object parent,
java.lang.Object node)
BuilderSupportnodeCompleted in class BuilderSupportparent - the parent of the node being processednode - the current node being processedprotected void print(java.lang.Object node)
protected java.lang.Object getName(java.lang.String methodName)
BuilderSupportgetName in class BuilderSupportmethodName - the name of the desired methodprotected java.lang.String transformValue(java.lang.String value)
value - to be searched and replaced for XML special characters.escapeXmlValue(String, boolean)