Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.litesoft.codec;

import org.litesoft.core.annotations.*;
import org.litesoft.core.util.*;

/**
 * Implementations of this Codec must produce and consume self-terminating encodings.
 * <p/>
 * A self-terminating encoded value, when decoding, will only consume as many characters
 * from the CharSource as were generated by the encode method.
 */
public interface Codec<T>
{
    /**
     * Encode the Value into a self-terminating non-Null String.
     */
    @NotNull String encode( @Nullable T pValue );

    /**
     * Decode the Value as a self-terminating non-Null String (generated by the encode method).
     * <p/>
     * Note: No extraneous characters allowed on the parameter Value.
     */
    @Nullable T decode( @NotNull String pValue );

    /**
     * Decode the next self-terminating character stream from the CharSource.
     */
    @Nullable T decode( @NotNull CharSource pCharSource );
}

Commits for litesoft/trunk/Java/core/Anywhere/src/org/litesoft/codec/Codec.java

Diff revisions: vs.
Revision Author Commited Message
767 Diff Diff GeorgeS picture GeorgeS Sat 14 Jul, 2012 18:19:39 +0000
766 GeorgeS picture GeorgeS Sat 14 Jul, 2012 16:38:04 +0000

!