QJCC homepage

biz.chitec.quarterback.gjsa
Class ClassParsers.GenericMapCP

java.lang.Object
  extended bybiz.chitec.quarterback.gjsa.ClassParsers.GenericMapCP
All Implemented Interfaces:
ClassParser
Direct Known Subclasses:
ClassParsers.HashMapCP, ClassParsers.TreeMapCP
Enclosing class:
ClassParsers

public abstract static class ClassParsers.GenericMapCP
extends java.lang.Object
implements ClassParser

Generic abstract parser for maps. Defines two helper methods which are accessed by the normal parsing methods. Those two must be overridden to implement parsers for different ancestors of "Map".


Constructor Summary
ClassParsers.GenericMapCP()
           
 
Method Summary
protected abstract  java.util.Map createEmptyMap()
          Create an empty map of appropriate type
protected abstract  java.util.Map obj2Map(java.lang.Object o)
          Convert a given object into the Map of the appropriate type.
 java.lang.String obj2Str(java.lang.Object obj)
          This method should convert a given object into a string representation.
 java.lang.Object str2Obj(Str2ObjParamParser sopp)
          Converts a string representation into a Java object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface biz.chitec.quarterback.gjsa.ClassParser
getID
 

Constructor Detail

ClassParsers.GenericMapCP

public ClassParsers.GenericMapCP()
Method Detail

obj2Map

protected abstract java.util.Map obj2Map(java.lang.Object o)
Convert a given object into the Map of the appropriate type.

Parameters:
o - Object given to Obj2StrParser
Returns:
Subtype of Map. Null, if given object is no Map

createEmptyMap

protected abstract java.util.Map createEmptyMap()
Create an empty map of appropriate type

Returns:
Map of appropriate type for the actual parser

obj2Str

public java.lang.String obj2Str(java.lang.Object obj)
Description copied from interface: ClassParser
This method should convert a given object into a string representation. It must retrun null if the object cannot be handled by this parser. Otherwise, it must return only the internal values of the object.

Specified by:
obj2Str in interface ClassParser
Parameters:
obj - Description of the Parameter
Returns:
Description of the Return Value

str2Obj

public java.lang.Object str2Obj(Str2ObjParamParser sopp)
Description copied from interface: ClassParser
Converts a string representation into a Java object. This method needs to create an object of its class and fill it with the values that are given through the Str2ObjParamParser. The ClassParser may use all of Str2ObjParamParser's internal methods, esp. parseObject() which may enter a recursive step.

Specified by:
str2Obj in interface ClassParser
Parameters:
sopp - Description of the Parameter
Returns:
Description of the Return Value

QJCC homepage