Package org.glassfish.grizzly.utils
Class StringEncoder
- java.lang.Object
-
- org.glassfish.grizzly.AbstractTransformer<String,Buffer>
-
- org.glassfish.grizzly.utils.StringEncoder
-
- All Implemented Interfaces:
Transformer<String,Buffer>
public class StringEncoder extends AbstractTransformer<String,Buffer>
- Author:
- Alexey Stashok
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.grizzly.AbstractTransformer
AbstractTransformer.LastResultAwareState<K,L>
-
-
Field Summary
Fields Modifier and Type Field Description protected Charset
charset
protected String
stringTerminator
-
Fields inherited from class org.glassfish.grizzly.AbstractTransformer
attributeBuilder, stateAttr
-
-
Constructor Summary
Constructors Constructor Description StringEncoder()
StringEncoder(String stringTerminator)
StringEncoder(Charset charset)
StringEncoder(Charset charset, String stringTerminator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Charset
getCharset()
String
getName()
Get the Transformer name.boolean
hasInputRemaining(AttributeStorage storage, String input)
void
setCharset(Charset charset)
protected TransformationResult<String,Buffer>
transformImpl(AttributeStorage storage, String input)
-
Methods inherited from class org.glassfish.grizzly.AbstractTransformer
createStateObject, getLastResult, getMemoryManager, getNamePrefix, getValue, obtainMemoryManager, obtainStateObject, release, saveLastResult, setMemoryManager, transform
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Transformer
Get the Transformer name. The name is used to store Transformer associated data.- Returns:
- The Transformer name.
-
transformImpl
protected TransformationResult<String,Buffer> transformImpl(AttributeStorage storage, String input) throws TransformationException
- Specified by:
transformImpl
in classAbstractTransformer<String,Buffer>
- Throws:
TransformationException
-
hasInputRemaining
public boolean hasInputRemaining(AttributeStorage storage, String input)
-
getCharset
public Charset getCharset()
-
setCharset
public void setCharset(Charset charset)
-
-