|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.sapportals.wcm.WcmObject
|
+--com.sapportals.wcm.util.html.HtmlTokenizer
HtmlTokenizer
Copyright (c) SAP AG 2001-2003
| Field Summary | |
static int |
TOKEN_COMMENT
comment token |
static int |
TOKEN_EOF
end of file |
static int |
TOKEN_TAG
tag token |
static int |
TOKEN_TEXT
text token |
| Fields inherited from class com.sapportals.wcm.WcmObject |
ORDER_TYPE_MANUAL, ORDER_TYPE_NONE |
| Constructor Summary | |
HtmlTokenizer(java.io.InputStream in)
Create a new HtmlTokenizer InputStream is = |
|
| Method Summary | |
java.lang.String |
getEncoding()
|
java.lang.String |
getToken()
this method returns the current token as a String. |
java.lang.String |
getTokenContent()
this method returns raw content of last token, e.g. a tag without "<" and ">". |
int |
getTokenType()
|
int |
next()
Parse the input stream and returns the type of the next token. type is one of the TOKEN_ defines: |
void |
writeToStream(java.io.Writer pw)
This method writes the inputstream from the current position to the PrintWriter without any further parsing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int TOKEN_EOF
public static final int TOKEN_TEXT
public static final int TOKEN_TAG
public static final int TOKEN_COMMENT
| Constructor Detail |
public HtmlTokenizer(java.io.InputStream in)
InputStream is =; HtmlTokenizer htmlTokenizer = new HtmlTokenizer(is); while (htmlTokenizer.next() != HtmlTokenizer.TOKEN_EOF) { int type = htmlTokenizer.getTokenType(); if (type == HtmlTokenizer.TOKEN_TAG) { System.out.println("tag: " + htmlTokenizer.getToken()); } else if (type == HtmlTokenizer.TOKEN_TEXT) { System.out.println("text: " + htmlTokenizer.getToken()); } else if (type == HtmlTokenizer.TOKEN_COMMENT) { System.out.println("comment: " + htmlTokenizer.getToken()); }
in - input stream| Method Detail |
public java.lang.String getEncoding()
public int getTokenType()
TOKEN_ definespublic java.lang.String getToken()
public java.lang.String getTokenContent()
public int next()
throws java.io.IOException
TOKEN_ defines:java.io.IOException - Exception raised in failure situation
public void writeToStream(java.io.Writer pw)
throws java.io.IOException
pw - TBD: Description of the incoming method parameterjava.io.IOException - Exception raised in failure situation
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||