Package org.jboss.marshalling.util
Class ReadField
- java.lang.Object
-
- org.jboss.marshalling.util.ReadField
-
- All Implemented Interfaces:
java.lang.Comparable<ReadField>
- Direct Known Subclasses:
BooleanReadField,ByteReadField,CharReadField,DoubleReadField,FloatReadField,IntReadField,LongReadField,ObjectReadField,ShortReadField
public abstract class ReadField extends java.lang.Object implements java.lang.Comparable<ReadField>
Base class for a field which was read from the data stream.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedReadField(java.lang.String name, boolean defaulted)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(ReadField o)Compare this field with another on the basis of its name.booleangetBoolean()Get the boolean value of this field.bytegetByte()Get the byte value of this field.chargetChar()Get the character value of this field.doublegetDouble()Get the double value of this field.floatgetFloat()Get the float value of this field.intgetInt()Get the integer value of this field.abstract KindgetKind()Get the kind of field represented by this object.longgetLong()Get the long value of this field.java.lang.StringgetName()Get the field name.java.lang.ObjectgetObject()Get the object value of this field.shortgetShort()Get the short value of this field.booleanisDefaulted()Determine whether this field was defaulted.private static java.lang.IllegalArgumentExceptionwrongFieldType()
-
-
-
Method Detail
-
getKind
public abstract Kind getKind()
Get the kind of field represented by this object.- Returns:
- the kind of field represented by this object
-
getName
public java.lang.String getName()
Get the field name.- Returns:
- the field name
-
isDefaulted
public boolean isDefaulted()
Determine whether this field was defaulted.- Returns:
trueif this field value was defaulted,falseotherwise
-
getBoolean
public boolean getBoolean() throws java.io.IOExceptionGet the boolean value of this field.- Returns:
- the boolean value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getChar
public char getChar() throws java.io.IOExceptionGet the character value of this field.- Returns:
- the character value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getFloat
public float getFloat() throws java.io.IOExceptionGet the float value of this field.- Returns:
- the float value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getDouble
public double getDouble() throws java.io.IOExceptionGet the double value of this field.- Returns:
- the double value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getByte
public byte getByte() throws java.io.IOExceptionGet the byte value of this field.- Returns:
- the byte value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getShort
public short getShort() throws java.io.IOExceptionGet the short value of this field.- Returns:
- the short value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getInt
public int getInt() throws java.io.IOExceptionGet the integer value of this field.- Returns:
- the integer value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getLong
public long getLong() throws java.io.IOExceptionGet the long value of this field.- Returns:
- the long value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
getObject
public java.lang.Object getObject() throws java.io.IOExceptionGet the object value of this field.- Returns:
- the object value of this field
- Throws:
java.io.IOException- if the value cannot be read
-
wrongFieldType
private static java.lang.IllegalArgumentException wrongFieldType()
-
-