com.ryanm.config.serial
Interface ConfiguratorCodec

All Known Implementing Classes:
BooleanCodec, ColourCodec, FileCodec, FloatCodec, IntCodec, StringCodec, StringListCodec, VectorCodec

public interface ConfiguratorCodec

Defines an object that can encode and decode variables of a given type

Author:
s9902505

Method Summary
 java.lang.Object decode(java.lang.String encoded)
          Decodes the encoded string into a value object
 java.lang.String encode(java.lang.Object value)
          Encodes the value of a given object
 java.lang.Class getType()
          Gets the type identifier that this codec object can handle
 

Method Detail

encode

java.lang.String encode(java.lang.Object value)
                        throws CodecException
Encodes the value of a given object

Parameters:
value - The value to encode
Returns:
The String encoding for the value, or null if encoding was not possible
Throws:
CodecException - If the supplied object cannot be handled by this codec

decode

java.lang.Object decode(java.lang.String encoded)
                        throws CodecException
Decodes the encoded string into a value object

Parameters:
encoded - The encoded string
Returns:
The value of the encoded string
Throws:
CodecException - If the supplied encoded data cannot be parsed by this codec

getType

java.lang.Class getType()
Gets the type identifier that this codec object can handle

Returns:
The type identifier