Package org.fxmisc.richtext.model
Interface Codec<T>
-
- Type Parameters:
T- the type of object to serialize
public interface Codec<T>Specifies a way to serialize an object to/from a data stream
-
-
Field Summary
Fields Modifier and Type Field Description static Codec<Color>COLOR_CODECstatic Codec<String>STRING_CODEC
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> Codec<Collection<T>>collectionCodec(Codec<T> elemCodec)Tdecode(DataInputStream is)static <L,R>
Codec<Either<L,R>>eitherCodec(Codec<L> lCodec, Codec<R> rCodec)voidencode(DataOutputStream os, T t)static <E extends Enum<E>>
Codec<E>enumCodec(Class<E> enumType)StringgetName()static <T> Codec<List<T>>listCodec(Codec<T> elemCodec)static <T> Codec<Optional<T>>optionalCodec(Codec<T> elemCodec)static <SEG,S>
Codec<StyledSegment<SEG,S>>styledSegmentCodec(Codec<SEG> segCodec, Codec<S> styleCodec)static <S> Codec<StyledSegment<String,S>>styledTextCodec(Codec<S> styleCodec)
-
-
-
Method Detail
-
getName
String getName()
-
encode
void encode(DataOutputStream os, T t) throws IOException
- Throws:
IOException
-
decode
T decode(DataInputStream is) throws IOException
- Throws:
IOException
-
styledSegmentCodec
static <SEG,S> Codec<StyledSegment<SEG,S>> styledSegmentCodec(Codec<SEG> segCodec, Codec<S> styleCodec)
-
styledTextCodec
static <S> Codec<StyledSegment<String,S>> styledTextCodec(Codec<S> styleCodec)
-
collectionCodec
static <T> Codec<Collection<T>> collectionCodec(Codec<T> elemCodec)
-
-