Interface ObjectDecoder
-
- All Known Implementing Classes:
BinaryObjectDecoder,XmlObjectDecoder
public interface ObjectDecoderInterface to abstract away the difference between deserializing xml and binary
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetNumSubObjects()Returns the number of anonymous sub-objects.booleanreadBooleanContents()Reads the value in-line.booleanreadBooleanField(String fieldName, boolean dflt)Reads a boolean.byte[]readByteArrayContents()reads the value in-line.bytereadByteContents()reads the value in-line.Class<?>readClassContents()reads the value in-line.Class<?>readClassField(String fieldName, Class<?> dflt)Reads a Class.doublereadDoubleContents()reads the value in-line.doublereadDoubleField(String fieldName, double dflt)Reads a double.floatreadFloatContents()Reads the value in-line.floatreadFloatField(String fieldName, float dflt)Reads a float.intreadIntContents()Reads the value in-line.intreadIntField(String fieldName, int dflt)Reads an int.longreadLongContents()reads the value in-line.longreadLongField(String fieldName, long dflt)Reads a long.ObjectreadObjectContents(int index)Reads a sub-objectObjectreadObjectField(String fieldName, Class<?> expectedType, Object dflt)Reads an object using the appropriate serializer for that objectStringreadStringContents()Reads the value in-line.StringreadStringField(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
-
-