com.thoughtworks.xstream.converters.reflection
Class AbstractReflectionConverter

java.lang.Object
  extended bycom.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
All Implemented Interfaces:
Converter, ConverterMatcher
Direct Known Subclasses:
ReflectionConverter, SerializableConverter

public abstract class AbstractReflectionConverter
extends java.lang.Object
implements Converter


Nested Class Summary
static class AbstractReflectionConverter.DuplicateFieldException
           
 
Field Summary
protected  Mapper mapper
           
protected  ReflectionProvider reflectionProvider
           
protected  SerializationMethodInvoker serializationMethodInvoker
           
 
Constructor Summary
AbstractReflectionConverter(Mapper mapper, ReflectionProvider reflectionProvider)
           
 
Method Summary
protected  void doMarshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
           
 java.lang.Object doUnmarshal(java.lang.Object result, HierarchicalStreamReader reader, UnmarshallingContext context)
           
protected  java.lang.Object instantiateNewInstance(HierarchicalStreamReader reader, UnmarshallingContext context)
           
 void marshal(java.lang.Object original, HierarchicalStreamWriter writer, MarshallingContext context)
          Convert an object to textual data.
protected  void marshallField(MarshallingContext context, java.lang.Object newObj, java.lang.reflect.Field field)
           
 java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
          Convert textual data back into an object.
protected  java.lang.Object unmarshallField(UnmarshallingContext context, java.lang.Object result, java.lang.Class type, java.lang.reflect.Field field)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.thoughtworks.xstream.converters.ConverterMatcher
canConvert
 

Field Detail

reflectionProvider

protected final ReflectionProvider reflectionProvider

mapper

protected final Mapper mapper

serializationMethodInvoker

protected transient SerializationMethodInvoker serializationMethodInvoker
Constructor Detail

AbstractReflectionConverter

public AbstractReflectionConverter(Mapper mapper,
                                   ReflectionProvider reflectionProvider)
Method Detail

marshal

public void marshal(java.lang.Object original,
                    HierarchicalStreamWriter writer,
                    MarshallingContext context)
Description copied from interface: Converter
Convert an object to textual data.

Specified by:
marshal in interface Converter
Parameters:
original - The object to be marshalled.
writer - A stream to write to.
context - A context that allows nested objects to be processed by XStream.

doMarshal

protected void doMarshal(java.lang.Object source,
                         HierarchicalStreamWriter writer,
                         MarshallingContext context)

marshallField

protected void marshallField(MarshallingContext context,
                             java.lang.Object newObj,
                             java.lang.reflect.Field field)

unmarshal

public java.lang.Object unmarshal(HierarchicalStreamReader reader,
                                  UnmarshallingContext context)
Description copied from interface: Converter
Convert textual data back into an object.

Specified by:
unmarshal in interface Converter
Parameters:
reader - The stream to read the text from.
context -
Returns:
The resulting object.

doUnmarshal

public java.lang.Object doUnmarshal(java.lang.Object result,
                                    HierarchicalStreamReader reader,
                                    UnmarshallingContext context)

unmarshallField

protected java.lang.Object unmarshallField(UnmarshallingContext context,
                                           java.lang.Object result,
                                           java.lang.Class type,
                                           java.lang.reflect.Field field)

instantiateNewInstance

protected java.lang.Object instantiateNewInstance(HierarchicalStreamReader reader,
                                                  UnmarshallingContext context)


Joe Walnes, http://xstream.codehaus.org/