Interface ObjectDecoder
- All Known Implementing Classes:
BinaryObjectDecoder
,XmlObjectDecoder
public interface ObjectDecoder
Interface to abstract away the difference between deserializing
xml and binary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of anonymous sub-objects.boolean
Reads the value in-line.boolean
readBooleanField
(String fieldName, boolean dflt) Reads a boolean.byte[]
reads the value in-line.byte
reads the value in-line.Class
<?> reads the value in-line.Class
<?> readClassField
(String fieldName, Class<?> dflt) Reads a Class.double
reads the value in-line.double
readDoubleField
(String fieldName, double dflt) Reads a double.float
Reads the value in-line.float
readFloatField
(String fieldName, float dflt) Reads a float.int
Reads the value in-line.int
readIntField
(String fieldName, int dflt) Reads an int.long
reads the value in-line.long
readLongField
(String fieldName, long dflt) Reads a long.readObjectContents
(int index) Reads a sub-objectreadObjectField
(String fieldName, Class<?> expectedType, Object dflt) Reads an object using the appropriate serializer for that objectReads the value in-line.readStringField
(String fieldName, String dflt) Reads a String.
-
Method Details
-
readObjectField
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
Reads a boolean.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readIntField
Reads an int.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readLongField
Reads a long.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readFloatField
Reads a float.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readClassField
Reads a Class.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readStringField
Reads a String.- Parameters:
fieldName
- A hint of the field name. Ignored for binary serialization. The attribute name for xml serialization
-
readDoubleField
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
Reads a sub-object
-