com.thoughtworks.xstream.converters.javabean
Class BeanProvider

java.lang.Object
  extended by com.thoughtworks.xstream.converters.javabean.BeanProvider
All Implemented Interfaces:
JavaBeanProvider

public class BeanProvider
extends Object
implements JavaBeanProvider


Nested Class Summary
static interface BeanProvider.Visitor
          Deprecated. As of 1.4 use JavaBeanProvider.Visitor
 
Field Summary
protected static Object[] NO_PARAMS
           
protected  PropertyDictionary propertyDictionary
           
 
Constructor Summary
BeanProvider()
          Construct a BeanProvider that will process the bean properties in their natural order.
BeanProvider(Comparator propertyNameComparator)
          Construct a BeanProvider with a comparator to sort the bean properties by name in the dictionary.
BeanProvider(PropertyDictionary propertyDictionary)
          Construct a BeanProvider with a provided property dictionary.
 
Method Summary
 boolean canInstantiate(Class type)
          Returns true if the Bean provider can instantiate the specified class
protected  boolean canStreamProperty(PropertyDescriptor descriptor)
           
protected  Constructor getDefaultConstrutor(Class type)
          Returns the default constructor, or null if none is found
protected  PropertyDescriptor getProperty(String name, Class type)
           
 Class getPropertyType(Object object, String name)
           
protected  PropertyDescriptor[] getSerializableProperties(Object object)
           
 Object newInstance(Class type)
           
 boolean propertyDefinedInClass(String name, Class type)
           
 boolean propertyWriteable(String name, Class type)
           
 void visitSerializableProperties(Object object, JavaBeanProvider.Visitor visitor)
           
 void writeProperty(Object object, String propertyName, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PARAMS

protected static final Object[] NO_PARAMS

propertyDictionary

protected PropertyDictionary propertyDictionary
Constructor Detail

BeanProvider

public BeanProvider()
Construct a BeanProvider that will process the bean properties in their natural order.


BeanProvider

public BeanProvider(Comparator propertyNameComparator)
Construct a BeanProvider with a comparator to sort the bean properties by name in the dictionary.

Parameters:
propertyNameComparator - the comparator

BeanProvider

public BeanProvider(PropertyDictionary propertyDictionary)
Construct a BeanProvider with a provided property dictionary.

Parameters:
propertyDictionary - the property dictionary to use
Since:
1.4
Method Detail

newInstance

public Object newInstance(Class type)
Specified by:
newInstance in interface JavaBeanProvider

visitSerializableProperties

public void visitSerializableProperties(Object object,
                                        JavaBeanProvider.Visitor visitor)
Specified by:
visitSerializableProperties in interface JavaBeanProvider

writeProperty

public void writeProperty(Object object,
                          String propertyName,
                          Object value)
Specified by:
writeProperty in interface JavaBeanProvider

getPropertyType

public Class getPropertyType(Object object,
                             String name)
Specified by:
getPropertyType in interface JavaBeanProvider

propertyDefinedInClass

public boolean propertyDefinedInClass(String name,
                                      Class type)
Specified by:
propertyDefinedInClass in interface JavaBeanProvider

canInstantiate

public boolean canInstantiate(Class type)
Returns true if the Bean provider can instantiate the specified class

Specified by:
canInstantiate in interface JavaBeanProvider

getDefaultConstrutor

protected Constructor getDefaultConstrutor(Class type)
Returns the default constructor, or null if none is found

Parameters:
type -

getSerializableProperties

protected PropertyDescriptor[] getSerializableProperties(Object object)

canStreamProperty

protected boolean canStreamProperty(PropertyDescriptor descriptor)

propertyWriteable

public boolean propertyWriteable(String name,
                                 Class type)

getProperty

protected PropertyDescriptor getProperty(String name,
                                         Class type)


Copyright © 2004-2014 XStream. All Rights Reserved.