Top Description Fields Methods
org.fxmisc.richtext.model

public Interface Codec<T>

Known Direct Subinterfaces
org.fxmisc.richtext.model.SuperCodec
Type Parameters
<T>
the type of object to serialize
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, java.util.Collection, .List, .Optional, javafx.scene.paint.Color, org.reactfx.util.Either

Specifies a way to serialize an object to/from a data stream

Field Summary

Modifier and TypeField and Description
public static final Codec<Color>
public static final Codec<String>

Method Summary

Modifier and TypeMethod and Description
public static <T> Codec<Collection<T>>
collectionCodec(Codec<T> elemCodec)

public T
public static <L, R> Codec<Either<L, R>>
eitherCodec(Codec<L> lCodec, Codec<R> rCodec)

public void
public static <E extends Enum<E>> Codec<E>
enumCodec(Class<E> enumType)

public String
public static <T> Codec<List<T>>
listCodec(Codec<T> elemCodec)

public static <T> Codec<Optional<T>>
optionalCodec(Codec<T> elemCodec)

public static <SEG, S> Codec<StyledSegment<SEG, S>>
styledSegmentCodec(Codec<SEG> segCodec, Codec<S> styleCodec)

public static <S> Codec<StyledSegment<String, S>>
styledTextCodec(Codec<S> styleCodec)

Field Detail

COLOR_CODECback to summary
public static final Codec<Color> COLOR_CODEC
STRING_CODECback to summary
public static final Codec<String> STRING_CODEC

Method Detail

collectionCodecback to summary
public static <T> Codec<Collection<T>> collectionCodec(Codec<T> elemCodec)
decodeback to summary
public T decode(DataInputStream is) throws IOException
eitherCodecback to summary
public static <L, R> Codec<Either<L, R>> eitherCodec(Codec<L> lCodec, Codec<R> rCodec)
encodeback to summary
public void encode(DataOutputStream os, T t) throws IOException
enumCodecback to summary
public static <E extends Enum<E>> Codec<E> enumCodec(Class<E> enumType)
getNameback to summary
public String getName()
listCodecback to summary
public static <T> Codec<List<T>> listCodec(Codec<T> elemCodec)
optionalCodecback to summary
public static <T> Codec<Optional<T>> optionalCodec(Codec<T> elemCodec)
styledSegmentCodecback to summary
public static <SEG, S> Codec<StyledSegment<SEG, S>> styledSegmentCodec(Codec<SEG> segCodec, Codec<S> styleCodec)
styledTextCodecback to summary
public static <S> Codec<StyledSegment<String, S>> styledTextCodec(Codec<S> styleCodec)