net.sf.colle.xml
Class Mapper

java.lang.Object
  extended bynet.sf.colle.xml.Mapper
Direct Known Subclasses:
DateMapper, MapperCollection

public abstract class Mapper
extends Object

Mapper interface that has to be implemented by mapper class. Created: 26 Sep 2001

Version:
$Revision: 1.6 $, $Date: 2004/09/13 05:16:33 $
Author:
Jeremy Miller

Field Summary
protected  Mapper mxParentMapper
           
 
Constructor Summary
protected Mapper(Mapper pxParentMapper)
          Constructs a mapper with the parent mapper.
 
Method Summary
protected abstract  void map(org.jdom.Element pxParent, Object pxObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, boolean pbObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, char[] pxObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, char pxObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, double pnObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, float pnObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, int pnObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, long pnObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
 void map(org.jdom.Element pxParent, String psName, Object pxObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
static void map(org.jdom.Element pxParent, String psName, String psObject, Set pxPaths, String psPath)
          Maps the object into a DOM document.
 void mapCollection(org.jdom.Element pxParent, String psName, Collection pxCollection, Set pxPaths, String psPath)
          Maps the collection into a DOM document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mxParentMapper

protected Mapper mxParentMapper
Constructor Detail

Mapper

protected Mapper(Mapper pxParentMapper)
Constructs a mapper with the parent mapper. Sub-class mappers should defer mapping of child objects to the parent mapper.

Method Detail

map

public void map(org.jdom.Element pxParent,
                String psName,
                Object pxObject,
                Set pxPaths,
                String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pxObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       String psObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document. Having this specific mapper method for Strings causes most Strings to be mapped as an attribute.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
psObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       boolean pbObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pbObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       char pxObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pxObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       char[] pxObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pxObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       double pnObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pnObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       float pnObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pnObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       int pnObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pnObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

map

public static void map(org.jdom.Element pxParent,
                       String psName,
                       long pnObject,
                       Set pxPaths,
                       String psPath)
Maps the object into a DOM document.

Parameters:
pxParent - parent element to add new elements onto
psName - name the top element tag should be called
pnObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - ignored, included to simplify generated code

mapCollection

public void mapCollection(org.jdom.Element pxParent,
                          String psName,
                          Collection pxCollection,
                          Set pxPaths,
                          String psPath)
Maps the collection into a DOM document. This special method exists so a collection of objects can be mapped directly as children of the parent. If mapObject was called with a Collection, the collection object itself would be mapped as a seperate element.

Parameters:
pxParent - parent element to add new elements onto
psName - name the first element tag should be called
pxCollection - collection being mapped
pxPaths - paths to each explicitly requested object

map

protected abstract void map(org.jdom.Element pxParent,
                            Object pxObject,
                            Set pxPaths,
                            String psPath)
Maps the object into a DOM document. This version is usually used by generated mappers because it allows the caller to specify the path to the object being mapped. This is important to determine if children objects and expensive attributes should be mapped.

Parameters:
pxParent - parent element to add new elements onto
pxObject - object being mapped
pxPaths - paths to each explicitly requested object
psPath - xpath to the current object