public class JavaBeanConverter extends Object implements Converter
BeanProvider
used as default is based on
BeanInfo
. Indexed properties are currently not supported.Modifier and Type | Class and Description |
---|---|
static class |
JavaBeanConverter.DuplicateFieldException
Deprecated.
As of 1.3
|
static class |
JavaBeanConverter.DuplicatePropertyException
Exception to indicate double processing of a property to avoid silent clobbering.
|
Modifier and Type | Field and Description |
---|---|
protected JavaBeanProvider |
beanProvider |
protected Mapper |
mapper |
Constructor and Description |
---|
JavaBeanConverter(Mapper mapper) |
JavaBeanConverter(Mapper mapper,
Class type) |
JavaBeanConverter(Mapper mapper,
JavaBeanProvider beanProvider) |
JavaBeanConverter(Mapper mapper,
JavaBeanProvider beanProvider,
Class type) |
JavaBeanConverter(Mapper mapper,
String classAttributeIdentifier)
Deprecated.
As of 1.3, use
JavaBeanConverter(Mapper) and XStream.aliasAttribute(String, String) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Class type)
Checks if the bean provider can instantiate this type.
|
void |
marshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
Convert an object to textual data.
|
Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object.
|
protected final Mapper mapper
protected final JavaBeanProvider beanProvider
public JavaBeanConverter(Mapper mapper)
public JavaBeanConverter(Mapper mapper, JavaBeanProvider beanProvider)
public JavaBeanConverter(Mapper mapper, JavaBeanProvider beanProvider, Class type)
public JavaBeanConverter(Mapper mapper, String classAttributeIdentifier)
JavaBeanConverter(Mapper)
and XStream.aliasAttribute(String, String)
public boolean canConvert(Class type)
canConvert
in interface ConverterMatcher
type
- the Class representing the object type to be convertedpublic void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
Converter
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
Copyright © 2004–2017 XStream. All rights reserved.