Top Description Inners Constructors Methods
com.thoughtworks.xstream.converters.enums

public Class EnumMapConverter

extends MapConverter
Class Inheritance
Imports
com.thoughtworks.xstream.converters.collections.MapConverter, com.thoughtworks.xstream.converters.ConversionException, .MarshallingContext, .UnmarshallingContext, com.thoughtworks.xstream.mapper.Mapper, com.thoughtworks.xstream.io.HierarchicalStreamWriter, .HierarchicalStreamReader, com.thoughtworks.xstream.core.util.Fields, java.util.EnumMap, java.lang.reflect.Field

Serializes an Java 5 EnumMap, including the type of Enum it's for. If a SecurityManager is set, the converter will only work with permissions for SecurityManager.checkPackageAccess, SecurityManager.checkMemberAccess(this, EnumSet.MEMBER) and ReflectPermission("suppressAccessChecks").
Author
Joe Walnes

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canConvert(Class<T>
the Class representing the object type to be converted
type
)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.canConvert.

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.
public void
marshal(Object
The object to be marshalled.
source
,
HierarchicalStreamWriter
A stream to write to.
writer
,
MarshallingContext
A context that allows nested objects to be processed by XStream.
context
)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.marshal.

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.
public Object
unmarshal(HierarchicalStreamReader
The stream to read the text from.
reader
,
UnmarshallingContext context)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal.

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.
Inherited from com.thoughtworks.xstream.converters.collections.MapConverter:
createCollectionpopulateMappopulateMapputCurrentEntryIntoMap

Constructor Detail

EnumMapConverterback to summary
public EnumMapConverter(Mapper mapper)

Method Detail

canConvertback to summary
public boolean canConvert(Class<T> type)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.canConvert.

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Doc from com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.

Parameters
type:Class<T>

the Class representing the object type to be converted

marshalback to summary
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.marshal.

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Doc from com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.

Parameters
source:Object

The object to be marshalled.

writer:HierarchicalStreamWriter

A stream to write to.

context:MarshallingContext

A context that allows nested objects to be processed by XStream.

unmarshalback to summary
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)

Overrides com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal.

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Doc from com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.

Parameters
reader:HierarchicalStreamReader

The stream to read the text from.

Returns:Object

The resulting object.

Annotations
@SuppressWarnings:unchecked
com.thoughtworks.xstream.converters.enums back to summary

private Class EnumMapConverter.Reflections

extends Object
Class Inheritance
  • java.lang.Object
  • com.thoughtworks.xstream.converters.enums.EnumMapConverter.Reflections

Field Summary

Modifier and TypeField and Description
private static final Field

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

typeFieldback to summary
private static final Field typeField

Constructor Detail

Reflectionsback to summary
private Reflections()