public interface WGAEncoder
WGAInputOnlyEncoder
if you only want to transform text chunks of origin INPUT (as is mostly the case).
The same encoder instance is used for encoding all incoming text chunks of an input to be encoded, so the instance may keep state between those invocations.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. |
void encode(WGA wga, TextChunk input, EncoderOutput output, java.util.Map<java.lang.String,java.lang.String> flags) throws de.innovationgate.webgate.api.WGException
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.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