T - The type from which objects are deserializedpublic class ReflectionReadHandler<T> extends java.lang.Object implements ReadHandler<T>
| Modifier and Type | Field and Description |
|---|---|
protected ObjectReader<T> |
m_reader
The internal object reader
|
| Constructor and Description |
|---|
ReflectionReadHandler(ObjectReader<T> reader)
Creates a new reflection read handler
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(T o)
Indicates whether this handler can take care of reading a particular
object.
|
java.lang.Object |
handle(T o)
Reads an object
|
protected java.lang.Object |
populateObject(java.lang.Object o,
java.util.Map<java.lang.String,java.lang.Object> contents,
java.lang.Class<?> clazz)
Populates an instance of an object based on its deserialized
contents.
|
protected ObjectReader<T> m_reader
public ReflectionReadHandler(ObjectReader<T> reader)
reader - The internal object readerpublic boolean canHandle(T o) throws ReadException
ReadHandlercanHandle in interface ReadHandler<T>o - The serialized version of the objectReadException - The internal object printerpublic java.lang.Object handle(T o) throws ReadException
ReadHandlerhandle in interface ReadHandler<T>o - The serialized version of the objectReadException - Thrown if the object cannot be readprotected java.lang.Object populateObject(java.lang.Object o,
java.util.Map<java.lang.String,java.lang.Object> contents,
java.lang.Class<?> clazz)
throws ReadException
o - The object to use as the basis for the populationcontents - The deserialized member fields of the objectclazz - The class this object should be an instance ofo.ReadException - If the operation cannot be carried onCopyright © Sylvain HallĂ©. All Rights Reserved.