com.marsching.flexiparse.xml2object.parser
Class XML2ObjectNodeHandler

java.lang.Object
  extended by com.marsching.flexiparse.xml2object.parser.XML2ObjectNodeHandler
All Implemented Interfaces:
HandlerConfigurationProvider, NodeHandler, ParsingHandler

public class XML2ObjectNodeHandler
extends Object
implements NodeHandler

Generic node handler using mapping configurations to create objects in the object tree from XML data.

Author:
Sebastian Marsching

Constructor Summary
XML2ObjectNodeHandler(Collection<? extends ElementMappingConfiguration> mappingConfigurations)
          Create a new instance using the supplied mapping configurations.
 
Method Summary
 HandlerConfiguration getConfiguration()
          Returns the configuration for this object.
 void handleNode(HandlerContext context)
          Called for every matching node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XML2ObjectNodeHandler

public XML2ObjectNodeHandler(Collection<? extends ElementMappingConfiguration> mappingConfigurations)
Create a new instance using the supplied mapping configurations. These configurations may themselves contain other (non-global) configurations.

Parameters:
mappingConfigurations - global mapping configuration
Method Detail

getConfiguration

public HandlerConfiguration getConfiguration()
Description copied from interface: HandlerConfigurationProvider
Returns the configuration for this object.

Specified by:
getConfiguration in interface HandlerConfigurationProvider
Returns:
configuration information for this object

handleNode

public void handleNode(HandlerContext context)
                throws ParserException
Description copied from interface: ParsingHandler
Called for every matching node. Used to do parsing and attach objects to the result object tree.

Specified by:
handleNode in interface ParsingHandler
Parameters:
context - provides context information for the current node
Throws:
ParserException - if any error occurs during the parsing


Copyright © 2008-2009. All Rights Reserved.