SingleValueConverter. The
value field is defined using the name of the type that declares the field and the field name
itself. Therefore it is possible to define an inherited field as value. It is also possible
to provide no value field at all, so that all fields are written as attributes.
| Modifier and Type | Field and Description |
|---|---|
| private final Mapper | |
| private final ConverterLookup | |
| private final Mapper | |
| private final ReflectionProvider | |
| private static final String | |
| private final Class | |
| private final Field |
| Access | Constructor and Description |
|---|---|
| public | ToAttributedValueConverter(final Class<T>
the type that is handled by this converter instance type, final Mapper the mapper in use mapper, final ReflectionProvider the reflection provider in use reflectionProvider, final ConverterLookup the converter lookup in use lookup)Creates a new ToAttributedValueConverter instance. |
| public | ToAttributedValueConverter(final Class<T>
the type that is handled by this converter instance type, final Mapper the mapper in use mapper, final ReflectionProvider the reflection provider in use reflectionProvider, final ConverterLookup the converter lookup in use lookup, final String the field defining the tag's value (may be null) valueFieldName)Creates a new ToAttributedValueConverter instance. |
| public | ToAttributedValueConverter(final Class<T>
the type that is handled by this converter instance type, final Mapper the mapper in use mapper, final ReflectionProvider the reflection provider in use reflectionProvider, final ConverterLookup the converter lookup in use lookup, final String the field defining the tag's value (may be null) valueFieldName, Class<T> the type defining the field valueDefinedIn)Creates a new ToAttributedValueConverter instance. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canConvert(final Class<T>
the Class representing the object type to be converted type)Implements com. |
| private boolean | |
| public void | marshal(final Object
The object to be marshalled. source, final HierarchicalStreamWriter A stream to write to. writer, final MarshallingContext A context that allows nested objects to be processed by XStream. context)Implements com. |
| public Object | unmarshal(final HierarchicalStreamReader
The stream to read the text from. reader, final UnmarshallingContext context)Implements com. |
| enumMapper | back to summary |
|---|---|
| private final Mapper enumMapper | |
| lookup | back to summary |
|---|---|
| private final ConverterLookup lookup | |
| mapper | back to summary |
|---|---|
| private final Mapper mapper | |
| reflectionProvider | back to summary |
|---|---|
| private final ReflectionProvider reflectionProvider | |
| STRUCTURE_MARKER | back to summary |
|---|---|
| private static final String STRUCTURE_MARKER | |
| type | back to summary |
|---|---|
| private final Class<T> type | |
| valueField | back to summary |
|---|---|
| private final Field valueField | |
| ToAttributedValueConverter | back to summary |
|---|---|
| public ToAttributedValueConverter(final Class<T> type, final Mapper mapper, final ReflectionProvider reflectionProvider, final ConverterLookup lookup) Creates a new ToAttributedValueConverter instance. All field elements will be attributes, the element itself will have no value.
| |
| ToAttributedValueConverter | back to summary |
|---|---|
| public ToAttributedValueConverter(final Class<T> type, final Mapper mapper, final ReflectionProvider reflectionProvider, final ConverterLookup lookup, final String valueFieldName) Creates a new ToAttributedValueConverter instance.
| |
| ToAttributedValueConverter | back to summary |
|---|---|
| public ToAttributedValueConverter(final Class<T> type, final Mapper mapper, final ReflectionProvider reflectionProvider, final ConverterLookup lookup, final String valueFieldName, Class<T> valueDefinedIn) Creates a new ToAttributedValueConverter instance.
| |
| canConvert | back to summary |
|---|---|
| public boolean canConvert(final Class<T> type) Implements com. Doc from com. Determines whether the converter can marshall a particular type.
| |
| fieldIsEqual | back to summary |
|---|---|
| private boolean fieldIsEqual(FastField field) | |
| marshal | back to summary |
|---|---|
| public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) Implements com. Doc from com. Convert an object to textual data.
| |
| unmarshal | back to summary |
|---|---|
| public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) Implements com. Doc from com. Convert textual data back into an object.
| |