|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.day.cq.commons.SimpleXml.Element
public class SimpleXml.Element
The SimpleXml.Element reperesents an XML element.
| Constructor Summary | |
|---|---|
protected |
SimpleXml.Element(String uri,
String localName,
String name)
Creates a new SimpleXML.Element instance using the specified URI, local name and name. |
| Method Summary | |
|---|---|
SimpleXml.Element |
addAttribute(String uri,
String localName,
String name,
String value,
String type)
Adds a new attribute to the XML element. |
SimpleXml.Element |
attr(String name,
String value)
Adds a new attribute to the XML element. |
SimpleXml.Element |
attr(String localName,
String name,
String value)
Adds a new attribute to the XML element. |
SimpleXml.Element |
attr(String uri,
String localName,
String name,
String value,
String type)
Adds a new attribute to the XML element. |
SimpleXml.Element |
attrs(String[]... atts)
Adds the specified attributes to the XML element. |
SimpleXml |
close()
Explicitly closes the XML element. |
protected AttributesImpl |
getAttributes()
Returns the attributes of the XML element. |
protected String |
getLocalName()
Returns the local name of the XML element. |
protected String |
getName()
Returns the name of the XML element. |
protected String |
getText()
Returns the content of the XML element. |
protected String |
getUri()
Returns the URI of the XML element. |
protected SimpleXml |
getWriter()
Returns the underlying XML writer |
boolean |
hasCDATA()
States whether the XML element has a CDATA block. |
protected boolean |
isClosed()
States whether the output of the XML element has been ended. |
protected boolean |
isOpened()
States whether the output of the XML element has been started. |
SimpleXml |
open()
Explicitly opens the XML element. |
SimpleXml.Element |
open(String name)
Opens and returns a new XML element with the specified name. |
SimpleXml.Element |
open(String localName,
String name)
Opens and returns a new XML element with the specified name. |
SimpleXml.Element |
open(String name,
String content,
boolean cdata)
Opens and returns a new XML element with the specified name and content. |
SimpleXml.Element |
open(String uri,
String localName,
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. |
protected void |
setClosed(boolean closed)
Defines whether the output of the XML element has been ended. |
protected void |
setOpened(boolean opened)
Defines whether the output of the XML element has been started. |
SimpleXml.Element |
setText(String text,
boolean cdata)
Sets the content of the XML element. |
SimpleXml.Element |
text(String text)
Sets the content of the XML element. |
SimpleXml.Element |
text(String text,
boolean cdata)
Sets the content of the XML element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SimpleXml.Element(String uri,
String localName,
String name)
uri - The URI of the XML elementlocalName - The local name of the XML elementname - The name of the XML element| Method Detail |
|---|
public SimpleXml.Element attr(String name,
String value)
addAttribute(String, String, String, String, String).
name - The name of the attributevalue - The value of the attribute
public SimpleXml.Element attr(String localName,
String name,
String value)
addAttribute(String, String, String, String, String).
localName - The local name of the attributename - The name of the attributevalue - The value of the attribute
public SimpleXml.Element attr(String uri,
String localName,
String name,
String value,
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 attribute
public SimpleXml.Element attrs(String[]... atts)
atts - The attributes
public SimpleXml.Element addAttribute(String uri,
String localName,
String name,
String value,
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 attribute
public SimpleXml.Element text(String text)
setText(String, boolean).
text - The content
public SimpleXml.Element text(String text,
boolean cdata)
setText(String, boolean).
text - The contentcdata - true if content should be in a CDATA block,
false otherwise
public SimpleXml.Element setText(String text,
boolean cdata)
text - The contentcdata - true if content should be in a CDATA block,
false otherwise
public SimpleXml.Element setCDATA(boolean cdata)
cdata - true if the XML element has a CDATA block,
false otherwise
public SimpleXml open()
throws IOException
IOException - If output fails
public SimpleXml.Element open(String name)
throws IOException
SimpleXml.
name - The name of the XML element
IOException - If output failsSimpleXml.open(String)
public SimpleXml.Element open(String localName,
String name)
throws IOException
SimpleXml.
localName - The local name of the XML elementname - The name of the XML element
IOException - If output failsSimpleXml.open(String, String)
public SimpleXml.Element open(String uri,
String localName,
String name)
throws IOException
SimpleXml.
uri - The URI of the XML elementlocalName - The local name of the XML elementname - The name of the XML element
IOException - If output failsSimpleXml.open(String, String, String)
public SimpleXml.Element open(String name,
String content,
boolean cdata)
throws 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 otherwise
IOException - If output failsSimpleXml.open(String, String, boolean)
public SimpleXml close()
throws IOException
IOException - If output failspublic boolean hasCDATA()
true if the XML element has a CDATA block,
false otherwiseprotected SimpleXml getWriter()
protected boolean isOpened()
true if the output has been started,
false otherwiseprotected void setOpened(boolean opened)
opened - true if the output has been started,
false otherwiseprotected boolean isClosed()
true if the output has been ended,
false otherwiseprotected void setClosed(boolean closed)
closed - true if the output has been ended,
false otherwiseprotected AttributesImpl getAttributes()
protected String getUri()
protected String getLocalName()
protected String getName()
protected String getText()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||