public abstract class ChunkedTransformer<P> extends ConfigurableReaderTransformer implements CharTransformer
| Modifier and Type | Class and Description |
|---|---|
protected class |
ChunkedTransformer.Status |
| Modifier and Type | Field and Description |
|---|---|
static int |
ENTIRE
Match the entire stream (so, one String must be created).
|
static int |
LINES
Match line by line.
|
static int |
ONLY_REPLACE_FIRST_MATCH
If this is added to the config-int, then only the first match of all patterns should be used.
|
static int |
ONLY_USE_FIRST_MATCHING_PATTERN
If this is added to the config-int, then only the first match of any one pattern should be used.
|
protected boolean |
onlyFirstMatch |
protected boolean |
onlyFirstPattern |
static int |
WORDS
Match word by word.
|
static int |
XMLTEXT
Match in PCDATA of xml elements.
|
static int |
XMLTEXT_WORDS
Match word by word, but only in PCDATA of xml elements.
|
to| Modifier | Constructor and Description |
|---|---|
|
ChunkedTransformer() |
protected |
ChunkedTransformer(int i) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
base() |
void |
configure(int i)
If a transformer can handle more then one destination
format, it can be configured with this.
|
String |
getEncoding()
Returns the encoding that is currently active
|
static void |
main(String[] argv) |
protected ChunkedTransformer.Status |
newStatus() |
protected boolean |
replace(ChunkedTransformer.Status status)
Whether still to do replacing, given status.
|
protected abstract boolean |
replace(String string,
Writer w,
ChunkedTransformer.Status status)
Implement this.
|
protected boolean |
replaceWord(StringBuilder word,
Writer writer,
ChunkedTransformer.Status status) |
Writer |
transform(Reader r,
Writer w) |
Writer |
transformEntire(Reader r,
Writer w) |
Map<String,Config> |
transformers()
Returns which transformations can be done by an object of this class.
|
Writer |
transformLines(Reader r,
Writer w) |
Writer |
transformWords(Reader r,
Writer w) |
Writer |
transformXmlText(Reader r,
Writer w) |
Writer |
transformXmlTextWords(Reader r,
Writer w) |
toStringtransform, transform, transformBack, transformBack, transformBackclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittransform, transform, transformBack, transformBack, transformBacktoStringpublic static final int XMLTEXT_WORDS
public static final int XMLTEXT
public static final int WORDS
public static final int LINES
public static final int ENTIRE
public static final int ONLY_USE_FIRST_MATCHING_PATTERN
public static final int ONLY_REPLACE_FIRST_MATCH
protected boolean onlyFirstPattern
protected boolean onlyFirstMatch
protected ChunkedTransformer(int i)
public ChunkedTransformer()
public void configure(int i)
ConfigurableTransformerto can be null.configure in interface ConfigurableTransformerconfigure in class ConfigurableReaderTransformerprotected ChunkedTransformer.Status newStatus()
protected abstract boolean replace(String string, Writer w, ChunkedTransformer.Status status) throws IOException
IOExceptionprotected boolean replaceWord(StringBuilder word, Writer writer, ChunkedTransformer.Status status) throws IOException
IOExceptionprotected boolean replace(ChunkedTransformer.Status status)
public Writer transform(Reader r, Writer w)
transform in interface CharTransformertransform in class ReaderTransformerprotected abstract String base()
public String getEncoding()
ConfigurableTransformergetEncoding in interface ConfigurableTransformergetEncoding in class ConfigurableReaderTransformerpublic Map<String,Config> transformers()
ConfigurableTransformertransformers in interface ConfigurableTransformertransformers in class ConfigurableReaderTransformerpublic static void main(String[] argv)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}