Top Description Fields Constructors Methods
org.glassfish.grizzly.utils

public Class StringDecoder

extends AbstractTransformer<Buffer, String>
Class Inheritance
Imports
java.io.UnsupportedEncodingException, java.nio.charset.Charset, java.util.logging.Level, .Logger, org.glassfish.grizzly.AbstractTransformer, .Buffer, .Grizzly, .TransformationException, .TransformationResult, org.glassfish.grizzly.attributes.Attribute, .AttributeStorage

String decoder, which decodes Buffer to String
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
protected Charset
protected final Attribute<Integer>
private static final Logger
protected byte[]
Inherited from org.glassfish.grizzly.AbstractTransformer:
attributeBuilderstateAttr

Constructor Summary

AccessConstructor and Description
public
public
StringDecoder(final String stringTerminator)

public
StringDecoder(final Charset charset)

public
StringDecoder(final Charset charset, final String stringTerminator)

Method Summary

Modifier and TypeMethod and Description
public Charset
public String
getName()

Implements org.glassfish.grizzly.Transformer.getName.

Get the Transformer name.

public boolean
protected TransformationResult<Buffer, String>
parseWithLengthPrefix(final AttributeStorage storage, final Buffer input)

protected TransformationResult<Buffer, String>
parseWithTerminatingSeq(final AttributeStorage storage, final Buffer input)

public void
release(final AttributeStorage storage)

Overrides org.glassfish.grizzly.AbstractTransformer.release.

Implements org.glassfish.grizzly.Transformer.release.

The Transformer has done its work and can release all associated resource.

public void
setCharset(final Charset charset)

protected TransformationResult<Buffer, String>
Inherited from org.glassfish.grizzly.AbstractTransformer:
createStateObjectgetLastResultgetMemoryManagergetNamePrefixgetValueobtainMemoryManagerobtainStateObjectsaveLastResultsetMemoryManagertransform

Field Detail

charsetback to summary
protected Charset charset
lengthAttributeback to summary
protected final Attribute<Integer> lengthAttribute
loggerback to summary
private static final Logger logger
stringTerminateBytesback to summary
protected byte[] stringTerminateBytes

Constructor Detail

StringDecoderback to summary
public StringDecoder()
Annotations
@SuppressWarnings:unused
StringDecoderback to summary
public StringDecoder(final String stringTerminator)
Annotations
@SuppressWarnings:unused
StringDecoderback to summary
public StringDecoder(final Charset charset)
StringDecoderback to summary
public StringDecoder(final Charset charset, final String stringTerminator)

Method Detail

getCharsetback to summary
public Charset getCharset()
getNameback to summary
public String getName()

Implements org.glassfish.grizzly.Transformer.getName.

Doc from org.glassfish.grizzly.Transformer.getName.

Get the Transformer name. The name is used to store Transformer associated data.

Annotations
@Override
hasInputRemainingback to summary
public boolean hasInputRemaining(final AttributeStorage storage, final Buffer input)

Implements org.glassfish.grizzly.Transformer.hasInputRemaining.

Annotations
@Override
parseWithLengthPrefixback to summary
protected TransformationResult<Buffer, String> parseWithLengthPrefix(final AttributeStorage storage, final Buffer input)
parseWithTerminatingSeqback to summary
protected TransformationResult<Buffer, String> parseWithTerminatingSeq(final AttributeStorage storage, final Buffer input)
releaseback to summary
public void release(final AttributeStorage storage)

Overrides org.glassfish.grizzly.AbstractTransformer.release.

Implements org.glassfish.grizzly.Transformer.release.

Doc from org.glassfish.grizzly.Transformer.release.

The Transformer has done its work and can release all associated resource.

Annotations
@Override
setCharsetback to summary
public void setCharset(final Charset charset)
transformImplback to summary
protected TransformationResult<Buffer, String> transformImpl(final AttributeStorage storage, final Buffer input) throws TransformationException

Implements abstract org.glassfish.grizzly.AbstractTransformer.transformImpl.

Annotations
@Override