|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Reader
java.io.FilterReader
com.sapportals.wcm.util.string.RemoveHTMLTags
Title: Strip HTML tags from a Reader Description: It works only with proper
tags, so character references needs to be converted before applying this
Filter, see ReplaceHTMLTokens
Usage Example:
in = new BufferedReader(
new ReplaceTokens(
new RemoveHTMLTags(
new CharArrayReader(content.toCharArray()))));
Copyright (c) SAP AG 2001-2002 Company: SAP AG
| Field Summary | |
static String |
newline
|
| Fields inherited from class java.io.FilterReader |
in |
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
RemoveHTMLTags(Reader in)
|
|
| Method Summary | |
void |
addEntity(String entity,
String substitute)
Defines an entity substitution set. |
void |
addSubstitute(String tag,
String substitute)
Defines a tag substitution set. |
void |
clearEntities()
Tells the filter to clear all current entity substitutions |
void |
clearSubstitutes()
Tells the filter to clear all current tag substitutions. |
boolean |
getNoCR()
You can tell the filter to remove carraige returns (\n and \r) when parsing. |
static void |
main(String[] args)
The main program for test |
int |
read()
Reads a char. |
int |
read(char[] b,
int off,
int len)
read |
void |
setCompressSpace(boolean flag)
Define whether multiple spaces should be compressed into a single space. |
void |
setNoCR(boolean flag)
You can tell the filter to remove carraige returns (\n and \r) when parsing. |
void |
useStandardEntities()
Tells the filter to set up a standard entity substitution set. |
void |
useStandardSubstitutes()
Tells the filter to set up a standard tag substitution set. |
| Methods inherited from class java.io.FilterReader |
close, mark, markSupported, ready, reset, skip |
| Methods inherited from class java.io.Reader |
read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static String newline
| Constructor Detail |
public RemoveHTMLTags(Reader in)
in - parameter for | Method Detail |
public int read(char[] b,
int off,
int len)
throws IOException
len - parameter for readb - TBD: Description of the incoming method parameteroff - TBD: Description of the incoming method parameter
IOException - -
public int read()
throws IOException
IOException - If an I/O error has occurred.InputStream.read()
public void addEntity(String entity,
String substitute)
throws NullPointerException
entity - - the entity to substitute. Example: quot, #90, copy.substitute - - string to sub for the entity.
NullPointerExceptionuseStandardEntities()
public void addSubstitute(String tag,
String substitute)
throws NullPointerException
tag - - the tag to substitute. Use base tag without attributes.substitute - - string to sub for tag.
NullPointerExceptionuseStandardSubstitutes()public void useStandardSubstitutes()
public void useStandardEntities()
public void clearSubstitutes()
public void clearEntities()
public void setCompressSpace(boolean flag)
flag - public void setNoCR(boolean flag)
flag - - remove carraige returns during parse and substitue spacespublic boolean getNoCR()
public static void main(String[] args)
args - The command line arguments
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||