Class NullValueTypeConverter
- java.lang.Object
-
- net.ssehub.easy.instantiation.serializer.xml.converter.NullValueTypeConverter
-
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public class NullValueTypeConverter extends java.lang.Object implements com.thoughtworks.xstream.converters.ConverterA type converter for null value types.- Author:
- Aike Sass
-
-
Constructor Summary
Constructors Constructor Description NullValueTypeConverter()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.
-
-
-
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 NullValueType 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 NullValueType 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
-
-