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 interfaceBeanProvider.VisitorDeprecated.As of 1.4 useJavaBeanProvider.Visitor
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Object[]NO_PARAMSDeprecated.As of 1.4.6protected PropertyDictionarypropertyDictionary
-
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 booleancanInstantiate(java.lang.Class type)Returns true if the Bean provider can instantiate the specified classprotected booleancanStreamProperty(java.beans.PropertyDescriptor descriptor)protected java.lang.reflect.ConstructorgetDefaultConstrutor(java.lang.Class type)Deprecated.As of 1.4.6 usenewInstance(Class)orcanInstantiate(Class)directly.protected java.beans.PropertyDescriptorgetProperty(java.lang.String name, java.lang.Class type)java.lang.ClassgetPropertyType(java.lang.Object object, java.lang.String name)protected java.beans.PropertyDescriptor[]getSerializableProperties(java.lang.Object object)java.lang.ObjectnewInstance(java.lang.Class type)booleanpropertyDefinedInClass(java.lang.String name, java.lang.Class type)booleanpropertyWriteable(java.lang.String name, java.lang.Class type)voidvisitSerializableProperties(java.lang.Object object, JavaBeanProvider.Visitor visitor)voidwriteProperty(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:
newInstancein interfaceJavaBeanProvider
-
visitSerializableProperties
public void visitSerializableProperties(java.lang.Object object, JavaBeanProvider.Visitor visitor)- Specified by:
visitSerializablePropertiesin interfaceJavaBeanProvider
-
writeProperty
public void writeProperty(java.lang.Object object, java.lang.String propertyName, java.lang.Object value)- Specified by:
writePropertyin interfaceJavaBeanProvider
-
getPropertyType
public java.lang.Class getPropertyType(java.lang.Object object, java.lang.String name)- Specified by:
getPropertyTypein interfaceJavaBeanProvider
-
propertyDefinedInClass
public boolean propertyDefinedInClass(java.lang.String name, java.lang.Class type)- Specified by:
propertyDefinedInClassin interfaceJavaBeanProvider
-
canInstantiate
public boolean canInstantiate(java.lang.Class type)
Returns true if the Bean provider can instantiate the specified class- Specified by:
canInstantiatein 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)
-
-