public class BeanProvider extends Object implements JavaBeanProvider
Modifier and Type | Class and Description |
---|---|
static interface |
BeanProvider.Visitor
Deprecated.
As of 1.4 use
JavaBeanProvider.Visitor |
Modifier and Type | Field and Description |
---|---|
protected static Object[] |
NO_PARAMS
Deprecated.
As of 1.4.6
|
protected PropertyDictionary |
propertyDictionary |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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)
Deprecated.
As of 1.4.6 use
newInstance(Class) or canInstantiate(Class) directly. |
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) |
protected static final Object[] NO_PARAMS
protected PropertyDictionary propertyDictionary
public BeanProvider()
public BeanProvider(Comparator propertyNameComparator)
propertyNameComparator
- the comparatorpublic BeanProvider(PropertyDictionary propertyDictionary)
propertyDictionary
- the property dictionary to usepublic Object newInstance(Class type)
newInstance
in interface JavaBeanProvider
public void visitSerializableProperties(Object object, JavaBeanProvider.Visitor visitor)
visitSerializableProperties
in interface JavaBeanProvider
public void writeProperty(Object object, String propertyName, Object value)
writeProperty
in interface JavaBeanProvider
public Class getPropertyType(Object object, String name)
getPropertyType
in interface JavaBeanProvider
public boolean propertyDefinedInClass(String name, Class type)
propertyDefinedInClass
in interface JavaBeanProvider
public boolean canInstantiate(Class type)
canInstantiate
in interface JavaBeanProvider
protected Constructor getDefaultConstrutor(Class type)
newInstance(Class)
or canInstantiate(Class)
directly.type
- protected PropertyDescriptor[] getSerializableProperties(Object object)
protected boolean canStreamProperty(PropertyDescriptor descriptor)
protected PropertyDescriptor getProperty(String name, Class type)
Copyright © 2004–2016 XStream. All rights reserved.