public abstract class Encoders extends java.lang.Object implements AttributeEncoder, ArrayElementEncoder
Modifier and Type | Class and Description |
---|---|
static class |
Encoders.BoolEncoder |
static class |
Encoders.ByteEncoder |
static class |
Encoders.ClassEncoder |
static class |
Encoders.ColorEncoder |
static class |
Encoders.DateEncoder |
static class |
Encoders.DoubleEncoder |
static class |
Encoders.FloatEncoder |
static class |
Encoders.IntEncoder |
static class |
Encoders.LongEncoder |
static class |
Encoders.QualityCodeEncoder |
static class |
Encoders.ShortEncoder |
static class |
Encoders.SignatureEncoder |
static class |
Encoders.StringEncoder |
static class |
Encoders.UUIDEncoder |
Modifier | Constructor and Description |
---|---|
protected |
Encoders(CodecType type) |
Modifier and Type | Method and Description |
---|---|
static AttributeEncoder |
forBoolean(boolean b) |
static AttributeEncoder |
forByte(byte b) |
static AttributeEncoder |
forClass(java.lang.Class clazz) |
static AttributeEncoder |
forColor(java.awt.Color color) |
static AttributeEncoder |
forDate(java.util.Date d) |
static AttributeEncoder |
forDouble(double d) |
static AttributeEncoder |
forFloat(float f) |
static AttributeEncoder |
forInt(int i) |
static AttributeEncoder |
forLong(long l) |
static AttributeEncoder |
forQualityCode(QualityCode code) |
static AttributeEncoder |
forShort(short s) |
static AttributeEncoder |
forSignature(java.lang.Class[] array) |
static AttributeEncoder |
forString(java.lang.String s,
boolean escape) |
int |
getCodecType()
Return the unique code for the type that this encoder encodes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resetObject
getBinaryLength, objectToBinary, objectToString
protected Encoders(CodecType type)
public int getCodecType()
AttributeEncoder
Return the unique code for the type that this encoder encodes. This must be the ordinal() of the corresponding CodecType enum value.
This is only used on Encoders for element attributes, because attributes need to be read in with no intervention, so this ID is used to look up the correct decoder. For element bodies, the handler has the chance to instantiate the correct decoder before parsing, so no type code is needed.
getCodecType
in interface AttributeEncoder
public static AttributeEncoder forByte(byte b)
public static AttributeEncoder forShort(short s)
public static AttributeEncoder forInt(int i)
public static AttributeEncoder forLong(long l)
public static AttributeEncoder forFloat(float f)
public static AttributeEncoder forDouble(double d)
public static AttributeEncoder forBoolean(boolean b)
public static AttributeEncoder forDate(java.util.Date d)
public static AttributeEncoder forString(java.lang.String s, boolean escape)
public static AttributeEncoder forClass(java.lang.Class clazz)
public static AttributeEncoder forSignature(java.lang.Class[] array)
public static AttributeEncoder forColor(java.awt.Color color)
public static AttributeEncoder forQualityCode(QualityCode code)