Class XMLRenderer
java.lang.Object
org.deltava.taglib.XMLRenderer
A helper class to generate XML elements with attributes.
- Since:
- 1.0
- Version:
- 5.0
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all element attributes.close()
Renders the close element tag as XML.Gets an element attribute.getName()
Returns the XML element name.boolean
Returns whether the element has a particular attribute.open
(boolean completeTag) Renders the open element tag as XML.open
(boolean completeTag, boolean finishTag) Renders the open element tag as XML.void
Removes an attribute from the element.void
setAttribute
(String name, String value) Sets an element attribute.
-
Constructor Details
-
XMLRenderer
Creates a new XML element, with a lowercase name.- Parameters:
name
- the element nam- Throws:
NullPointerException
- if name is null
-
-
Method Details
-
getName
-
has
Returns whether the element has a particular attribute.- Parameters:
name
- the attribute name- Returns:
- TRUE if the attribute exists, otherwise FALSE
-
clear
public void clear()Clears all element attributes. -
remove
Removes an attribute from the element.- Parameters:
name
- the attribute name
-
setAttribute
-
get
-
open
Renders the open element tag as XML.- Parameters:
completeTag
- TRUE if the tag should be completed, otherwise FALSEfinishTag
- TRUE if the tag should be finished, otherwise FALSE- Returns:
- the element rendered to XML
-
open
Renders the open element tag as XML.- Parameters:
completeTag
- TRUE if the tag should be completed, otherwise FALSE- Returns:
- the element rendered to XML
-
close
-