com.sun.grizzly.utils
Class StringEncoder

java.lang.Object
  extended by com.sun.grizzly.AbstractTransformer<String,Buffer>
      extended by com.sun.grizzly.utils.StringEncoder
All Implemented Interfaces:
Transformer<String,Buffer>
Direct Known Subclasses:
SmartStringEncoder

public class StringEncoder
extends AbstractTransformer<String,Buffer>

String decoder, which decodes Buffer to String

Author:
Alexey Stashok

Field Summary
protected  Charset charset
           
protected  String stringTerminator
           
 
Fields inherited from class com.sun.grizzly.AbstractTransformer
attributeBuilder, incompletedResult, inputBufferAttribute, lastResultAttribute, outputBufferAttribute
 
Constructor Summary
StringEncoder()
           
StringEncoder(Charset charset)
           
StringEncoder(Charset charset, String stringTerminator)
           
StringEncoder(String stringTerminator)
           
 
Method Summary
 Charset getCharset()
           
protected  void saveState(AttributeStorage storage, TransformationResult<Buffer> result)
           
 void setCharset(Charset charset)
           
 TransformationResult<Buffer> transform(AttributeStorage storage, String input, Buffer output)
          Transforms an input data to some custom representation.
 
Methods inherited from class com.sun.grizzly.AbstractTransformer
getInput, getLastResult, getMemoryManager, getOutput, getProperties, getValue, hibernate, obtainMemoryManager, release, setInput, setMemoryManager, setOutput, 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

transform

public TransformationResult<Buffer> transform(AttributeStorage storage,
                                              String input,
                                              Buffer output)
                                       throws TransformationException
Description copied from interface: Transformer
Transforms an input data to some custom representation.

Parameters:
storage - the external state storage, where Transformer could retrieve or store its state.
Returns:
the result TransformationResult
Throws:
TransformationException

getCharset

public Charset getCharset()

setCharset

public void setCharset(Charset charset)

saveState

protected void saveState(AttributeStorage storage,
                         TransformationResult<Buffer> result)


Copyright © 2009 SUN Microsystems. All Rights Reserved.