Class BeanProvider
- java.lang.Object
-
- com.thoughtworks.xstream.converters.javabean.BeanProvider
-
- All Implemented Interfaces:
JavaBeanProvider
public class BeanProvider extends java.lang.Object implements JavaBeanProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BeanProvider.Visitor
Deprecated.As of 1.4 useJavaBeanProvider.Visitor
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Object[]
NO_PARAMS
Deprecated.As of 1.4.6protected PropertyDictionary
propertyDictionary
-
Constructor Summary
Constructors Constructor Description BeanProvider()
Construct a BeanProvider that will process the bean properties in their natural order.BeanProvider(PropertyDictionary propertyDictionary)
Construct a BeanProvider with a provided property dictionary.BeanProvider(java.util.Comparator propertyNameComparator)
Construct a BeanProvider with a comparator to sort the bean properties by name in the dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canInstantiate(java.lang.Class type)
Returns true if the Bean provider can instantiate the specified classprotected boolean
canStreamProperty(java.beans.PropertyDescriptor descriptor)
protected java.lang.reflect.Constructor
getDefaultConstrutor(java.lang.Class type)
Deprecated.As of 1.4.6 usenewInstance(Class)
orcanInstantiate(Class)
directly.protected java.beans.PropertyDescriptor
getProperty(java.lang.String name, java.lang.Class type)
java.lang.Class
getPropertyType(java.lang.Object object, java.lang.String name)
protected java.beans.PropertyDescriptor[]
getSerializableProperties(java.lang.Object object)
java.lang.Object
newInstance(java.lang.Class type)
boolean
propertyDefinedInClass(java.lang.String name, java.lang.Class type)
boolean
propertyWriteable(java.lang.String name, java.lang.Class type)
void
visitSerializableProperties(java.lang.Object object, JavaBeanProvider.Visitor visitor)
void
writeProperty(java.lang.Object object, java.lang.String propertyName, java.lang.Object value)
-
-
-
Field Detail
-
NO_PARAMS
protected static final java.lang.Object[] NO_PARAMS
Deprecated.As of 1.4.6
-
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(java.util.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 java.lang.Object newInstance(java.lang.Class type)
- Specified by:
newInstance
in interfaceJavaBeanProvider
-
visitSerializableProperties
public void visitSerializableProperties(java.lang.Object object, JavaBeanProvider.Visitor visitor)
- Specified by:
visitSerializableProperties
in interfaceJavaBeanProvider
-
writeProperty
public void writeProperty(java.lang.Object object, java.lang.String propertyName, java.lang.Object value)
- Specified by:
writeProperty
in interfaceJavaBeanProvider
-
getPropertyType
public java.lang.Class getPropertyType(java.lang.Object object, java.lang.String name)
- Specified by:
getPropertyType
in interfaceJavaBeanProvider
-
propertyDefinedInClass
public boolean propertyDefinedInClass(java.lang.String name, java.lang.Class type)
- Specified by:
propertyDefinedInClass
in interfaceJavaBeanProvider
-
canInstantiate
public boolean canInstantiate(java.lang.Class type)
Returns true if the Bean provider can instantiate the specified class- Specified by:
canInstantiate
in interfaceJavaBeanProvider
-
getDefaultConstrutor
protected java.lang.reflect.Constructor getDefaultConstrutor(java.lang.Class type)
Deprecated.As of 1.4.6 usenewInstance(Class)
orcanInstantiate(Class)
directly.Returns the default constructor, or null if none is found- Parameters:
type
-
-
getSerializableProperties
protected java.beans.PropertyDescriptor[] getSerializableProperties(java.lang.Object object)
-
canStreamProperty
protected boolean canStreamProperty(java.beans.PropertyDescriptor descriptor)
-
propertyWriteable
public boolean propertyWriteable(java.lang.String name, java.lang.Class type)
-
getProperty
protected java.beans.PropertyDescriptor getProperty(java.lang.String name, java.lang.Class type)
-
-