Oracle Application Development Framework Model and Business Components Java API Reference
VERSION

B16005-01


oracle.adf.model.adapter.dataformat
Class XMLHandler

java.lang.Object
  extended byoracle.adf.model.adapter.dataformat.XMLHandler

All Implemented Interfaces:
FormatDataHandler

public class XMLHandler
extends java.lang.Object
implements FormatDataHandler

The XMLHandler class XML data formats. XML handler can extract data from an XML data stream.

Since the way XSDHandler class handles the leaf element, we handle it in the corresponding way: Example 1: <company> <dept>Sales Departments </dept> </company> The text node: Sales Departments is added to parent map(Key: dept, value: Sales Deparements) Example 2: <company> <dept no="10">Sales Departments</dept> </company> The text node: Sales Departments are mapped to _text attribute for dept element.


Field Summary
static java.lang.String REFERENCE_ROOT
           

 

Constructor Summary
XMLHandler(java.io.InputStream is, boolean supportStreaming)
          Creates a data handler for XML data type.
XMLHandler(java.io.InputStream is, java.io.InputStream xsdStream, boolean supportStreaming)
          Creates a data handler for XML data type.
XMLHandler(java.io.InputStream is, java.io.InputStream xsdStream, java.io.InputStream xsltStream, boolean supportStreaming)
          Creates a data handler for XML data type.
XMLHandler(org.w3c.dom.Node root)
          Creates an XML data handler for a DOM node.
XMLHandler(org.w3c.dom.Node root, java.io.Reader xslTransform)
          Instantiate this XMLHandler for the root node and an optional transformation to be applied on the root node.

 

Method Summary
 java.util.List getResult(java.util.Map params)
          Returns the resulting data extracted from the input.
 java.lang.Object getResult(java.util.Map params, java.lang.String returnType)
          Returns the resulting data extracted from the input.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

REFERENCE_ROOT

public static final java.lang.String REFERENCE_ROOT

Constructor Detail

XMLHandler

public XMLHandler(java.io.InputStream is,
                  boolean supportStreaming)
Creates a data handler for XML data type.
Parameters:
is - input stream of the data.
supportStreaming - if to support the streaming fetch of the data. If this value is false, the XML data is loaded as a DOM tree.
Throws:
AdapterException - if falis to load the DOM tree from the input stream.

XMLHandler

public XMLHandler(java.io.InputStream is,
                  java.io.InputStream xsdStream,
                  boolean supportStreaming)
Creates a data handler for XML data type.
Parameters:
is - input stream of the data.
xsdStream - stream of the schema definition
supportStreaming - if to support the streaming fetch of the data. If this value is false, the XML data is loaded as a DOM tree.
Throws:
AdapterException - if falis to load the DOM tree from the input stream.

XMLHandler

public XMLHandler(java.io.InputStream is,
                  java.io.InputStream xsdStream,
                  java.io.InputStream xsltStream,
                  boolean supportStreaming)
Creates a data handler for XML data type.
Parameters:
is - input stream of the data.
xsdStream - stream of the schema definition
xsltStream - stream of the xslt definition
supportStreaming - if to support the streaming fetch of the data. If this value is false, the XML data is loaded as a DOM tree.
Throws:
AdapterException - if falis to load the DOM tree from the input stream.

XMLHandler

public XMLHandler(org.w3c.dom.Node root)
Creates an XML data handler for a DOM node.
Parameters:
root - the root node of the data.

XMLHandler

public XMLHandler(org.w3c.dom.Node root,
                  java.io.Reader xslTransform)
           throws AdapterException
Instantiate this XMLHandler for the root node and an optional transformation to be applied on the root node.
Parameters:
root - The root data node for this format handler instance
xslTransform - The Transformation Reader that references the XSL transformation to be applied on this root node.
Throws:
{@link - AdapterException} if the transformation cannot be applied on the root node.
AdapterException

Method Detail

getResult

public java.lang.Object getResult(java.util.Map params,
                                  java.lang.String returnType)
Returns the resulting data extracted from the input.
Specified by:
getResult in interface FormatDataHandler
Parameters:
params - parameters passed containig the context information.
returnType - data type of the returned value. This can be passed as null. If no return type is specified, an Iterator of Map will be returned.
Returns:
Object of the type defined by the returnType parameter. If the type is available, an instance of that object is created. If no type is specified an Iterator of Map objects for the result will be created. If no data found it can return null. The Map contains the value of attributes as defined in the data structure. For complex data, Maps can contain other Maps as well.

getResult

public java.util.List getResult(java.util.Map params)
Returns the resulting data extracted from the input.
Parameters:
params - parameters passed containig the context information.
Returns:
Map objects for the result. If no data found it can return null. The Map contains the value of attributes as defined in the data structure. For complex data, Maps can contain other iterator of Maps as well.

Oracle Application Development Framework Model and Business Components Java API Reference
VERSION

B16005-01


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