|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--step.encoding.Encoder
An agent for encoding/decoding objects to/from the STEP binary format.
Encoders encapsulate the information necessary to convert STEP objects to and from a set of bytes. Some encoders apply a standard rule, while others use an adaptive strategy that attempts to minimize the average number of bytes per value.
Encoders are normally instantiated using a factory object.
EncodeContext
,
DecodeContext
Constructor Summary | |
Encoder(String name,
EncoderFactory factory)
|
Method Summary | |
abstract StepObject |
decode(DecodeContext context)
Decode a value. |
abstract void |
dump(int level)
|
abstract void |
encode(StepObject o,
EncodeContext context)
Encode a value. |
protected void |
eventMessage(String msg)
Send a text message to this encoder. |
EncoderFactory |
getFactory()
Get the factory used to create this encoder. |
String |
getName()
Get the name of this encoder. |
protected static void |
indent(int level)
|
protected String |
makeFieldName(String fieldName)
Create an appropriate name for a sub-field encoder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Encoder(String name, EncoderFactory factory)
Method Detail |
public String getName()
public EncoderFactory getFactory()
protected String makeFieldName(String fieldName)
public abstract void encode(StepObject o, EncodeContext context) throws EncoderException, IOException
EncoderException
- if the encode operation encountered an error.
IOException
- if the encode operation encountered an I/O failure.public abstract StepObject decode(DecodeContext context) throws EncoderException, IOException
EncoderException
- if the decode operation encountered an error.
IOException
- if the decode operation encountered an I/O failure.protected void eventMessage(String msg)
In general, messages are intended for the decoding process.
The default behavior is to ignore the message.
EncoderMessageEvent
public abstract void dump(int level)
protected static void indent(int level)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |