com.caucho.hessian.io
Class UnsafeDeserializer

java.lang.Object
  extended by com.caucho.hessian.io.AbstractDeserializer
      extended by com.caucho.hessian.io.AbstractMapDeserializer
          extended by com.caucho.hessian.io.UnsafeDeserializer
All Implemented Interfaces:
Deserializer

public class UnsafeDeserializer
extends AbstractMapDeserializer

Serializing an object for known object types.


Field Summary
 
Fields inherited from class com.caucho.hessian.io.AbstractDeserializer
NULL
 
Constructor Summary
UnsafeDeserializer(java.lang.Class<?> cl)
           
 
Method Summary
 java.lang.Object createField(java.lang.String name)
          Creates a field value class.
 java.lang.Object[] createFields(int len)
          Creates the field array for a class.
protected  java.util.HashMap<java.lang.String,com.caucho.hessian.io.UnsafeDeserializer.FieldDeserializer> getFieldMap(java.lang.Class<?> cl)
          Creates a map of the classes fields.
protected  java.lang.reflect.Method getReadResolve(java.lang.Class<?> cl)
          Returns the readResolve method
 java.lang.Class<?> getType()
           
protected  java.lang.Object instantiate()
           
static boolean isEnabled()
           
 boolean isReadResolve()
           
 java.lang.Object readMap(AbstractHessianInput in)
           
 java.lang.Object readMap(AbstractHessianInput in, java.lang.Object obj)
           
 java.lang.Object readObject(AbstractHessianInput in, java.lang.Object[] fields)
          Reads an object instance from the input stream
 java.lang.Object readObject(AbstractHessianInput in, java.lang.Object obj, java.lang.String[] fieldNames)
           
 java.lang.Object readObject(AbstractHessianInput in, java.lang.Object obj, com.caucho.hessian.io.UnsafeDeserializer.FieldDeserializer[] fields)
           
 java.lang.Object readObject(AbstractHessianInput in, java.lang.String[] fieldNames)
           
protected  java.lang.Object resolve(AbstractHessianInput in, java.lang.Object obj)
           
 
Methods inherited from class com.caucho.hessian.io.AbstractMapDeserializer
readObject
 
Methods inherited from class com.caucho.hessian.io.AbstractDeserializer
codeName, error, readLengthList, readList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsafeDeserializer

public UnsafeDeserializer(java.lang.Class<?> cl)
Method Detail

isEnabled

public static boolean isEnabled()

getType

public java.lang.Class<?> getType()
Specified by:
getType in interface Deserializer
Overrides:
getType in class AbstractMapDeserializer

isReadResolve

public boolean isReadResolve()
Specified by:
isReadResolve in interface Deserializer
Overrides:
isReadResolve in class AbstractDeserializer

readMap

public java.lang.Object readMap(AbstractHessianInput in)
                         throws java.io.IOException
Specified by:
readMap in interface Deserializer
Overrides:
readMap in class AbstractDeserializer
Throws:
java.io.IOException

createFields

public java.lang.Object[] createFields(int len)
Description copied from class: AbstractDeserializer
Creates the field array for a class. The default implementation returns a String[] array.

Specified by:
createFields in interface Deserializer
Overrides:
createFields in class AbstractDeserializer
Parameters:
len - number of items in the array
Returns:
the new empty array

createField

public java.lang.Object createField(java.lang.String name)
Description copied from class: AbstractDeserializer
Creates a field value class. The default implementation returns the String.

Specified by:
createField in interface Deserializer
Overrides:
createField in class AbstractDeserializer
Parameters:
name - the field name
Returns:
the new empty array

readObject

public java.lang.Object readObject(AbstractHessianInput in,
                                   java.lang.Object[] fields)
                            throws java.io.IOException
Description copied from class: AbstractDeserializer
Reads an object instance from the input stream

Specified by:
readObject in interface Deserializer
Overrides:
readObject in class AbstractDeserializer
Parameters:
in - the input stream
fields - the deserializer's own field marshal
Returns:
the new object
Throws:
java.io.IOException

readObject

public java.lang.Object readObject(AbstractHessianInput in,
                                   java.lang.String[] fieldNames)
                            throws java.io.IOException
Specified by:
readObject in interface Deserializer
Overrides:
readObject in class AbstractDeserializer
Throws:
java.io.IOException

getReadResolve

protected java.lang.reflect.Method getReadResolve(java.lang.Class<?> cl)
Returns the readResolve method


readMap

public java.lang.Object readMap(AbstractHessianInput in,
                                java.lang.Object obj)
                         throws java.io.IOException
Throws:
java.io.IOException

readObject

public java.lang.Object readObject(AbstractHessianInput in,
                                   java.lang.Object obj,
                                   com.caucho.hessian.io.UnsafeDeserializer.FieldDeserializer[] fields)
                            throws java.io.IOException
Throws:
java.io.IOException

readObject

public java.lang.Object readObject(AbstractHessianInput in,
                                   java.lang.Object obj,
                                   java.lang.String[] fieldNames)
                            throws java.io.IOException
Throws:
java.io.IOException

resolve

protected java.lang.Object resolve(AbstractHessianInput in,
                                   java.lang.Object obj)
                            throws java.lang.Exception
Throws:
java.lang.Exception

instantiate

protected java.lang.Object instantiate()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getFieldMap

protected java.util.HashMap<java.lang.String,com.caucho.hessian.io.UnsafeDeserializer.FieldDeserializer> getFieldMap(java.lang.Class<?> cl)
Creates a map of the classes fields.