Class GenericFieldAttributeConverter<T>
- java.lang.Object
-
- cern.accsoft.steering.jmad.util.xml.converters.GenericFieldAttributeConverter<T>
-
- Type Parameters:
T- the type of object to convert
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public class GenericFieldAttributeConverter<T> extends java.lang.Object implements com.thoughtworks.xstream.converters.ConverterThis is a generic converter that can be used by xstream to convert each field of a class into a <arrbname value="..." /> node.
-
-
Constructor Summary
Constructors Constructor Description GenericFieldAttributeConverter(com.thoughtworks.xstream.XStream xStream, java.lang.Class<T> clazz)The constructor needs the xstream-object to get the mapper and the converter-lookup and a class which can then be converted by this mapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvert(java.lang.Class otherClazz)voidmarshal(java.lang.Object object, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext ctx)java.lang.Objectunmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext ctx)
-
-
-
Constructor Detail
-
GenericFieldAttributeConverter
public GenericFieldAttributeConverter(com.thoughtworks.xstream.XStream xStream, java.lang.Class<T> clazz)The constructor needs the xstream-object to get the mapper and the converter-lookup and a class which can then be converted by this mapper.- Parameters:
xStream- the xstream objectclazz- the class to be treated by this converter
-
-
Method Detail
-
marshal
public void marshal(java.lang.Object object, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext ctx)- Specified by:
marshalin interfacecom.thoughtworks.xstream.converters.Converter
-
unmarshal
public java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext ctx)- Specified by:
unmarshalin interfacecom.thoughtworks.xstream.converters.Converter
-
canConvert
public boolean canConvert(java.lang.Class otherClazz)
- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher
-
-