Element@Deprecated public class ElementBuilder extends Object
Element instances.
This class is not thread-safe; it should not be used from different threads at the same time.
| Constructor and Description |
|---|
ElementBuilder()
Deprecated.
Creates a new
ElementBuilder. |
ElementBuilder(String localName)
Deprecated.
Creates a new
ElementBuilder. |
ElementBuilder(String namespaceURI,
String localName)
Deprecated.
Creates a new
ElementBuilder. |
ElementBuilder(String namespacePrefix,
String namespaceURI,
String localName)
Deprecated.
Creates a new
ElementBuilder. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Element child)
Deprecated.
Adds a new child element.
|
void |
addXMLChild(String xmlChild)
Deprecated.
Adds a new child element.
|
Element |
createElement()
Deprecated.
Creates the
Element. |
void |
setAttribute(String localName,
String value)
Deprecated.
Sets the specified attribute.
|
void |
setAttribute(String namespaceURI,
String localName,
String value)
Deprecated.
Sets the specified attribute.
|
void |
setAttribute(String namespacePrefix,
String namespaceURI,
String localName,
String value)
Deprecated.
Sets the specified attribute.
|
void |
setText(String text)
Deprecated.
Sets the character content.
|
void |
startElement(String localName)
Deprecated.
Starts to create a new
Element with the given local name. |
void |
startElement(String namespaceURI,
String localName)
Deprecated.
Starts to create a new
Element. |
void |
startElement(String namespacePrefix,
String namespaceURI,
String localName)
Deprecated.
Starts to create a new
Element. |
public ElementBuilder()
ElementBuilder.public ElementBuilder(String localName) throws IllegalArgumentException
ElementBuilder.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public ElementBuilder(String namespaceURI, String localName) throws IllegalArgumentException
ElementBuilder.namespaceURI - the namespace URI for the element, can be null; an empty
string is equivalent to null.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public ElementBuilder(String namespacePrefix, String namespaceURI, String localName) throws IllegalArgumentException
ElementBuilder.namespacePrefix - the namespace prefix for the element, can be null; an empty
string is equivalent to null.namespaceURI - the namespace URI for the element, can be null; an empty
string is equivalent to null.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public void setAttribute(String localName, String value) throws IllegalArgumentException
localName - the local name for the attribute, cannot be null.value - the value for the attribute, can be null.IllegalArgumentException - if localName == null.public void setAttribute(String namespaceURI, String localName, String value) throws IllegalArgumentException
namespaceURI - the namespace URI for the attribute, can be null; an
empty string is equivalent to null.localName - the local name for the attribute, cannot be null.value - the value for the attribute, can be null.IllegalArgumentException - if localName == null.public void setAttribute(String namespacePrefix, String namespaceURI, String localName, String value) throws IllegalArgumentException
namespacePrefix - the namespace prefix for the attribute, can be null; an
empty string is equivalent to null.namespaceURI - the namespace URI for the attribute, can be null; an
empty string is equivalent to null.localName - the local name for the attribute, cannot be null.value - the value for the attribute, can be null.IllegalArgumentException - if localName == null.public void addChild(Element child) throws IllegalArgumentException
child - the new child to add to this element, cannot be null.IllegalArgumentException - if child == null || child == this.public void addXMLChild(String xmlChild) throws ParseException, IllegalArgumentException
xmlChild - the character string that contains the XML that defines the new
child to add to this element, cannot be null.ParseException - if the String passed as argument cannot be parsed.IllegalArgumentException - if child == null.public void setText(String text)
text - the character content for this element, or null.public void startElement(String localName) throws IllegalArgumentException
Element with the given local name.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public void startElement(String namespaceURI, String localName) throws IllegalArgumentException
Element.namespaceURI - the namespace URI for the element, can be null; an empty
string is equivalent to null.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public void startElement(String namespacePrefix, String namespaceURI, String localName) throws IllegalArgumentException
Element.namespacePrefix - the namespace prefix for the element, can be null; an empty
string is equivalent to null.namespaceURI - the namespace URI for the element, can be null; an empty
string is equivalent to null.localName - the local name of the element, cannot be null.IllegalArgumentException - if localName == null.public Element createElement()
Element.
If you want to reuse this ElementBuilder you will need
to call the startElement(String) or
startElement(String,String) method.Element, never null.See http://www.xins.org/.