public interface SimpleXMLBuilder
Modifier and Type | Method and Description |
---|---|
default <X> void |
addObject(X target)
Add an object depending on its type.
|
SimpleXMLBuilder |
appendParent()
Append the contents of this builder to the parent (if any).
|
default SimpleXMLBuilder |
attr(java.util.Map<java.lang.String,java.lang.String> attr) |
SimpleXMLBuilder |
attr(java.lang.String name,
java.lang.CharSequence s)
Add an attribute.
|
SimpleXMLBuilder |
clean(char c) |
SimpleXMLBuilder |
clean(java.lang.CharSequence s)
append text to the document escaping any characters that might be interpreted as XML markup.
|
SimpleXMLBuilder |
clean(java.lang.Number i)
Append text representation of the number
|
SimpleXMLBuilder |
close()
close the last opened tag.
|
SimpleXMLBuilder |
getNested()
Get a new SimpleXMLBuilder of the same type as this object.
|
SimpleXMLBuilder |
getParent()
Get the parent object.
|
SimpleXMLBuilder |
open(java.lang.String tag)
open a tag
|
SimpleXMLBuilder |
open(java.lang.String tag,
java.lang.String[][] attr)
open a tag with attributes.
|
boolean |
setEscapeUnicode(boolean escape_unicode)
Should high code-point unicode characters be escaped to
avoid charset problems.
|
SimpleXMLBuilder clean(java.lang.CharSequence s)
s
- SimpleXMLBuilder clean(char c)
SimpleXMLBuilder clean(java.lang.Number i)
i
- Number to formatSimpleXMLBuilder open(java.lang.String tag)
tag
- SimpleXMLBuilder open(java.lang.String tag, java.lang.String[][] attr)
tag
- tag to openattr
- array of name,value pairsSimpleXMLBuilder attr(java.lang.String name, java.lang.CharSequence s)
name
- String attribute names
- CharSequence attribute value or null for no valuedefault SimpleXMLBuilder attr(java.util.Map<java.lang.String,java.lang.String> attr)
SimpleXMLBuilder close()
SimpleXMLBuilder getNested() throws java.lang.UnsupportedOperationException
appendParent()
method.
The calling code need only hold a reference to the current builder as the
appendParent()
method returns the parent.java.lang.UnsupportedOperationException
SimpleXMLBuilder appendParent() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
SimpleXMLBuilder getParent()
boolean setEscapeUnicode(boolean escape_unicode)
escape_unicode
- default <X> void addObject(X target)
#addParent()
on child objects.target
-