Subversion Repository Public Repository

litesoft

Diff Revisions 766 vs 767 for /trunk/Java/core/Anywhere/src/org/litesoft/codec/Codec.java

Diff revisions: vs.
  @@ -3,11 +3,28 @@
3 3 import org.litesoft.core.annotations.*;
4 4 import org.litesoft.core.util.*;
5 5
6 + /**
7 + * Implementations of this Codec must produce and consume self-terminating encodings.
8 + * <p/>
9 + * A self-terminating encoded value, when decoding, will only consume as many characters
10 + * from the CharSource as were generated by the encode method.
11 + */
6 12 public interface Codec<T>
7 13 {
14 + /**
15 + * Encode the Value into a self-terminating non-Null String.
16 + */
8 17 @NotNull String encode( @Nullable T pValue );
9 18
19 + /**
20 + * Decode the Value as a self-terminating non-Null String (generated by the encode method).
21 + * <p/>
22 + * Note: No extraneous characters allowed on the parameter Value.
23 + */
10 24 @Nullable T decode( @NotNull String pValue );
11 25
12 - @Nullable T decode( @NotNull CharSource pValue );
26 + /**
27 + * Decode the next self-terminating character stream from the CharSource.
28 + */
29 + @Nullable T decode( @NotNull CharSource pCharSource );
13 30 }