public class SimpleXml.Element
extends java.lang.Object
SimpleXml.Element
reperesents an XML element.Modifier and Type | Method and Description |
---|---|
SimpleXml.Element |
addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.String value,
java.lang.String type)
Adds a new attribute to the XML element.
|
SimpleXml.Element |
attr(java.lang.String name,
java.lang.String value)
Adds a new attribute to the XML element.
|
SimpleXml.Element |
attr(java.lang.String localName,
java.lang.String name,
java.lang.String value)
Adds a new attribute to the XML element.
|
SimpleXml.Element |
attr(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.String value,
java.lang.String type)
Adds a new attribute to the XML element.
|
SimpleXml.Element |
attrs(java.lang.String[]... atts)
Adds the specified attributes to the XML element.
|
SimpleXml |
close()
Explicitly closes the XML element.
|
boolean |
hasCDATA()
States whether the XML element has a CDATA block.
|
SimpleXml |
open()
Explicitly opens the XML element.
|
SimpleXml.Element |
open(java.lang.String name)
Opens and returns a new XML element with the specified name.
|
SimpleXml.Element |
open(java.lang.String localName,
java.lang.String name)
Opens and returns a new XML element with the specified name.
|
SimpleXml.Element |
open(java.lang.String name,
java.lang.String content,
boolean cdata)
Opens and returns a new XML element with the specified name and content.
|
SimpleXml.Element |
open(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
Opens and returns a new XML element with the specified name.
|
SimpleXml.Element |
setCDATA(boolean cdata)
Defines whether the XML element has a CDATA block.
|
SimpleXml.Element |
setText(java.lang.String text,
boolean cdata)
Sets the content of the XML element.
|
SimpleXml.Element |
text(java.lang.String text)
Sets the content of the XML element.
|
SimpleXml.Element |
text(java.lang.String text,
boolean cdata)
Sets the content of the XML element.
|
public SimpleXml.Element attr(java.lang.String name, java.lang.String value)
addAttribute(String, String, String, String, String)
.name
- The name of the attributevalue
- The value of the attributepublic SimpleXml.Element attr(java.lang.String localName, java.lang.String name, java.lang.String value)
addAttribute(String, String, String, String, String)
.localName
- The local name of the attributename
- The name of the attributevalue
- The value of the attributepublic SimpleXml.Element attr(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.String value, java.lang.String type)
addAttribute(String, String, String, String, String)
.uri
- The URI of the attributelocalName
- The local name of the attributename
- The name of the attributevalue
- The value of the attributetype
- The type of the attributepublic SimpleXml.Element attrs(java.lang.String[]... atts)
atts
- The attributespublic SimpleXml.Element addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.String value, java.lang.String type)
uri
- The URI of the attributelocalName
- The local name of the attributename
- The name of the attributevalue
- The value of the attributetype
- The type of the attributepublic SimpleXml.Element text(java.lang.String text)
setText(String, boolean)
.text
- The contentpublic SimpleXml.Element text(java.lang.String text, boolean cdata)
setText(String, boolean)
.text
- The contentcdata
- true
if content should be in a CDATA block,
false
otherwisepublic SimpleXml.Element setText(java.lang.String text, boolean cdata)
text
- The contentcdata
- true
if content should be in a CDATA block,
false
otherwisepublic SimpleXml.Element setCDATA(boolean cdata)
cdata
- true
if the XML element has a CDATA block,
false
otherwisepublic SimpleXml open() throws java.io.IOException
java.io.IOException
- If output failspublic SimpleXml.Element open(java.lang.String name) throws java.io.IOException
SimpleXml
.name
- The name of the XML elementjava.io.IOException
- If output failsSimpleXml.open(String)
public SimpleXml.Element open(java.lang.String localName, java.lang.String name) throws java.io.IOException
SimpleXml
.localName
- The local name of the XML elementname
- The name of the XML elementjava.io.IOException
- If output failsSimpleXml.open(String, String)
public SimpleXml.Element open(java.lang.String uri, java.lang.String localName, java.lang.String name) throws java.io.IOException
SimpleXml
.uri
- The URI of the XML elementlocalName
- The local name of the XML elementname
- The name of the XML elementjava.io.IOException
- If output failsSimpleXml.open(String, String, String)
public SimpleXml.Element open(java.lang.String name, java.lang.String content, boolean cdata) throws java.io.IOException
SimpleXml
.name
- The name of the XML elementcontent
- The content of the XML elementcdata
- true
if content should be in a CDATA block,
false
otherwisejava.io.IOException
- If output failsSimpleXml.open(String, String, boolean)
public SimpleXml close() throws java.io.IOException
java.io.IOException
- If output failspublic boolean hasCDATA()
true
if the XML element has a CDATA block,
false
otherwiseCopyright © 2010 - 2020 Adobe. All Rights Reserved