com.thoughtworks.xstream.converters.reflection
Class PureJavaReflectionProvider

java.lang.Object
  extended bycom.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
All Implemented Interfaces:
ReflectionProvider
Direct Known Subclasses:
Sun14ReflectionProvider

public class PureJavaReflectionProvider
extends java.lang.Object
implements ReflectionProvider

Pure Java ObjectFactory that instantiates objects using standard Java reflection, however the types of objects that can be constructed are limited.

Can newInstance: classes with public visibility, outer classes, static inner classes, classes with default constructors. Cannot newInstance: classes without public visibility, non-static inner classes, classes without default constructors. Note that any code in the constructor of a class will be executed when the ObjectFactory instantiates the object.


Nested Class Summary
 
Nested classes inherited from class com.thoughtworks.xstream.converters.reflection.ReflectionProvider
ReflectionProvider.Visitor
 
Field Summary
protected  FieldDictionary fieldDictionary
           
 
Constructor Summary
PureJavaReflectionProvider()
           
 
Method Summary
 boolean fieldDefinedInClass(java.lang.String fieldName, java.lang.Class type)
           
protected  boolean fieldModifiersSupported(java.lang.reflect.Field field)
           
 java.lang.Class getFieldType(java.lang.Object object, java.lang.String fieldName, java.lang.Class definedIn)
           
 java.lang.Object newInstance(java.lang.Class type)
           
protected  void validateFieldAccess(java.lang.reflect.Field field)
           
 void visitSerializableFields(java.lang.Object object, ReflectionProvider.Visitor visitor)
           
 void writeField(java.lang.Object object, java.lang.String fieldName, java.lang.Object value, java.lang.Class definedIn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldDictionary

protected FieldDictionary fieldDictionary
Constructor Detail

PureJavaReflectionProvider

public PureJavaReflectionProvider()
Method Detail

newInstance

public java.lang.Object newInstance(java.lang.Class type)
Specified by:
newInstance in interface ReflectionProvider

visitSerializableFields

public void visitSerializableFields(java.lang.Object object,
                                    ReflectionProvider.Visitor visitor)
Specified by:
visitSerializableFields in interface ReflectionProvider

writeField

public void writeField(java.lang.Object object,
                       java.lang.String fieldName,
                       java.lang.Object value,
                       java.lang.Class definedIn)
Specified by:
writeField in interface ReflectionProvider

getFieldType

public java.lang.Class getFieldType(java.lang.Object object,
                                    java.lang.String fieldName,
                                    java.lang.Class definedIn)
Specified by:
getFieldType in interface ReflectionProvider

fieldDefinedInClass

public boolean fieldDefinedInClass(java.lang.String fieldName,
                                   java.lang.Class type)
Specified by:
fieldDefinedInClass in interface ReflectionProvider

fieldModifiersSupported

protected boolean fieldModifiersSupported(java.lang.reflect.Field field)

validateFieldAccess

protected void validateFieldAccess(java.lang.reflect.Field field)


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