|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.export.ObjectMarshaller
public class ObjectMarshaller
Used to read and write object fields.
| Nested Class Summary | |
|---|---|
protected class |
ObjectMarshaller.FieldData
Contains information on a single field. |
| Field Summary | |
|---|---|
protected ObjectMarshaller.FieldData[] |
_fields
The object's field data. |
protected static HashMap<Class<?>,ObjectMarshaller> |
_marshallers
Maps classes to created marshallers. |
protected Object |
_prototype
The prototype object. |
protected Method |
_reader
The custom read method. |
protected Method |
_writer
The custom write method. |
| Constructor Summary | |
|---|---|
protected |
ObjectMarshaller(Class<?> clazz)
Creates a marshaller for objects of the specified class. |
| Method Summary | |
|---|---|
protected static void |
getExportableFields(Class<?> clazz,
ArrayList<Field> fields)
Places all of the given class's exportable fields into the supplied list. |
static ObjectMarshaller |
getObjectMarshaller(Class<?> clazz)
Retrieves or creates a marshaller for objects of the specified class. |
Object |
getPrototype()
Returns a reference to the prototype object (used to determine field defaults). |
void |
readFields(Object object,
Importer importer,
boolean useReader)
Reads the fields of an object from the specified importer. |
void |
writeFields(Object object,
Exporter exporter,
boolean useWriter)
Writes the fields of an object to the specified exporter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Method _reader
protected Method _writer
protected ObjectMarshaller.FieldData[] _fields
protected Object _prototype
protected static HashMap<Class<?>,ObjectMarshaller> _marshallers
| Constructor Detail |
|---|
protected ObjectMarshaller(Class<?> clazz)
| Method Detail |
|---|
public static ObjectMarshaller getObjectMarshaller(Class<?> clazz)
public Object getPrototype()
public void readFields(Object object,
Importer importer,
boolean useReader)
throws IOException
IOException
public void writeFields(Object object,
Exporter exporter,
boolean useWriter)
throws IOException
IOException
protected static void getExportableFields(Class<?> clazz,
ArrayList<Field> fields)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||