org.cubeengine.converter.converter.generic
Class MapConverter

java.lang.Object
  extended by org.cubeengine.converter.converter.generic.MapConverter
All Implemented Interfaces:
Converter<Map,ParameterizedType>, GenericConverter<Map>

public class MapConverter
extends Object
implements GenericConverter<Map>

Converts MapNode to Map and vice versa


Constructor Summary
MapConverter()
           
 
Method Summary
 Map fromNode(Node node, ParameterizedType ptype, ConverterManager manager)
          Converts the node back into the original object
static Map getMapFor(ParameterizedType pType)
          Returns a new map of given ParameterizedType
 Node toNode(Map map, ConverterManager manager)
          Converts the object into a serializable Node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapConverter

public MapConverter()
Method Detail

getMapFor

public static Map getMapFor(ParameterizedType pType)
                     throws IllegalAccessException,
                            InstantiationException
Returns a new map of given ParameterizedType

Parameters:
pType - the type
Returns:
the map of given type
Throws:
IllegalAccessException
InstantiationException

toNode

public Node toNode(Map map,
                   ConverterManager manager)
            throws ConversionException
Description copied from interface: Converter
Converts the object into a serializable Node

Specified by:
toNode in interface Converter<Map,ParameterizedType>
Parameters:
map - the object to convert
manager - the ConverterManager
Returns:
the converted object
Throws:
ConversionException

fromNode

public Map fromNode(Node node,
                    ParameterizedType ptype,
                    ConverterManager manager)
             throws ConversionException
Description copied from interface: Converter
Converts the node back into the original object

Specified by:
fromNode in interface Converter<Map,ParameterizedType>
Parameters:
node - the node to convert
ptype - the type to convert to
manager - the manager
Returns:
the converted node
Throws:
ConversionException


Copyright © 2013–2017. All rights reserved.