|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.BaseAST | +--antlr.CommonAST | +--de.zeigermann.xpa.treeParser.XMLAST | +--de.zeigermann.xpa.treeParser.XMLStartAST
The XMLStartAST
class extends XMLAST
s for
attributes to represent XML start tags as ASTs. Together with its
children and its attributes it forms a complete XML element.
In case it does not contain any children it is supposed to be empty,
which can be checked by isEmpty()
.
Note: There is not need to explicitly represent end tags
as they are implied by the structure of the tree!
Field Summary |
Fields inherited from class antlr.BaseAST |
down, right |
Constructor Summary | |
XMLStartAST(int type,
String text,
AttributesImpl attributes)
Creates a new XMLStartAST . |
|
XMLStartAST(Token t)
Creates a new XMLStartAST with no attributes. |
|
XMLStartAST(Token t,
AttributesImpl attributes)
Creates a new XMLStartAST . |
|
XMLStartAST(XMLStartAST e)
Copy ctor. |
Method Summary | |
AttributesImpl |
getAttributes()
Gets attributes associated to this tag. |
boolean |
isEmpty()
Finds out if this XMLStartAST is empty.
|
void |
setAttributes(AttributesImpl attributes)
Sets attributes associated to this tag. |
String |
toString()
Gets a simple string representation of this token. |
void |
updateTokenTypes(XMLTokenTypeManager tokenManager)
Updates the type of this XMLStartAST determined by
token manager and the text of this AST by
XMLTokenTypeManager.getType(String) .
|
void |
write(XMLWriter writer)
Writes itself to XML writer. |
Methods inherited from class de.zeigermann.xpa.treeParser.XMLAST |
addSibling, getLastChild, getLastSibling, getPreviousSiblingFlat, noRoot, reverseFlat |
Methods inherited from class antlr.CommonAST |
getText, getType, initialize, initialize, initialize, setText, setType |
Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XMLStartAST(int type, String text, AttributesImpl attributes)
XMLStartAST
.
type
- the type of the AST, usually determined by
Parser2XMLASTAdapter
using XMLTokenTypeManager.getType(String)
.text
- name of this start tagattributes
- attributes associated to this taggetAttributes()
public XMLStartAST(Token t, AttributesImpl attributes)
XMLStartAST
.
t
- the token to get type and text fromattributes
- attributes associated to this taggetAttributes()
public XMLStartAST(Token t)
XMLStartAST
with no attributes.
t
- the token to get type and text frompublic XMLStartAST(XMLStartAST e)
Method Detail |
public String toString()
toString
in interface AST
toString
in class XMLAST
XMLAST.write(de.zeigermann.xml.XMLWriter)
public void write(XMLWriter writer) throws IOException
write
in class XMLAST
IOException
public void updateTokenTypes(XMLTokenTypeManager tokenManager)
XMLStartAST
determined by
token manager and the text of this AST by
XMLTokenTypeManager.getType(String)
.
This is needed when we want to
change the token types of an existing XMLAST
.
As this is the root of a tree, the childrens type will be updated
as sell.
updateTokenTypes
in class XMLAST
public boolean isEmpty()
XMLStartAST
is empty.
An XMLStartAST
is considered empty if it has no
children.
public AttributesImpl getAttributes()
public void setAttributes(AttributesImpl attributes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |