|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.zeigermann.xpa.XMLTokenTypeManager
The utility class XMLTokenTypeManager
stores token type
informations about all tags used in transformation. They are retrieved
from the text file generated by the antlr tool along with the parser
resp. treeparser files.
Field Summary | |
static String |
CDATA
This is the name of the token that should be used for character data (unused, but reserved for future extensions). |
static String |
COMMENT
This is the name of the token that should be used for comments (unused, but reserved for future extensions). |
static String |
PCDATA
This is the name of the token that should be used for parseable character data. |
static String |
PI
This is the name of the token that should be used for processing instructions (unused, but reserved for future extensions). |
static String |
WS
This is the name of the token that should be used for ignorable whitespace |
Constructor Summary | |
XMLTokenTypeManager()
|
Method Summary | |
int |
getType(String token)
Gets the type of a token as used by ANTLR parser that generated token type definition text. |
String |
getWildCardTag()
Gets the name of the wildcard tag as described in setWildCardTag(java.lang.String) . |
void |
insert(String token,
int value)
Inserts the name of a token along with its type. |
void |
parse(InputStream in)
Parses that token type definition in text format generated by ANTLR using input stream in as input. |
void |
setWildCardTag(String wildCardTag)
Sets the name of the token to be used as wildcard. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PCDATA
public static final String CDATA
public static final String PI
public static final String COMMENT
public static final String WS
Constructor Detail |
public XMLTokenTypeManager()
Method Detail |
public void parse(InputStream in)
in
- the input stream to read token type definition fromgetType(java.lang.String)
,
setWildCardTag(java.lang.String)
,
insert(java.lang.String, int)
public void setWildCardTag(String wildCardTag)
getType(java.lang.String)
for definition and use. You should usually get
along with the default one, and should not be forced to use this
method.
wildCardTag
- case insensitive name of the tokengetType(java.lang.String)
,
getWildCardTag()
public String getWildCardTag()
setWildCardTag(java.lang.String)
.
getType(java.lang.String)
,
setWildCardTag(java.lang.String)
public void insert(String token, int value)
token
- case insensitive name of the tokenvalue
- type of the tokengetType(java.lang.String)
public int getType(String token)
WS
which is not defined by
ANTLR parser: Token.INVALID_TYPE
will be returned as token
manager supposes you do not care for whitespace in your grammar
setWildCardTag(java.lang.String)
Token.INVALID_TYPE
will be returned
token
- case insensitive name of a token
setWildCardTag(java.lang.String)
,
getWildCardTag()
,
insert(java.lang.String, int)
,
parse(java.io.InputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |