public class HtmlTokenizer extends WcmObject
Copyright (c) SAP AG 2001-2003
| Modifier and Type | Field and Description |
|---|---|
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
|
ORDER_TYPE_MANUAL, ORDER_TYPE_NONE| Constructor and Description |
|---|
HtmlTokenizer(InputStream in)
Create a new HtmlTokenizer
InputStream is =
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEncoding() |
String |
getToken()
this method returns the current token as a String.
|
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(Writer pw)
This method writes the inputstream from the current position to the
PrintWriter without any further parsing.
|
public static final int TOKEN_EOF
public static final int TOKEN_TEXT
public static final int TOKEN_TAG
public static final int TOKEN_COMMENT
public HtmlTokenizer(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 streampublic String getEncoding()
public int getTokenType()
TOKEN_ definespublic String getToken()
public String getTokenContent()
public int next()
throws IOException
TOKEN_ defines:IOException - Exception raised in failure situationpublic void writeToStream(Writer pw) throws IOException
pw - TBD: Description of the incoming method parameterIOException - Exception raised in failure situation| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice