|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.plugins.rhnhosted.certificate.XmlTag
public class XmlTag
XmlTag a simple class to render an XML tag
| Field Summary | |
|---|---|
static String |
XML_HDR
Standard xml header with no encoding. |
static String |
XML_HDR_UTF8
Standard xml header with utf-8 encoding. |
| Constructor Summary | |
|---|---|
protected |
XmlTag(String tagIn)
Public constructor |
protected |
XmlTag(String tagIn,
boolean spaceBefore)
Constructs an XmlTag. |
| Method Summary | |
|---|---|
void |
addBody(String bodyIn)
set the body of the tag |
void |
addBody(XmlTag bodyTag)
Adds the given tag to the body of this tag. |
boolean |
hasBody()
Returns true if this tag has a body defined. |
void |
removeAttribute(String name)
Removes an attribute of the html tag. |
String |
render()
render the tag into a string |
String |
renderBody()
render the tag body |
String |
renderCloseTag()
render the close tag |
String |
renderOpenTag()
render the open tag and attributes |
void |
setAttribute(String name,
String value)
set an attribute of the html tag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_HDR_UTF8
StringBuffer buf = new StringBuffer();
buf.append(XmlTag.XML_HDR_UTF8);
buf.append(new XmlTag("foo").render());
public static final String XML_HDR
StringBuffer buf = new StringBuffer();
buf.append(XmlTag.XML_HDR);
buf.append(new XmlTag("foo").render());
| Constructor Detail |
|---|
protected XmlTag(String tagIn)
tagIn - the name of the tag
protected XmlTag(String tagIn,
boolean spaceBefore)
spaceBefore attribute controls
whether a space is inserted before the closing tag of a single line
element.
tagIn - the name of the tagspaceBefore - true if you want a space before the closing tag.| Method Detail |
|---|
public void setAttribute(String name,
String value)
name - the attribute namevalue - the attribute valuepublic void removeAttribute(String name)
name - the attribute name to be removed.public void addBody(String bodyIn)
bodyIn - the new bodypublic void addBody(XmlTag bodyTag)
bodyTag - Tag to be added to the body of this tag.public String render()
public String renderOpenTag()
public String renderBody()
public String renderCloseTag()
public boolean hasBody()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||