org.glassfish.grizzly.utils
Class StringEncoder

java.lang.Object
  extended by org.glassfish.grizzly.AbstractTransformer<String,Buffer>
      extended by org.glassfish.grizzly.utils.StringEncoder
All Implemented Interfaces:
Transformer<String,Buffer>

public class StringEncoder
extends AbstractTransformer<String,Buffer>

String decoder, which decodes Buffer to String

Author:
Alexey Stashok

Nested Class Summary
 
Nested classes/interfaces inherited from class org.glassfish.grizzly.AbstractTransformer
AbstractTransformer.LastResultAwareState<K,L>
 
Field Summary
protected  Charset charset
           
protected  String stringTerminator
           
 
Fields inherited from class org.glassfish.grizzly.AbstractTransformer
attributeBuilder, stateAttr
 
Constructor Summary
StringEncoder()
           
StringEncoder(Charset charset)
           
StringEncoder(Charset charset, String stringTerminator)
           
StringEncoder(String stringTerminator)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charset

protected Charset charset

stringTerminator

protected String stringTerminator
Constructor Detail

StringEncoder

public StringEncoder()

StringEncoder

public StringEncoder(String stringTerminator)

StringEncoder

public StringEncoder(Charset charset)

StringEncoder

public StringEncoder(Charset charset,
                     String stringTerminator)
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 class AbstractTransformer<String,Buffer>
Throws:
TransformationException

hasInputRemaining

public boolean hasInputRemaining(AttributeStorage storage,
                                 String input)

getCharset

public Charset getCharset()

setCharset

public void setCharset(Charset charset)


Copyright © 2013 Oracle Corporation. All Rights Reserved.