org.nakedobjects.metamodel.commons.encoding
Class FieldType<T>
java.lang.Object
org.nakedobjects.metamodel.commons.encoding.FieldType<T>
public abstract class FieldType<T>
- extends java.lang.Object
Typesafe writing and reading of fields, providing some level of integrity
checking of encoded messages.
The write(DataOutputExtended, Object) writes out field type and then
the data for that field type. The field type is represented by this
enumberation, with the index being what is written
to the stream (hence of type byte to keep small).
Conversely, the read(DataInputExtended) reads the field type
and then the data for that field type.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BOOLEAN
public static FieldType<java.lang.Boolean> BOOLEAN
BOOLEAN_ARRAY
public static FieldType<boolean[]> BOOLEAN_ARRAY
BYTE
public static FieldType<java.lang.Byte> BYTE
BYTE_ARRAY
public static FieldType<byte[]> BYTE_ARRAY
SHORT
public static FieldType<java.lang.Short> SHORT
SHORT_ARRAY
public static FieldType<short[]> SHORT_ARRAY
INTEGER
public static FieldType<java.lang.Integer> INTEGER
UNSIGNED_BYTE
public static FieldType<java.lang.Integer> UNSIGNED_BYTE
UNSIGNED_SHORT
public static FieldType<java.lang.Integer> UNSIGNED_SHORT
INTEGER_ARRAY
public static FieldType<int[]> INTEGER_ARRAY
LONG
public static FieldType<java.lang.Long> LONG
LONG_ARRAY
public static FieldType<long[]> LONG_ARRAY
CHAR
public static FieldType<java.lang.Character> CHAR
CHAR_ARRAY
public static FieldType<char[]> CHAR_ARRAY
FLOAT
public static FieldType<java.lang.Float> FLOAT
FLOAT_ARRAY
public static FieldType<float[]> FLOAT_ARRAY
DOUBLE
public static FieldType<java.lang.Double> DOUBLE
DOUBLE_ARRAY
public static FieldType<double[]> DOUBLE_ARRAY
STRING
public static FieldType<java.lang.String> STRING
STRING_ARRAY
public static FieldType<java.lang.String[]> STRING_ARRAY
ENCODABLE
public static FieldType<Encodable> ENCODABLE
ENCODABLE_ARRAY
public static FieldType<Encodable[]> ENCODABLE_ARRAY
SERIALIZABLE
public static FieldType<java.io.Serializable> SERIALIZABLE
SERIALIZABLE_ARRAY
public static FieldType<java.io.Serializable[]> SERIALIZABLE_ARRAY
get
public static FieldType<?> get(byte idx)
getIdx
public byte getIdx()
getCls
public java.lang.Class<T> getCls()
checksStream
protected boolean checksStream()
- Whether this implementation checks ordering in the stream.
Broadly, the type safe ones do, the Encodable and Serializable ones do not.
read
public final T read(DataInputExtended input)
throws java.io.IOException
- Throws:
java.io.IOException
readArray
public final <Q> Q[] readArray(DataInputExtended input,
java.lang.Class<Q> elementType)
throws java.io.IOException
- Throws:
java.io.IOException
write
public final void write(DataOutputExtended output,
T value)
throws java.io.IOException
- Throws:
java.io.IOException
doRead
protected T doRead(DataInputExtended input)
throws java.io.IOException
- Throws:
java.io.IOException
doReadArray
protected <Q> Q[] doReadArray(DataInputExtended input,
java.lang.Class<Q> elementType)
throws java.io.IOException
- Throws:
java.io.IOException
doWrite
protected abstract void doWrite(DataOutputExtended output,
T value)
throws java.io.IOException
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.