|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EncoderDecoder<T>
Provides a mechanism for encoding/decoding objects.
This interface is used in two complementary ways:
Encodable annotation, allowing a class that needs to be
encodeable to indicate how it can be encoded/decoded. Whatever the class that implements this interface, it must also expose either a public no-arg constructor, or (for implementations that also are Facets) a public constructor that accepts a single FacetHolder. This constructor allows the framework to instantiate the object reflectively.
Parser,
DefaultsProvider,
ValueSemanticsProvider| Method Summary | |
|---|---|
T |
fromEncodedString(String encodedString)
Converts an encoded string to an instance of the object. |
String |
toEncodedString(T toEncode)
Returns the provided object as an encoded string. |
| Method Detail |
|---|
String toEncodedString(T toEncode)
Even if the class is self-encodeable, note that this method is always called on a new instance of the object created via the no-arg constructor. That is, the object shouldn't encode itself, it should encode the object provided to it.
T fromEncodedString(String encodedString)
Note that here the implementing class is acting as a factory for itself.
#toEncodedString(% toEncode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||