Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.5.0)

E10653-06


oracle.adf.model.adapter.dataformat
Class XMLHandler

java.lang.Object
  extended by oracle.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.


Nested Class Summary
 class XMLHandler.XMLDataEvent
          Event that the CSV handler sends during processing csv data.

 

Field Summary
static java.lang.String EV_EOD
          End of data event.
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 xsltStream, boolean supportStreaming)
          Creates a data handler for XML data type.
XMLHandler(Node root)
          Creates an XML data handler for a DOM node.
XMLHandler(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.
 void setDataEventListener(FormatDataEventListener listener)
          Sets the data event listener.

 

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

 

Field Detail

EV_EOD

public static final java.lang.String EV_EOD
End of data event.
See Also:
Constant Field Values

REFERENCE_ROOT

public static final java.lang.String REFERENCE_ROOT
See Also:
Constant Field Values

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 xsltStream,
                  boolean supportStreaming)
Creates a data handler for XML data type.
Parameters:
is - input stream of the data.
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(Node root)
Creates an XML data handler for a DOM node.
Parameters:
root - the root node of the data.

XMLHandler

public XMLHandler(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

setDataEventListener

public void setDataEventListener(FormatDataEventListener listener)
Sets the data event listener.

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.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.5.0)

E10653-06


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