com.bankframe.ei.xml
Class EDocumentTransformer

java.lang.Object
  extended bycom.bankframe.ei.xml.EDocumentTransformer

public class EDocumentTransformer
extends java.lang.Object

This class is used to transform an XML Document object from one XML format to another. The default implementation uses XSL StyleSheets to perform this transformation.


Method Summary
 void configure(org.w3c.dom.Document source)
          This method handles any custom configurations necessary for use with an EDocumentTransformer implementation.
For the default transformer, this method initialises the name and location of the XSL style sheets to be used for incoming and outgoing transformations.
 void configure(java.lang.String contentType)
          This method configures the style sheets to use for transforming the XML
 void setStyleSheetLocation(java.lang.String path)
          This method sets the location of the style sheet that will be used for transformations.
 void setStyleSheetName(java.lang.String name)
          This method sets the name of the stylesheet that will be used in the transformation.
 void transform(org.w3c.dom.Document source, org.w3c.dom.Document result)
          This method transforms an XML Document from one XML format to another XML format.
 void transform(org.w3c.dom.Document source, org.w3c.dom.Document result, java.lang.String direction)
          This method transforms an XML Document from one XML format to another XML format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

configure

public void configure(java.lang.String contentType)
This method configures the style sheets to use for transforming the XML

Parameters:
contentType - The content-type of the XML document

configure

public void configure(org.w3c.dom.Document source)
This method handles any custom configurations necessary for use with an EDocumentTransformer implementation.
For the default transformer, this method initialises the name and location of the XSL style sheets to be used for incoming and outgoing transformations. These values are determined based on the XML source document and mappings specified in the BankframeResource.properties file. It is an alternative to using the setStyleSheetName and setStyleSheetLocation methods.

Parameters:
source - The source document that will be used in a transformation.

setStyleSheetLocation

public void setStyleSheetLocation(java.lang.String path)
This method sets the location of the style sheet that will be used for transformations.

Parameters:
path - URL or directory path where the style sheet is found.

setStyleSheetName

public void setStyleSheetName(java.lang.String name)
This method sets the name of the stylesheet that will be used in the transformation. This variable is only used for a one-way transformation. If the transformation is used twice (for request and response transactions), then the styleSheetNameIN and styleSheetNameOUT values are used instead.

Parameters:
name - The file name of the XSL stylesheet

transform

public void transform(org.w3c.dom.Document source,
                      org.w3c.dom.Document result)
               throws org.xml.sax.SAXNotSupportedException,
                      javax.xml.transform.TransformerException,
                      javax.xml.transform.TransformerConfigurationException
This method transforms an XML Document from one XML format to another XML format. The default implementation uses XSL stylesheets to perform this transformation. You must ensure that the configure(Document) method or the setStyleSheetName and setStyleSheetLocation methods are first called to set the necessary parameters for this transformation.

For two way transformations, the transform(Document, Document, String) method may be used to specify which direction the transformation is going in.

Parameters:
source - The original source XML Document that will be transformed.
result - The XML Document as a result of the transformation.
Throws:
org.xml.sax.SAXNotSupportedException
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException

transform

public void transform(org.w3c.dom.Document source,
                      org.w3c.dom.Document result,
                      java.lang.String direction)
               throws org.xml.sax.SAXNotSupportedException,
                      javax.xml.transform.TransformerException,
                      javax.xml.transform.TransformerConfigurationException
This method transforms an XML Document from one XML format to another XML format. The default implementation uses XSL stylesheets to perform this transformation. For two-way transformations, the direction (in or out) will determine how to transform the document. For instance, in BankFrame MCA, an incoming request will transform the client XML format into BankFrame XML format. After completion of the transaction, the outgoing transformation will change the BankFrame XML document back into the client XML format.

You must ensure that the configure(Document) method is first called to set any necessary parameters, such as style sheet names etc. For one way transformations, the transform(Document, Document) method may be used.

Parameters:
source - The original source XML Document that will be transformed.
result - The XML Document as a result of the transformation.
direction - The direction this transaction is going (in or out)
Throws:
org.xml.sax.SAXNotSupportedException
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException


Copyright © 2005, 2007, Oracle. All rights reserved.