Class AdviceConverter
- java.lang.Object
-
- net.ssehub.easy.instantiation.serializer.xml.converter.AdviceConverter
-
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public class AdviceConverter extends java.lang.Object implements com.thoughtworks.xstream.converters.ConverterA converter for theAdvice. While marshaling the project name will be written. In the process of unmarshaling the actual project from the available models is searched.- Author:
- Sass
-
-
Constructor Summary
Constructors Constructor Description AdviceConverter()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 Advice 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 advice 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
-
-