public class JavaBeanConverter extends java.lang.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,
java.lang.Class type) |
JavaBeanConverter(Mapper mapper,
JavaBeanProvider beanProvider) |
JavaBeanConverter(Mapper mapper,
JavaBeanProvider beanProvider,
java.lang.Class type) |
JavaBeanConverter(Mapper mapper,
java.lang.String classAttributeIdentifier)
Deprecated.
As of 1.3, use
JavaBeanConverter(Mapper) and XStream.aliasAttribute(String, String) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(java.lang.Class type)
Checks if the bean provider can instantiate this type.
|
void |
marshal(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
Convert an object to textual data.
|
java.lang.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, java.lang.Class type)
public JavaBeanConverter(Mapper mapper, JavaBeanProvider beanProvider)
public JavaBeanConverter(Mapper mapper, JavaBeanProvider beanProvider, java.lang.Class type)
public JavaBeanConverter(Mapper mapper, java.lang.String classAttributeIdentifier)
JavaBeanConverter(Mapper)
and XStream.aliasAttribute(String, String)
public boolean canConvert(java.lang.Class type)
canConvert
in interface ConverterMatcher
type
- the Class representing the object type to be convertedpublic void marshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
Converter
public java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
Copyright © 2004–2022 XStream. All rights reserved.