com.thoughtworks.xstream.converters.reflection
Class Sun14ReflectionProvider

java.lang.Object
  extended by com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
      extended by com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider
All Implemented Interfaces:
ReflectionProvider

public class Sun14ReflectionProvider
extends PureJavaReflectionProvider

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). This is the same method used by the internals of standard Java serialization, but relies on internal Sun code that may not be present on all JVMs.

Author:
Joe Walnes, Brian Slesinsky

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.converters.reflection.ReflectionProvider
ReflectionProvider.Visitor
 
Field Summary
 
Fields inherited from class com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
fieldDictionary
 
Constructor Summary
Sun14ReflectionProvider()
           
 
Method Summary
 java.lang.Object newInstance(java.lang.Class type)
          Creates a new instance of the specified type using the default (null) constructor.
protected  java.lang.Object readResolve()
           
protected  void validateFieldAccess(java.lang.reflect.Field field)
           
 void writeField(java.lang.Object object, java.lang.String fieldName, java.lang.Object value, java.lang.Class definedIn)
           
 
Methods inherited from class com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
fieldDefinedInClass, fieldModifiersSupported, getField, getFieldType, visitSerializableFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sun14ReflectionProvider

public Sun14ReflectionProvider()
Method Detail

newInstance

public java.lang.Object newInstance(java.lang.Class type)
Description copied from interface: ReflectionProvider
Creates a new instance of the specified type using the default (null) constructor.

Specified by:
newInstance in interface ReflectionProvider
Overrides:
newInstance in class PureJavaReflectionProvider
Parameters:
type - the type to instantiate
Returns:
a new instance of this type

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
Overrides:
writeField in class PureJavaReflectionProvider

validateFieldAccess

protected void validateFieldAccess(java.lang.reflect.Field field)
Overrides:
validateFieldAccess in class PureJavaReflectionProvider

readResolve

protected java.lang.Object readResolve()
Overrides:
readResolve in class PureJavaReflectionProvider


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