public class EncodingFormatterEncoder extends java.lang.Object implements WGAInputOnlyEncoder
ObjectFormatter
to let it implement WGAEncoder
This one will ignore all text chunks that are not of typeConstructor and Description |
---|
EncodingFormatterEncoder(de.innovationgate.utils.ObjectFormatter formatter) |
Modifier and Type | Method and Description |
---|---|
void |
encode(WGA wga,
TextChunk input,
EncoderOutput output,
java.util.Map<java.lang.String,java.lang.String> flags)
Encodes a text chunk, using the given
EncoderOutput object to place the result. |
public EncodingFormatterEncoder(de.innovationgate.utils.ObjectFormatter formatter)
public void encode(WGA wga, TextChunk input, EncoderOutput output, java.util.Map<java.lang.String,java.lang.String> flags) throws de.innovationgate.webgate.api.WGException
WGAEncoder
EncoderOutput
object to place the result. The method should do one of the following things:
EncoderOutput.ignoreChunk()
if it is not interested in this chunk. The chunk will be kept unmodified
EncoderOutput.replaceChunk(String)
if it wants to replace this chunk with another text chunk completely
EncoderOutput.addChunk(CharSequence)
an arbitrary number of times if it wants to break up the input chunk into multiple output chunks. In many cases this can also be done conveniently using EncoderOutput.replaceChunkViaRegex(java.util.regex.Pattern, String)
using a regular expression.
EncoderOutput
object then the input chunk will be swallowed and not put out.encode
in interface WGAEncoder
wga
- WGA context objectinput
- The input chunkoutput
- Object to place encoding outputflags
- Flags given to the encoder and their values. Flags given without a value have the value "true" here.de.innovationgate.webgate.api.WGException