|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.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 java.lang.String |
newline
|
| Fields inherited from class java.io.FilterReader |
in |
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
RemoveHTMLTags(java.io.Reader in)
|
|
| Method Summary | |
void |
addEntity(java.lang.String entity,
java.lang.String substitute)
Defines an entity substitution set. |
void |
addSubstitute(java.lang.String tag,
java.lang.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(java.lang.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 java.lang.String newline
| Constructor Detail |
public RemoveHTMLTags(java.io.Reader in)
in - parameter for | Method Detail |
public int read(char[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterReaderlen - parameter for readb - TBD: Description of the incoming method parameteroff - TBD: Description of the incoming method parameterjava.io.IOException - -
public int read()
throws java.io.IOException
read in class java.io.FilterReaderjava.io.IOException - If an I/O error has occurred.InputStream.read()
public void addEntity(java.lang.String entity,
java.lang.String substitute)
throws java.lang.NullPointerException
entity - - the entity to substitute. Example: quot, #90, copy.substitute - - string to sub for the entity.java.lang.NullPointerException - useStandardEntities()
public void addSubstitute(java.lang.String tag,
java.lang.String substitute)
throws java.lang.NullPointerException
tag - - the tag to substitute. Use base tag without attributes.substitute - - string to sub for tag.java.lang.NullPointerException - useStandardSubstitutes()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(java.lang.String[] args)
args - The command line arguments
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||