|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deckfour.spex.SXNode org.deckfour.spex.SXTag
public class SXTag
This class represents regular tag nodes in XML. WARNING: The usage contract for this class is as follows:
SXDocument
Field Summary | |
---|---|
protected boolean |
isOpen
Whether this tag ist still open (i.e., closing bracket not written yet) |
protected SXNode |
lastChildNode
The last opened child node of this tag. |
protected String |
name
Name of this tag (contents between brackets) |
Fields inherited from class org.deckfour.spex.SXNode |
---|
tabLevel, tabString, writer |
Constructor Summary | |
---|---|
SXTag(String aName,
Writer aWriter,
int aTabLevel,
String aTabString)
Creates a new tag instance. |
Method Summary | |
---|---|
void |
addAttribute(String aName,
String aValue)
Adds an attribute to this tag node. |
SXTag |
addChildNode(String tagName)
Adds a regular tag child node with the specified tag name to this node. |
void |
addComment(String comment)
Adds a comment to this node. |
void |
addTextNode(String text)
Adds a text child node to this node. |
void |
close()
Closes and finalizes this node. |
Methods inherited from class org.deckfour.spex.SXNode |
---|
getTabLevel, indentLine |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected SXNode lastChildNode
protected boolean isOpen
Constructor Detail |
---|
public SXTag(String aName, Writer aWriter, int aTabLevel, String aTabString) throws IOException
<aName/>
WARNING: Tags must not be instantiated manually, but by appending to another tag or document.
aName
- Name of the tagaWriter
- Writer used for writing the tag toaTabLevel
- Tabulator indentation level of this tagaTabString
- String containing the encoding of a tabulator
IOException
Method Detail |
---|
public void addAttribute(String aName, String aValue) throws IOException
aName=aValue
WARNING:
aName
- Name, i.e. key, of this attributeaValue
- Value of this attribute
IOException
public SXTag addChildNode(String tagName) throws IOException
tagName
- Name of the tag node to be added
IOException
public void addTextNode(String text) throws IOException
text
- Text to be added
IOException
public void addComment(String comment) throws IOException
comment
- Text of the comment to be added (without leading and trailing
XML-style comment indicators!).
IOException
public void close() throws IOException
close
in class SXNode
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |