org.mmbase.util.transformers
Class TagStripperFactory

java.lang.Object
  extended by org.mmbase.util.transformers.TagStripperFactory
All Implemented Interfaces:
ParameterizedTransformerFactory<CharTransformer>

public class TagStripperFactory
extends Object
implements ParameterizedTransformerFactory<CharTransformer>

Can be used to strip tags and attributes from HTML. Also, if markup remains, it can be made 'locally' well formed XML (the 'escapeamps' parameter suffices then), by which I mean that if you put it in a div, that div is then well formed. http://javafaq.nu/java-example-code-618.html

Since:
MMBase-1.8.4
Version:
$Id: TagStripperFactory.java 41943 2010-04-16 17:18:19Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
protected static class TagStripperFactory.ParserGetter
           
(package private) static class TagStripperFactory.State
           
(package private) static class TagStripperFactory.TagCheck
           
protected static class TagStripperFactory.TagStripper
           
 
Field Summary
static Parameter<Boolean> ADD_BRS
           
static Parameter<Boolean> ADD_NEWLINES
           
static Parameter<Boolean> ESCAPE_AMPS
           
(package private) static org.mmbase.util.transformers.TagStripperFactory.Attr EVENTS
           
(package private) static List<org.mmbase.util.transformers.TagStripperFactory.Tag> NONE
           
protected static Parameter[] PARAMS
           
static Parameter<String> TAGS
           
(package private) static List<org.mmbase.util.transformers.TagStripperFactory.Tag> XSS
           
 
Constructor Summary
TagStripperFactory()
           
 
Method Summary
 Parameters createParameters()
          Create empty Parameters object for use with ParameterizedTransformerFactory.createTransformer(Parameters).
 CharTransformer createTransformer(Parameters parameters)
          Creates a parameterized transformer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAGS

public static final Parameter<String> TAGS

ADD_BRS

public static final Parameter<Boolean> ADD_BRS

ESCAPE_AMPS

public static final Parameter<Boolean> ESCAPE_AMPS

ADD_NEWLINES

public static final Parameter<Boolean> ADD_NEWLINES

PARAMS

protected static final Parameter[] PARAMS

EVENTS

static final org.mmbase.util.transformers.TagStripperFactory.Attr EVENTS

XSS

static final List<org.mmbase.util.transformers.TagStripperFactory.Tag> XSS

NONE

static final List<org.mmbase.util.transformers.TagStripperFactory.Tag> NONE
Constructor Detail

TagStripperFactory

public TagStripperFactory()
Method Detail

createParameters

public Parameters createParameters()
Description copied from interface: ParameterizedTransformerFactory
Create empty Parameters object for use with ParameterizedTransformerFactory.createTransformer(Parameters).

Specified by:
createParameters in interface ParameterizedTransformerFactory<CharTransformer>

createTransformer

public CharTransformer createTransformer(Parameters parameters)
Creates a parameterized transformer.

Specified by:
createTransformer in interface ParameterizedTransformerFactory<CharTransformer>


MMBase 2.0-SNAPSHOT - null