|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--step.encoding.Encoder | +--step.encoding.RecordEncoder
An encoder for STEP record objects.
StepRecord
,
FieldIterator
,
RecordFactory
Field Summary | |
static String |
TYPE_FIELD_NAME
|
Constructor Summary | |
RecordEncoder(String name,
EncoderFactory factory)
Create a "universal" record encoder, capable of encoding all STEP records. |
|
RecordEncoder(String name,
RecordDef baseDef,
List typeEncAttrs,
EncoderFactory factory)
Create a new encoder for the given record definition. |
Method Summary | |
StepObject |
decode(DecodeContext context)
Decode a record. |
void |
dump(int level)
|
void |
encode(StepObject o,
EncodeContext context)
Encode a record. |
Methods inherited from class step.encoding.Encoder |
eventMessage, getFactory, getName, indent, makeFieldName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String TYPE_FIELD_NAME
Constructor Detail |
public RecordEncoder(String name, EncoderFactory factory)
Types are tagged with their type name, encoded the IdentifierStrategy
.
public RecordEncoder(String name, RecordDef baseDef, List typeEncAttrs, EncoderFactory factory)
This encoder will support the given record type and all its sub-types.
name
- the name of this encoder.baseDef
- the root type to allow through this encoder.typeEncAttrs
- attributes for the type tag encoder.factory
- the EncoderFactory
used to create this encoder.
IllegalArgumentException
- if the given base type may not be used.
NOTE: The internal records (such as MetaRecord
or the
EncoderEvent
records) are not permitted because the require
subtle bootstrapping.Method Detail |
public void encode(StepObject o, EncodeContext context) throws EncoderException, IOException
encode
in class Encoder
EncoderException
- if the type is not allowed by this encoder.
IOException
- if the encode operation encountered an I/O failure.public StepObject decode(DecodeContext context) throws EncoderException, IOException
decode
in class Encoder
RecordDefNotFoundException
- if a definition for the type could
not be loaded.
IOException
- if the decode operation encountered an I/O failure.
EncoderException
- if the decode operation encountered an error.public void dump(int level)
dump
in class Encoder
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |