java.lang.Object |
↳ |
com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider |
Known Direct Subclasses
HarmonyReflectionProvider |
Instantiates a new object on the Harmony JVM by bypassing the constructor (meaning code in
the constructor will never be executed and parameters do not have to be known). |
Sun14ReflectionProvider |
Instantiates a new object on the Sun JVM by bypassing the constructor (meaning code in the constructor
will never be executed and parameters do not have to be known). |
|
Class Overview
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.
Fields
Public Constructors
public
PureJavaReflectionProvider
()
Public Methods
public
boolean
fieldDefinedInClass
(String fieldName, Class type)
public
Field
getField
(Class definedIn, String fieldName)
Returns a field defined in some class.
Parameters
definedIn
| class where the field was defined |
fieldName
| field name |
public
Object
newInstance
(Class type)
Creates a new instance of the specified type. It is in the responsibility
of the implementation how such an instance is created.
Parameters
type
| the type to instantiate |
Returns
- a new instance of this type
Protected Methods
protected
boolean
fieldModifiersSupported
(Field field)
protected
Object
readResolve
()
protected
void
validateFieldAccess
(Field field)