com.sun.grizzly.smart.transformers
Class SequenceEncoder<E>
java.lang.Object
com.sun.grizzly.AbstractTransformer<E,Buffer>
com.sun.grizzly.smart.transformers.AbstractSmartMemberEncoder<E>
com.sun.grizzly.smart.transformers.SequenceEncoder<E>
- All Implemented Interfaces:
- SmartMemberTransformer<E,Buffer>, Transformer<E,Buffer>
- Direct Known Subclasses:
- ArrayEncoder
public abstract class SequenceEncoder<E>
- extends AbstractSmartMemberEncoder<E>
- Author:
- oleksiys
| 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 |
config
protected Sequence config
componentType
protected Class componentType
componentEncoder
protected Transformer componentEncoder
SequenceEncoder
public SequenceEncoder()
get
protected abstract Object get(AttributeStorage storage,
E sequence)
- Gets a current sequence element.
- Parameters:
storage - attribute storage.sequence - sequence object.
- Returns:
- component sequence element.
next
protected abstract boolean next(AttributeStorage storage,
E sequence)
- Moves to next sequence element and makes it current.
Returns true, if there is next elements in sequence,
or false otherwise.
- Parameters:
storage - attribute storage.sequence - sequence object.
- Returns:
- true, if there is next elements in sequence,
or false otherwise.
previous
protected abstract boolean previous(AttributeStorage storage,
E sequence)
- Moves to previous sequence element and makes it current.
Returns true, if there is previous elements in sequence,
or false otherwise.
- Parameters:
storage - attribute storage.sequence - sequence object.
- Returns:
- true, if there is previous elements in sequence,
or false otherwise.
size
protected abstract int size(AttributeStorage storage,
E sequence)
- Returns the size of the sequence.
- Parameters:
storage - attribute storage.sequence - sequence object.
- Returns:
- the size of the sequence.
initialize
public void initialize(SmartTransformer parentTransformer,
Field field)
- Specified by:
initialize in interface SmartMemberTransformer<E,Buffer>- Overrides:
initialize in class AbstractSmartMemberEncoder<E>
transform
public TransformationResult<Buffer> transform(AttributeStorage storage,
E 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
getComponentType
public Class getComponentType()
setComponentType
public void setComponentType(Class componentClass)
getComponentEncoder
public Transformer getComponentEncoder()
setComponentEncoder
public void setComponentEncoder(Transformer elementDecoder)
getConfig
public Sequence getConfig()
setConfig
public void setConfig(Sequence config)
saveState
protected void saveState(AttributeStorage storage,
TransformationResult<Buffer> lastResult)
- Save the transformer state.
- Parameters:
storage - attribute storage
Copyright © 2009 SUN Microsystems. All Rights Reserved.