|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Inherited @Target(value=TYPE) @Retention(value=RUNTIME) public @interface Encodable
Indicates that the class can be encoded or decoded either by delegating to an EncoderDecoder or
through some externally-configured mechanism.
Defaulted,
Parseable,
Value| Optional Element Summary | |
|---|---|
Class<?> |
encoderDecoderClass
As per encoderDecoderName(), but specifying a class literal rather than a fully qualified
class name. |
String |
encoderDecoderName
The fully qualified name of a class that implements the EncoderDecoder interface. |
public abstract String encoderDecoderName
EncoderDecoder interface.
This is optional because some implementations may pick up encodeability via a configuration file, or
via the equivalent encoderDecoderClass().
It is common for value classes to act as their own encoder/decoders. Note that the framework requires that the nominated class provides a public no-arg constructor on the class. It instantiates an instance in order to do the encoding or decoding, uses the result and discards the instantiated object. What that means in particular is that a self-encoding class shouldn't encode its own state, it should encode the state of the object passed to it.
Implementation note: the default value provided here is simply an empty string because null is not a valid default.
public abstract Class<?> encoderDecoderClass
encoderDecoderName(), but specifying a class literal rather than a fully qualified
class name.
Implementation note: the default value provided here is simply the Encodable's own class,
because null is not a valid default.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||