org.apache.tuscany.sca.cpp.tools.services
Class DomHandler

java.lang.Object
  extended byorg.apache.tuscany.sca.cpp.tools.services.GenericDomNodeHandler
      extended byorg.apache.tuscany.sca.cpp.tools.services.DomHandler
All Implemented Interfaces:
DomNodeHandler

public class DomHandler
extends GenericDomNodeHandler

The purpose of this class it to provide a generic class that can handle both a DOM and a DOM node.


Field Summary
 
Fields inherited from interface org.apache.tuscany.sca.cpp.tools.services.DomNodeHandler
ELEMENT
 
Constructor Summary
DomHandler()
           
 
Method Summary
static void handleDom(org.w3c.dom.Document dom, java.util.Map handlers, java.util.Map parameters)
          This method will run through the initial level of the DOM using the handlers map
 void handleNode(org.w3c.dom.Node node, java.lang.String contextXPath, java.util.Map handlers, java.util.Map parameters)
          This method will place the attributes in this node into the parameter map keyed by the XPath and recursively continue processing for any sub-elements of the node.
 
Methods inherited from class org.apache.tuscany.sca.cpp.tools.services.GenericDomNodeHandler
handleChildElements, mapNodeToHandlerAndHandle, transferAttrsToParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomHandler

public DomHandler()
Method Detail

handleDom

public static void handleDom(org.w3c.dom.Document dom,
                             java.util.Map handlers,
                             java.util.Map parameters)
This method will run through the initial level of the DOM using the handlers map

Parameters:
dom - the document being consumed
handlers - the map from element name to node handler
parameters - a map of parameters - this is often used by a handler to place a name-value pair, the name is often an Xpath representation of the location of the data in the DOM but handlers are free to use whatever they like - the contextXpath is generated as an Xpath prefix for those handlers that wish to use it.

handleNode

public void handleNode(org.w3c.dom.Node node,
                       java.lang.String contextXPath,
                       java.util.Map handlers,
                       java.util.Map parameters)
Description copied from class: GenericDomNodeHandler
This method will place the attributes in this node into the parameter map keyed by the XPath and recursively continue processing for any sub-elements of the node.

Specified by:
handleNode in interface DomNodeHandler
Overrides:
handleNode in class GenericDomNodeHandler
Parameters:
node - The DOM node being consumed
contextXPath - The XPath to this node
handlers - The map from element name to node handler
parameters - A map of parameters - this is often used by a handler to place a name-value pair, the name is often an Xpath representation of the location of the data in the DOM but handlers are free to use whatever they like - the contextXpath is generated as an Xpath prefix for those handlers that wish to use it.


Copyright 2005 The Apache Software Foundation and Copyright IBM Corp. 2005 All Rights Reserved