com.thoughtworks.xstream.converters.reflection
Class PureJavaReflectionProvider
java.lang.Object
com.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
and any class that implements java.io.Serializable.
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fieldDictionary
protected FieldDictionary fieldDictionary
PureJavaReflectionProvider
public PureJavaReflectionProvider()
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/