fr.cnes.sitools.dataset.database.mongodb
Class SitoolsAttributeValueConverter

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.mongodb.SitoolsAttributeValueConverter
All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher

public final class SitoolsAttributeValueConverter
extends java.lang.Object
implements com.thoughtworks.xstream.converters.Converter

AttributeValue Converter to get a String of the value of an AttributeValue and not the object itself especially used for MongoDB datasets

Author:
m.gond

Constructor Summary
SitoolsAttributeValueConverter()
           
 
Method Summary
 boolean canConvert(java.lang.Class arg0)
          Can only convert AttributeValues
 void marshal(java.lang.Object arg0, com.thoughtworks.xstream.io.HierarchicalStreamWriter arg1, com.thoughtworks.xstream.converters.MarshallingContext arg2)
          Create 2 nodes with name and value of the AttributeValue
 java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader arg0, com.thoughtworks.xstream.converters.UnmarshallingContext arg1)
          No unmarshaling
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitoolsAttributeValueConverter

public SitoolsAttributeValueConverter()
Method Detail

canConvert

public boolean canConvert(java.lang.Class arg0)
Can only convert AttributeValues

Specified by:
canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
Parameters:
arg0 - The Class to check if it possible to convert
Returns:
true if arg0 is an AttributeValue, false otherwise

unmarshal

public java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader arg0,
                                  com.thoughtworks.xstream.converters.UnmarshallingContext arg1)
No unmarshaling

Specified by:
unmarshal in interface com.thoughtworks.xstream.converters.Converter
Parameters:
arg0 - HierarchicalStreamReader
arg1 - UnmarshallingContext
Returns:
Object

marshal

public void marshal(java.lang.Object arg0,
                    com.thoughtworks.xstream.io.HierarchicalStreamWriter arg1,
                    com.thoughtworks.xstream.converters.MarshallingContext arg2)
Create 2 nodes with name and value of the AttributeValue

Specified by:
marshal in interface com.thoughtworks.xstream.converters.Converter
Parameters:
arg0 - The Object to marshal
arg1 - HierarchicalStreamWriter the writer
arg2 - MarshallingContext the context


Copyright © 2010-2013 CNES. All Rights Reserved.