public class XmlObjectDecoder extends Object implements ObjectDecoder
Constructor and Description |
---|
XmlObjectDecoder(Element node,
Class<?> expectedClass) |
Modifier and Type | Method and 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 name,
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 |
readObject() |
Object |
readObjectContents(int index)
Reads a sub-object
|
Object |
readObjectField(String fieldName,
Class<?> expected,
Object dflt)
Reads an object using the appropriate serializer for that object
|
String |
readStringContents()
Reads the value in-line.
|
String |
readStringField(String fieldName,
String dflt)
Reads a String.
|
public Object readObject()
public boolean readBooleanContents()
ObjectDecoder
readBooleanContents
in interface ObjectDecoder
public boolean readBooleanField(String fieldName, boolean dflt)
ObjectDecoder
readBooleanField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic byte readByteContents()
ObjectDecoder
readByteContents
in interface ObjectDecoder
public byte[] readByteArrayContents()
ObjectDecoder
readByteArrayContents
in interface ObjectDecoder
public Class<?> readClassContents()
ObjectDecoder
readClassContents
in interface ObjectDecoder
public Class<?> readClassField(String name, Class<?> dflt)
ObjectDecoder
readClassField
in interface ObjectDecoder
name
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic double readDoubleContents()
ObjectDecoder
readDoubleContents
in interface ObjectDecoder
public double readDoubleField(String fieldName, double dflt)
ObjectDecoder
readDoubleField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic float readFloatContents()
ObjectDecoder
readFloatContents
in interface ObjectDecoder
public float readFloatField(String fieldName, float dflt)
ObjectDecoder
readFloatField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic int readIntContents()
ObjectDecoder
readIntContents
in interface ObjectDecoder
public int readIntField(String fieldName, int dflt)
ObjectDecoder
readIntField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic long readLongContents()
ObjectDecoder
readLongContents
in interface ObjectDecoder
public long readLongField(String fieldName, long dflt)
ObjectDecoder
readLongField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationpublic int getNumSubObjects()
ObjectDecoder
getNumSubObjects
in interface ObjectDecoder
public Object readObjectContents(int index)
ObjectDecoder
readObjectContents
in interface ObjectDecoder
public Object readObjectField(String fieldName, Class<?> expected, Object dflt)
ObjectDecoder
readObjectField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The subelement name for xml serializationpublic String readStringContents()
ObjectDecoder
readStringContents
in interface ObjectDecoder
public String readStringField(String fieldName, String dflt)
ObjectDecoder
readStringField
in interface ObjectDecoder
fieldName
- A hint of the field name. Ignored for binary
serialization. The attribute name for xml serializationCopyright © 2022. All rights reserved.