Interface ObjectDecoder
-
- All Known Implementing Classes:
BinaryObjectDecoder
,XmlObjectDecoder
public interface ObjectDecoder
Interface to abstract away the difference between deserializing xml and binary
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getNumSubObjects()
Returns the number of anonymous sub-objects.boolean
readBooleanContents()
Reads the value in-line.boolean
readBooleanField(String fieldName, boolean dflt)
Reads a boolean.byte[]
readByteArrayContents()
reads the value in-line.byte
readByteContents()
reads the value in-line.Class<?>
readClassContents()
reads the value in-line.Class<?>
readClassField(String fieldName, Class<?> dflt)
Reads a Class.double
readDoubleContents()
reads the value in-line.double
readDoubleField(String fieldName, double dflt)
Reads a double.float
readFloatContents()
Reads the value in-line.float
readFloatField(String fieldName, float dflt)
Reads a float.int
readIntContents()
Reads the value in-line.int
readIntField(String fieldName, int dflt)
Reads an int.long
readLongContents()
reads the value in-line.long
readLongField(String fieldName, long dflt)
Reads a long.Object
readObjectContents(int index)
Reads a sub-objectObject
readObjectField(String fieldName, Class<?> expectedType, Object dflt)
Reads an object using the appropriate serializer for that objectString
readStringContents()
Reads the value in-line.String
readStringField(String fieldName, String dflt)
Reads a String.
-
-
-
Method Detail
-
readObjectField
Object readObjectField(String fieldName, Class<?> expectedType, Object dflt)
Reads an object using the appropriate serializer for that object- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The subelement name for xml serialization
-
readBooleanField
boolean readBooleanField(String fieldName, boolean dflt)
Reads a boolean.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readIntField
int readIntField(String fieldName, int dflt)
Reads an int.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readLongField
long readLongField(String fieldName, long dflt)
Reads a long.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readFloatField
float readFloatField(String fieldName, float dflt)
Reads a float.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readClassField
Class<?> readClassField(String fieldName, Class<?> dflt)
Reads a Class.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readStringField
String readStringField(String fieldName, String dflt)
Reads a String.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readDoubleField
double readDoubleField(String fieldName, double dflt)
Reads a double.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readStringContents
String readStringContents()
Reads the value in-line.
-
readBooleanContents
boolean readBooleanContents()
Reads the value in-line.
-
readIntContents
int readIntContents()
Reads the value in-line.
-
readLongContents
long readLongContents()
reads the value in-line.
-
readFloatContents
float readFloatContents()
Reads the value in-line.
-
readDoubleContents
double readDoubleContents()
reads the value in-line.
-
readByteContents
byte readByteContents()
reads the value in-line.
-
readByteArrayContents
byte[] readByteArrayContents()
reads the value in-line.
-
readClassContents
Class<?> readClassContents()
reads the value in-line.
-
getNumSubObjects
int getNumSubObjects()
Returns the number of anonymous sub-objects.- Returns:
-
readObjectContents
Object readObjectContents(int index)
Reads a sub-object
-
-