uk.apl.jxc.mapper
Class XMLMapper

java.lang.Object
  extended by uk.apl.jxc.mapper.XMLMapper

public class XMLMapper
extends java.lang.Object

Performs a mapping (transformation) of some XML from one schema to another.

Author:
Andrew Leigh

Constructor Summary
XMLMapper()
          Constructs a new XMLMapper.
 
Method Summary
 void addMapping(AbstractXMLMapping mapping)
          Adds a mapping to the mapper.
 void addMappings(java.util.Iterator<AbstractXMLMapping> iterator)
          Clears any previously added mappings and adds any mappings found in the iterator.
 void addMappingsFromSavedMapping(java.io.File savedMapping)
          Clears any previously added mappings and adds any mappings found in the saved XML mapping file.
 org.w3c.dom.Document apply(org.w3c.dom.Document xml)
          Applies the mapping to an XML Document
 org.w3c.dom.Document apply(java.io.File xmlFile)
          Applies the mapping to an XML File.
 org.w3c.dom.Document apply(java.lang.String xml)
          Applies the mapping to an XML String
 void clearMappings()
          Clears any previously added mappings.
 java.lang.String getGeneratedXSL()
          Returns the XSL source code generated for this mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMapper

public XMLMapper()
Constructs a new XMLMapper.

Method Detail

clearMappings

public void clearMappings()
Clears any previously added mappings.


addMapping

public void addMapping(AbstractXMLMapping mapping)
Adds a mapping to the mapper.

Parameters:
mapping - the mapper to be added

addMappingsFromSavedMapping

public void addMappingsFromSavedMapping(java.io.File savedMapping)
                                 throws XMLMapperException
Clears any previously added mappings and adds any mappings found in the saved XML mapping file.

Parameters:
savedMapping - File containing a saved XML mapping definition
Throws:
XMLMapperException - when an exception occurs applying the saved mapping

addMappings

public void addMappings(java.util.Iterator<AbstractXMLMapping> iterator)
Clears any previously added mappings and adds any mappings found in the iterator.

Parameters:
iterator - the mapping iterator
Throws:
XMLMapperException - when an exception occurs applying the mappings

apply

public org.w3c.dom.Document apply(java.lang.String xml)
                           throws XMLMapperException
Applies the mapping to an XML String

Parameters:
xml - XML String to be mapped
Returns:
XML Document of the mapped XML
Throws:
XMLMapperException - when an exception occurs mapping the XML

apply

public org.w3c.dom.Document apply(java.io.File xmlFile)
                           throws XMLMapperException
Applies the mapping to an XML File.

Parameters:
xmlFile - XML File to be mapped
Returns:
XML Document of the mapped XML
Throws:
XMLMapperException - when an exception occurs mapping the XML

apply

public org.w3c.dom.Document apply(org.w3c.dom.Document xml)
                           throws XMLMapperException
Applies the mapping to an XML Document

Parameters:
xml - XML Document to be mapped
Returns:
XML Document of the mapped XML
Throws:
XMLMapperException - when an exception occurs mapping the XML

getGeneratedXSL

public java.lang.String getGeneratedXSL()
Returns the XSL source code generated for this mapping.

Returns:
XSL source code generated for this mapping


Copyright 2010 Andrew Leigh. All Rights Reserved.