Class ClassWrapperConverter
- java.lang.Object
-
- net.ssehub.easy.instantiation.serializer.xml.converter.ClassWrapperConverter
-
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public class ClassWrapperConverter extends java.lang.Object implements com.thoughtworks.xstream.converters.ConverterConverter to serialize theClassWrapper.- Author:
- Sass
-
-
Field Summary
Fields Modifier and Type Field Description protected static EASyLoggerFactory.EASyLoggerlogger
-
Constructor Summary
Constructors Constructor Description ClassWrapperConverter()Creates a singleton type converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvert(java.lang.Class cls)Determines whether this converter instance handles the given class.voidmarshal(java.lang.Object object, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)Marshals a givenobjectto the givenwriterin the specified marshalingcontext.java.lang.Objectunmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)Unmarshals the current object to be read from the givenreaderin the specified unmarshalingcontext.
-
-
-
Field Detail
-
logger
protected static EASyLoggerFactory.EASyLogger logger
-
-
Method Detail
-
canConvert
public boolean canConvert(java.lang.Class cls)
Determines whether this converter instance handles the given class.- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher- Parameters:
cls- the class to be tested- Returns:
trueif this instance handlesclass(this is only the case if it is a ClassWrapper class),falseelse
-
marshal
public void marshal(java.lang.Object object, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)Marshals a givenobjectto the givenwriterin the specified marshalingcontext. This method translates a ClassWrapper type singleton to a name.- Specified by:
marshalin interfacecom.thoughtworks.xstream.converters.Converter- Parameters:
object- the object to be marshaledwriter- the output stream writercontext- the marshaling context
-
unmarshal
public java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)Unmarshals the current object to be read from the givenreaderin the specified unmarshalingcontext. This method translates the name back to the singleton instance.- Specified by:
unmarshalin interfacecom.thoughtworks.xstream.converters.Converter- Parameters:
reader- the input stream writercontext- the marshaling context- Returns:
- the unmarshaled object
-
-