Skip Headers

Oracle9i XML API Reference - XDK and Oracle XML DB
Release 2 (9.2)

Part Number A96616-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

10
Oracle XML JavaBeans

Oracle XML JavaBeans are synonymous with the following packages:


oracle.xml.async Package


Description

This is a non-visual bean. It enables asynchronous DOM parsing in separate threads in the background. It utilizes the EventHandler interface to notify the calling class when the job is complete. The classes of the oOracle.xml.async are summarized in Table 10-1.

Table 10-1 Summary of Classes of oracle.xml.async  
Class Description

DOMBuilder Class

This class encapsulates an eXtensible Markup Language (XML) 1.0 parser to parse an XML document and build a DOM tree.

DOMBuilderBeanInfo Class

This class provides information about the DOMBuilder Bean.

DOMBuilderErrorEvent Class

This class defines the error event which is sent when parse exception occurs.

DOMBuilderErrorListener Interface

This interface must be implemented in order to receive notifications when error is found during parsing.

DOMBuilderEvent Class

The event object that DOMBuilder uses to notify all registered listeners about parse events.

DOMBuilderListener Interface

This interface must be implemented in order to receive notifications about events during the asyncronous parsing.

ResourceManager Class

This class implements a simple semaphore that maintains access to a fixed number of logical resources.

XSLTransformer Class

Applies XSL transformation in a background thread.

XSLTransformerBeanInfo Class

This class provides information about the XSLTransformer Bean.

XSLTransformerErrorEvent Class

The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.

DOMBuilder Class


Description of DOMBuilder

This class encapsulates an eXtensible Markup Language (XML) 1.0 parser to parse an XML document and build a DOM tree. The parsing is done in a separate thread and DOMBuilderListener interface must be used for notification when the tree is built.


Syntax of DOMBuilder

public class DOMBuilder extends java.lang.Object implements 
java.io.Serializable, oracle.xml.async.DOMBuilderConstants, java.lang.Runnable
 
java.lang.Object
  |
  +--oracle.xml.async.DOMBuilder


Implemented Interfaces


Fields of DOMBuilder

Table 10-2 Fields of DOMBuilder  
Field Syntax Description

inSource

protected org.xml.sax.InputSource inSource

InputSource containing XML data to parse

url

protected java.net.URL url

URL to parse XML data from

inStream

protected java.io.InputStream inStream

InputStream containing XML data to parse

inString

protected java.lang.String inString

String containing the URL to parse XML data from

methodToCall

protected int methodToCall

XML Parser method to call based on input types

reader

protected java.io.Reader reader

java.io.Reader containing XML data to be parsed

result

protected oracle.xml.async.XMLDocument result

XML Document being parsed

rootName

protected java.lang.String rootName

Name of the XML element to be treated as root


Methods of DOMBuilder

Table 10-3 Summary of Methods of DOMBuilder  
Method Description

DOMBuilder()

Creates a new parser object.

addDOMBuilderErrorListener()

Adds DOMBuilderErrorListener.

addDOMBuilderListener()

Adds DOMBuilderListener.

getDoctype()

Gets the DTD.

getDocument()

Gets the document for parsing.

getId()

Returns the parser object ID.

getReleaseVersion()

Returns the release version of Oracle XML Parser.

getResult()

Gets the document being parsed.

getValidationMode()

Returns the validation mode.

parse()

Parses the XML from given input.

parseDTD()

Parses the XML External DTD.

removeDOMBuilderErrorListener()

Removes the DOMBuilderErrorListener.

removeDOMBuilderListener()

Removes the DOMBuilderListener.

run()

Runs in a thread.

setBaseURL()

Sets the base URL for lading external entities and DTD.

setDebugMode()

Sets a flag to run on debug information in the document.

setDoctype()

Sets the DTD.

setErrorStream()

Creates an output stream for errors and warnings.

setNodeFactory()

Sets the node factory.

setPreserveWhitespace()

Sets the white space preservation mode.

setValidationMode()

Sets the validation mode.

showWarnings()

Determines whether to print warnings.

DOMBuilder()

Description

Creates a new parser object. The options are described in the following table.

Syntax Description

public DOMBuilder();

Creates a new parser object.

public DOMBuilder(

int id);

Creates a new parser object with a given id.

Parameter Description

id

The DOMBuilder id.

addDOMBuilderErrorListener()

Description

Adds DOMBuilderErrorListener.

Syntax

public void addDOMBuilderErrorListener( DOMBuilderErrorListener p0);

Parameter Description

p0

The DOMBuilderErrorListener to add.

addDOMBuilderListener()

Description

Adds DOMBuilderListener

Syntax

public void addDOMBuilderListener(DOMBuilderListener p0);

Parameter Description

p0

The DOMBuilderListener to add.

getDoctype()

Description

Gets the DTD.

Syntax

public synchronized oracle.xml.async.DTD getDoctype();

getDocument()

Description

Gets the document for parsing.

Syntax

public synchronized oracle.xml.async.XMLDocument getDocument();

getId()

Description

Returns the parser object id (DOMBuilder).

Syntax

public int getId();

getReleaseVersion()

Description

Returns the release version of the Oracle XML Parser, as a String.

Syntax

public synchronized java.lang.String getReleaseVersion();

getResult()

Description

Gets the document being parsed.

Syntax

public synchronized org.w3c.dom.Document getResult();

getValidationMode()

Description

Returns the validation mode; TRUE if XML parser is validating, FALSE otherwise.

Syntax

public synchronized boolean getValidationMode()

parse()

Description

Parses the XML from given input. Throws the following exceptions:

XMLParseException

If syntax or other error encountered.

SAXException

Any SAX exception, possibly wrapping another exception.

IOExceptiopn

I/O Error.

The options are described in the following table.

Syntax Description

public final synchronized void parse (

InputSource in);

Parses the XML from an InputSource

public final synchronized void parse (

j InputStream in);

Parses the XML from an InputStream; the base URL should be set for resolving external entities and DTD.

public final synchronized void parse (

Reader r);

Parses the XML from an Reader; the base URL should be set for resolving external entities and DTD.

public final synchronized void parse (

String urlName);

Parses the XML from the URL indicated by the argument.

public final synchronized void parse (

URL url);

Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.


Parameter Description

in

The input to parse.

r

The Reader containing XML data to parse.

urlName

The String containing the URL from which to parse.

url

The ULR that points to the XML document to parse.

parseDTD()

Description

Parses the XML External DTD. Throws the following exceptions:

XMLParseException

If syntax or other error encountered.

SAXException

Any SAX exception, possibly wrapping another exception.

IOExceptiopn

I/O Error.

The options are described in the following table.

Syntax Description

public final synchronized void parseDTD (

InputSource in,

String rootName);

Parses from a given InputSource.

public final synchronized void parseDTD (

InputStream in,

String rootName);

Parses from a givenInputStream. The base URL should be set for resolving external entities and DTD.

public final synchronized void parseDTD (

Reader in,

String rootName);

Parses from a given Reader. The base URL should be set for resolving external entities and DTD.

public final synchronized void parseDTD (

String urlName,

String rootName);

Parses from the URL indicated.

public final synchronized void parseDTD (

URL url,

String rootName);

Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.


Parameter Description

in

The input to parse.

rootName

The element to be used as root element.

r

The Reader containing XML data to parse.

urlName

The String containing the URL from which to parse.

utl

The ULR that points to the XML document to parse.

removeDOMBuilderErrorListener()

Description

Removes DOMBuilderErrorListener.

Syntax

public synchronized void removeDOMBuilderErrorListener(
                    DOMBuilderErrorListener p0);

Parameter Description

po

The DOMBuilderErrorListener to remove.

removeDOMBuilderListener()

Description

Removes DOMBuilderListener.

Syntax

public synchronized void removeDOMBuilderListener(
                    DOMBuilderListener p0);

Parameter Description

p1

The DOMBuilderListener to remove.

run()

Description

This method runs in a thread. It is specified in java.lang.Runnable.run() in interface java.lang.Runnable.

Syntax

public void run();

setBaseURL()

Description

Sets the base URL for loading external entities and DTDs. This method should to be called if the parse(InputStream) option is used to parse the XML Document.

Syntax

public synchronized void setBaseURL( java.net.URL url);

Parameter Description

url

The base URL.

setDebugMode()

Description

Sets a flag to turn on debug information in the document.

Syntax

public void setDebugMode(boolean flag);

Parameter Description

flag

Determines whether debug information is stored; TRUE when information is stored, FALSE otherwise.

setDoctype()

Description

Sets the DTD.

Syntax

public synchronized void setDoctype(oracle.xml.async.DTD dtd)

Parameter Description

dtd

The DTD to set and use while parsing.

setErrorStream()

Description

Creates an output stream for errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings. The options are described in the following table.

Syntax Description

public final synchronized void setErrorStream(

OutputStream out);

Uses OutputSteam.

public final synchronized void setErrorStream(

OutputStream out,

String enc);

Uses OutputSteam. An IOException is thrown if the encoding specified is not supported.

public final synchronized void setErrorStream(

PrintWriter out);

Uses PrintWriter.


Parameter Description

out

The the output for errors and warnings.

enc

The encoding to use.

setNodeFactory()

Description

Sets the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree. Throws the following exception:

XMLParseException

If an invalid factory is set.

Syntax

public synchronized void setNodeFactory( 
                    oracle.xml.async.NodeFactory factory);

Parameter Description

factory

The NodeFactory to set.

setPreserveWhitespace()

Description

Sets the white space preservation mode.

Syntax

public synchronized void setPreserveWhitespace( boolean flag);

Parameter Description

flag

The preserving mode; TRUE to preserve whitespace, FALSE otherwise.

setValidationMode()

Description

Sets the validation mode.

Syntax

public synchronized void setValidationMode(boolean yes);

Parameter Description

yes

Determines whether the XML parser should be validating; TRUE for validation, FALSE otherwise.

showWarnings()

Description

Determines whether to print warnings.

Syntax

public synchronized void showWarnings(boolean yes);

Parameter Description

yes

Switch; TRUE to print warnings, FALSE otherwise.


DOMBuilderBeanInfo Class


Description of DOMBuilderBeanInfo

This class provides information about the DOMBuilder Bean.


Syntax of DOMBuilderBeanInfo

public class DOMBuilderBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.async.DOMBuilderBeanInfo


Implemented Interfaces of DOMBuilderBeanInfo


Methods of DOMBuilderBeanInfo

Table 10-4 Summary of Methods of DOMBuilderBeanInfo  
Method Description

DOMBuilderBeanInfo()

The default constructor.

getIcon()

Gets an image object that can be used to represent the DOMBuilder bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors.

DOMBuilderBeanInfo()

Description

The default constructor.

Syntax

public  DOMBuilderBeanInfo();

getIcon()

Description

Gets an image object that can be used to represent the DOMBuilder bean in toolbars, toolboxes, and so on. Returns an image object representing the requested icon type. Overrides getIcon() method in java.beans.SimpleBeanInfo Class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

DOMBuilderErrorEvent Class


Description of DOMBuilderErrorEvent

This class defines the error event which is sent when parse exception occurs.


Syntax of DOMBuilderErrorEvent

public class DOMBuilderErrorEvent extends java.util.EventObject
 
java.lang.Object
  |
  +--java.util.EventObject
        |
        +--oracle.xml.async.DOMBuilderErrorEvent


Implemented Interfaces of DOMBuilderErrorEvent


Fields of DOMBuilderErrorEvent

Table 10-5 Fields of DOMBuilderErrorEvent
Field Syntax Description

e

protected java.lang.Exception

The exception being raised.


Methods of DOMBuilderErrorEvent

Table 10-6 Summary of Methods of DOMBuilderErrorEvent  
Method Description

DOMBuilderErrorEvent()

Constructor for DOMBuilderErrorEvent.

getException()

Retrieves the exception being raised.

getMessage()

Returns the error message generated by the parser.

DOMBuilderErrorEvent()

Description

Constructor for DOMBuilderErrorEvent.

Syntax

public  DOMBuilderErrorEvent( Object p0, 
                              Exception e);

Parameter Description

p0

The Object that created this error event.

e

The Exception being raised.

getException()

Description

Retrieves the exception being raised.

Syntax

public java.lang.Exception getException();

getMessage()

Description

Returns the error message generated by the parser, as a String.

Syntax

public java.lang.String getMessage();

DOMBuilderErrorListener Interface


Description of DOMBuilderErrorListener

This interface must be implemented in order to receive notifications when error is found during parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderErrorListener method.


Syntax of DOMBuilderErrorListener

public interface DOMBuilderErrorListener extends java.util.EventListener

Methods of DOMBuilderErrorListener

domBuilderErrorCalled()

Description

This method is called when a parse error occurs.

Syntax

public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);

Parameter Description

p0

The DOMBuilderErrorEvent object produced by the DOMBuilder as result of parsing error.


DOMBuilderEvent Class


Description of DOMBuilderEvent

The event object that DOMBuilder uses to notify all registered listeners about parse events.


Syntax of DOMBuilderEvent

public class DOMBuilderEvent extends java.util.EventObject
 
java.lang.Object
  |
  +--java.util.EventObject
        |
        +--oracle.xml.async.DOMBuilderEvent


Implemented Interfaces of DOMBuilderEvent


Fields of DOMBuilderEvent

Table 10-7 Fields of DOMBuilderEvent
Field Syntax Description

id

protected int id

ID of the source DOMBuilder object


Methods of DOMBuilderEvent

Table 10-8 Summary of Methods of DOMBuilderEvent  
Method Description

DOMBuilderEvent()

Creates a new DOMBuilderEvent.

getID()

Returns unique id of the source DOMBuilder for the event.

DOMBuilderEvent()

Description

Creates a new DOMBuilderEvent.

Syntax

public  DOMBuilderEvent( Object p0,
                         int p1);

Parameter Description

p0

The Object creating this event.

p1

Id of the DOMBuilder creating this event.

getID()

Description

Returns unique id of the source DOMBuilder for this event, which can be used to identify which instance of the DOMBuilder generated this event in cases where multiple instances of DOMBuilder may be working in background.

Syntax

public int getID();

DOMBuilderListener Interface


Description of DOMBuilderListener

This interface must be implemented in order to receive notifications about events during the asyncronous parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderListener method.


Syntax of DOMBuilderListener

public interface DOMBuilderListener extends java.util.EventListener

Methods of DOMBuilderListener

Table 10-9 Summary of Methods of DOMBuilderListener  
Method Description

domBuilderError()

This method is called when parse error occur.

domBuilderOver()

This method is called when the parse is complete.

domBuilderStarted()

This method is called when parse starts

domBuilderError()

Description

This method is called when parse error occur.

Syntax

public void domBuilderError( DOMBuilderEvent p0);

Parameter Description

p0

The DOMBuilderEvent object produced by the DOMBuilder.

domBuilderOver()

Description

This method is called when the parse is complete.

Syntax

public void domBuilderOver( DOMBuilderEvent p0);

Parameter Description

p0

The DOMBuilderEvent object produced by the DOMBuilder.

domBuilderStarted()

Description

This method is called when parse starts.

Syntax

public void domBuilderStarted( DOMBuilderEvent p0);

Parameter Description

p0

The DOMBuilderEvent object produced by the DOMBuilder.


ResourceManager Class


Description of ResourceManager

Implements a semaphore and maintains access to a fixed number of logical resources.


Syntax of ResourceManager

public class ResourceManager extends java.lang.Object
 
java.lang.Object
  |
  +--oracle.xml.async.ResourceManager


Methods of ResourceManager

Table 10-10 Summary of Methods of ResourceManager
Method Description

ResourceManager()

The ResourceManager constructor.

activeFound()

Checks if any of the logical resources being managed are in active use.

getResource()

If the number of resources available for use is nonzero, decreases the number of resources by one. Otherwise, waits until a resource is released and it becomes available for use.

releaseResource()

Releases a single resource, increasing the number of resources available.

sleep()

Allows use of Thread.sleep() without try/catch.

ResourceManager()

Description

The ResourceManager constructor.

Syntax

public  ResourceManager(int i);

Parameter Description

i

The number of resources to manage.

activeFound()

Description

Checks if any of the logical resources being managed are in active use. Returns TRUE if one or more resources in use, FALSE if no resources in use.

Syntax

public boolean activeFound();

getResource()

Description

If the number of resources available for use is nonzero, the method decreases the number of resources by one. Otherwise, it waits until a resource is released and it becomes available for use.

Syntax

public synchronized void getResource();

releaseResource()

Description

Releases a resource. When this method is called, the number of resources available is increased by one.

Syntax

public void releaseResource();

sleep()

Description

Allows use of Thread.sleep() without try/catch.

Syntax

public void sleep(int i);

Parameter Description

i

The number of resources to manage.


XSLTransformer Class


Description of XSLTransformer

Applies XSL transformation in a background thread.


Syntax of XSLTransformer

public class XSLTransformer extends java.lang.Object implements
     java.io.Serializable, oracle.xml.async.XSLTransformerConstants,
     java.lang.Runnable

java.lang.Object
  |
  +--oracle.xml.async.XSLTransformer


Fields of XSLTransformer

Table 10-11 Fields of XSLTransformer
Field Syntax Description

methodToCall

protected int methodToCall

The XSL transformation method to call based on input types.

result

protected oracle.xml.async.DocumentFragment result

Transformation result document.


Methods of XSLTransformer

Table 10-12 Summary of Methods of XSLTransformer  
Method Description

XSLTransformer()

XSLTransformer class constructor.

addXSLTransformerErrorListener()

Adds and XSLTransformerErrorListener.

addXSLTransformerListener()

Adds and XSLTransformerListener.

getId()

Returns a unique XSLTransformer id.

getResult()

Returns the document fragment of the XSL transformation for the resulting document.

processXSL()

Initiates XSL Transformation in the background. The control is returned immediately.

removeDOMTransformerErrorListener()

Removes an XSLTransformerErrorListener.

removeXSLTransformerListener()

Removes an XSLTransformerListener.

run()

Starts a separate thread to perform the XSLTransformation.

setErrorStream()

Sets the error stream to be used by XML processor.

showWarnings()

Sets the showWarnings flag used by the XSL processor.

XSLTransformer()

Description

XSLTransformer constructor. The options are described in the following table.

Syntax Description

public XSLTransformer();

XSLTransformer constructor.

public XSLTransformer(

int id);

XSLTransformer constructor accepting an identifier.


Parameter Description

id

A unique integer that can be used to identify the XSLTransformer instance during event processing

addXSLTransformerErrorListener()

Description

Adds an XSLTransformerErrortListener.

Syntax

public void addXSLTransformerErrorListener( 
                    XSLTransformerErrorListerner p0);

Parameter Description

p0

XSLTransformerErrorListener to be added.

addXSLTransformerListener()

Description

Adds a XSLTransformerListener.

Syntax

public void addXSLTransformerListener( XSLTransformerListerner p0);

Parameter Description

p0

XSLTransformerListener to be added.

getId()

Description

Returns the unique XSLTransformer id.

Syntax

public int getId();

getResult()

Description

Returns the document fragment of the XSL transformation for the resulting document. Called only after receiving notification that the transformation is complete. Since the transformation occurs in background and asyncronously, calling this method immediately after processXSL() will result in holding the control until the result is available.

Syntax

public synchronized oracle.xml.async.DocumentFragment getResult();

processXSL()

Description

Initiates XSL Transformation in the background. The control is returned immediately. An XSLException is thrown if an error occurs during XSL transformation. The options are described in the following table.

Syntax Description

public void processXSL(

oracle.xml.async.XSLStylesheet xsl,

InputStream xml,

URL ref)

The source XML document is provided as an InputStream.

public void processXSL(

oracle.xml.async.XSLStylesheet xsl, j

Reader xml,

URL ref);

The source XML document is provided as a Reader.

public void processXSL(

oracle.xml.async.XSLStylesheet xsl,

URL xml,

URL ref);

The source XML document is provided through a URL.

public void processXSL(

oracle.xml.async.XSLStylesheet xsl,

oracle.xml.async.XMLDocument xml);

The source XML document is provided as a DOM tree.

public void processXSL(

oracle.xml.async.XSLStylesheet xsl,

oracle.xml.async.XMLDocument xml, j

OutputStream os);

The source XML document is provided as a DOM tree, and the output is written into an OutputStream.


Parameter Description

xsl

The stylesheet to be used for XSL transformation

xml

The XML document to be used

ref

The reference URL to resolve external entities in input XML

os

Output to which the XSL transformation result is written

removeDOMTransformerErrorListener()

Description

Removes an XSLTransformerErrorListener.

Syntax

public synchronized void removeDOMTransformerErrorListener(
                    XSLTransformerErrorListener p0);

Parameter Description

p0

The XSLTransformerErrorListener to be removed.

removeXSLTransformerListener()

Description

Removes a XSLTransformerListener.

Syntax

public synchronized void removeXSLTransformerListener(
                    XSLTransformerListener p0);

Parameter Description

p0

The XSLTransformerListener to be removed.

run()

Description

Starts a separate thread to perform the XSLTransformation. Specified by java.lang.Runnable.run() in java.lang.Runnable Interface.

Syntax

public void run();

setErrorStream()

Description

Sets the error stream used by the XSL processor.

Syntax

public final void setErrorStream( java.io.OutputStream out);

Parameter Description

out

The error output stream for the XSL processor.

showWarnings()

Description

Sets the showWarnings flag used by the XSL processor.

Syntax

public final void showWarnings( boolean yes);

Parameter Description

yes

Indicates whether XSL processor warnings should be shown; TRUE to show warnings, FALSE otherwise.


XSLTransformerBeanInfo Class


Description of XSLTransformerBeanInfo

This class provides information about the XSLTransformer Bean.


Syntax of XSLTransformerBeanInfo

public class XSLTransformerBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.async.XSLTransformerBeanInfo


Implemented Interfaces of XSLTransformerBeanInfo

java.beans.BeanInfo

Methods of XSLTransformerBeanInfo

Table 10-13 Summary of Methods of XSLTransformerBeanInfo
Method Description

XSLTransformerBeanInfo()

The default constructor.

getIcon()

Retrieves an image object representing the requested icon type for XSLTransformer bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves the array of XSLTransformer bean's editable PropertyDescriptiors.

XSLTransformerBeanInfo()

Description

The default Constructor.

Syntax

public  XSLTransformerBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for XSLTransformer bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves the array of XSLTransformer bean's editable PropertyDescriptiors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

XSLTransformerErrorEvent Class


Description of XSLTransformerErrorEvent

The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.


Syntax of XSLTransformerErrorEvent

public class XSLTransformerErrorEvent extends java.util.EventObject
 
java.lang.Object
  |
  +--java.util.EventObject
        |
        +--oracle.xml.async.XSLTransformerErrorEvent


Implemented Interfaces of XSLTransformerErrorEvent

java.io.Serializable

Fields of XSLTransformerErrorEvent

Table 10-14 Fields of XSLTransformerErrorEvent
Field Syntax Description

e

protected java.lang.Exception e

The exception being raised.


Methods of XSLTransformerErrorEvent

Table 10-15 Summary of Methods of XSLTransformerErrorEvent  
Method Description

XSLTransformerErrorEvent()

Constructor for XSLTransformerErrorEvent.

getException()

Returns the transformation exception that XSLTransformer encountered an object unique id.

getMessage()

Returns the error message that describes the error encountered by XSLTransformer.

XSLTransformerErrorEvent()

Description

Constructor for XSLTransformerErrorEvent.

Syntax

public  XSLTransformerErrorEvent( Object p0,
                                    Exception e);

Parameter Description

p0

The Object that created this event.

e

The exception raised.

getException()

Description

Returns the transformation exception that XSLTransformer encountered an object unique id.

Syntax

public Exception getException();

getMessage()

Description

Returns the error message that describes the error encountered by XSLTransformer.

Syntax

public String getMessage();

XSLTransformerErrorListener Interface


Description of XSLTransformerErrorListenerInterface

This interface must be implemented in order to receive notifications about error events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer using addXSLTransformerListener method.


Syntax of XSLTransformerErrorListenerInterface

public interface XSLTransformerErrorListener extends
     java.util.EventListener

Methods of XSLTransformerErrorListenerInterface

xslTransformerErrorCalled()

Description

his method is called when parse or transformation error occurs.

Syntax

public void xslTransformerErrorCalled( XSLTransformerErrorEvent p0);

Parameter Description

p0

The XSLTransformerErrorEvent object produced by the XSLTransformer.


XSLTransformerEvent Class


Description of XSLTransformerEvent

This class represents the event object used by XSLTransformer to notify XSL transformation events to all its registered listeners.


Syntax of XSLTransformerEvent

public class XSLTransformerEvent extends java.util.EventObject
 
java.lang.Object
  |
  +--java.util.EventObject
        |
        +--oracle.xml.async.XSLTransformerEvent


Implemented Interfaces of XSLTransformerEvent

java.io.Serializable

Fields of XSLTransformerEvent

Table 10-16 Fields of XSLTransformerEvent
Field Syntax Description

id

protected int id

ID of the source XSLTransformer object


Methods of XSLTransformerEvent

Table 10-17 Summary of Methods of XSLTransformerEvent  
Method Description

XSLTransformerEvent()

Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id.

getID()

Returns unique id of the XSLTransformer object

XSLTransformerEvent()

Syntax

Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id.

Description

public  XSLTransformerEvent(java.lang.Object p0, int p1);

Parameter Description

p0

The source XSLTransformer object that will fire the events

p1

Unique id identifying the source object

getID()

Syntax

Returns unique id of the XSLTransformer object which can be used to identify which instance of the XSLTransformer generated this event in cases where multiple instances of XSLTransformer may be working in background.

Description

public int getID();

XSLTransformerListener Interface


Syntax of XSLTransformerListener

public interface XSLTransformerListener extends java.util.EventListener

Description of XSLTransformerListener

This interface must be implemented in order to receive notifications about events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer using addXSLTransformerListener method.


Methods of XSLTransformerListener

Table 10-18 Summary of Methods of XSLTransformerListener  
Method Description

xslTransformerError()

This method is called when parse or transformation error occur.

xslTransformerOver()

This method is called when the transformation is complete.

xslTransformerStarted()

This method is called when the transformation starts.

xslTransformerError()

Description

This method is called when parse or transformation error occur.

Syntax

public void xslTransformerError( XSLTransformerEvent p0);

Parameter Description

p0

The XSLTransformerEvent object produced by the XSLTransformer.

xslTransformerOver()

Description

This method is called when the transformation is complete.

Syntax

public void xslTransformerOver( XSLTransformerEvent p0);

Parameter Description

p0

The XSLTransformerEvent object produced by the XSLTransformer.

xslTransformerStarted()

Description

This method is called when the transformation starts.

Syntax

public void xslTransformerStarted( XSLTransformerEvent p0);

Parameter Description

p0

The XSLTransformerEvent object produced by the XSLTransformer.


oracle.xml.dbviewer Package


Description

This is a visual bean used to display and edit HTML, XML or XSL file. XML files can be transferred between the file system, the database and the bean buffers. It can be used to transform database queries to XML. XML files can be parsed and transformed using XSL. The classes of the oOracle.xml.dbviewer as summarized in Table 10-19.

Table 10-19 Summary of Classes of oracle.xml.dbviewer
Class Description

DBViewer Class

Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulting HTML in a scrollable swing panel.

DBViewerBeanInfo Class

This class provides information about the DBViewer Bean.


DBViewer Class


Description of DBViewer

Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulting HTML in a scrollable swing panel. This bean has tree buffers: XML, XSL and result buffer. The bean API enables the calling program to load/save the buffers from various sources and to apply stylesheet transformations to the XML buffer using the stylesheet in the XSL buffer. The result can be stored in the result buffer.

The XML and XSL buffer content can be shown as source or as a tree structures. The result buffer content can be rendered as HTML, and also shown as source or tree structures. The XML buffer can be loaded from database query.

All buffers can load and save files both from CLOB tables in Oracle database and from the file system. Therefore, the control can be used to move files between the file system and the user schema in the database.


Syntax of DBViewer

public class DBViewer extends javax.swing.JPanel implements java.io.Serializable
 
java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--oracle.xml.dbviewer.DBViewer


Implemented Interfaces of DBViewer


Methods of DBViewer

Table 10-20 Summary of Methods of DBViewer  
Method Description

DBViewer()

Constructs a new instance of DBViewer.

getHostname()

Retrieves the database host name.

getInstancename()

Retrieves the database instance name.

getPassword()

Retrieves the user password.

getPort()

Retrieves the database port number as a String.

getResBuffer()

Retrieves the content of the result buffer.

getResCLOBFileName()

Retrieves the result CLOB file name.

getResCLOBTableName()

Retrieves the result CLOB table name.

getResFileName()

Retrieves the result file name.

getUsername()

Retrieves the user name.

getXmlBuffer()

Retrieves the content of the XML buffer.

getXmlCLOBFileName()

Retrieves the XML CLOB file name.

getXmlCLOBTableName()

Retrieves the XML CLOB table name.

getXmlFileName()

Retrieves the XML file name.

getXMLStringFromSQL()

Retrieves the XML presentation of a result set from SQL query as an XMLString.

getXslBuffer()

Retrieves the content of the XSL buffer.

getXslCLOBFileName()

Retrieves the XSL CLOB file name.

getXslCLOBTableName()

Retrieves XSL CLOB table name.

getXslFileName()

Retrieves XSL file name.

loadResBuffer()

Loads the result buffer.

loadResBufferFromClob()

Loads the result buffer from CLOB file.

loadResBufferFromFile()

Loads the result buffer from file.

loadXmlBuffer()

Loads the XML buffer.

loadXmlBufferFromClob()

Loads the XML buffer from CLOB file.

loadXmlBufferFromFile()

Loads the XML buffer from file.

loadXMLBufferFromSQL()

Loads the XML buffer from SQL result set.

loadXslBuffer()

Loads the XSL buffer from file.

loadXslBufferFromClob()

Loads the XSL buffer from CLOB file.

loadXslBufferFromFile()

Loads the XSL buffer from file.

parseResBuffer()

Parses the result buffer, refreshes the tree and source views, and returns the XMLDocument.

parseXmlBuffer()

Parse the XML buffer, refreshes the tree and source views, and returns the XMLDocument.

parseXslBuffer()

Parses the XSL buffer, refreshes the tree and source views, and returns the XMLDocument.

saveResBuffer()

Saves the result buffer to file.

saveResBufferToClob()

Saves the result buffer to CLOB file.

saveResBufferToFile()

Saves the result buffer to file.

saveXmlBuffer()

Saves the XML buffer to file.

saveXmlBufferToClob()

Saves the XML buffer to CLOB file.

saveXmlBufferToFile()

Saves the XML buffer to file.

saveXslBuffer()

Saves the XSL buffer to file.

saveXslBufferToClob()

Saves the XSL buffer to CLOB file.

saveXslBufferToFile()

Saves the XSL buffer to file.

setHostname()

Sets database host name.

setInstancename()

Sets database instance name.

setPassword()

Sets user password.

setPort()

Sets database port number.

setResBuffer()

Sets new text in the result buffer.

setResCLOBFileName()

Sets result CLOB file name.

setResCLOBTableName()

Sets result CLOB table name.

setResFileName()

Sets result file name.

setResHtmlView()

Show the result buffer as rendered HTML.

setResSourceEditView()

Shows the result buffer as XML source and enter edit mode.

setResSourceView()

Shows the result buffer as XML source.

setResTreeView()

Shows the result buffer as an XML tree view.

setUsername()

Sets the user name.

setXmlBuffer()

Sets new text in the XML buffer.

setXmlCLOBFileName()

Sets XML CLOB file name.

setXmlCLOBTableName()

Sets the XML CLOB table name.

setXmlFileName()

Sets the XML file name.

setXmlSourceEditView()

Shows the XML buffer as XML source and enter edit mode.

setXmlSourceView()

Shows the XML buffer as an XML source.

setXmlTreeView()

Shows the XML buffer as tree.

setXslBuffer()

Sets new text in the XSL buffer.

setXslCLOBFileName()

Sets the XSL CLOB file name.

setXslCLOBTableName()

Sets the XSL CLOB table name.

setXslFileName()

Sets the XSL file name.

setXslSourceEditView()

Shows the XSL buffer as XML source and enter edit mode.

setXslSourceView()

Shows the XSL buffer as an XML source.

setXslTreeView()

Shows the XSL buffer as tree.

transformToDoc()

Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.

transformToRes()

Applies the stylesheet transformation from the XSL buffer to the XML in the XML buffer, and stores the result in the result buffer.

transformToString()

Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.

DBViewer()

Description

Constructs a new instance of DBViewer.

Syntax

public  DBViewer();

getHostname()

Description

Retrieves the database host name.

Syntax

public java.lang.String getHostname();

getInstancename()

Description

Retrieves the database instance name.

Syntax

public java.lang.String getInstancename();

getPassword()

Description

Retrieves the user password.

Syntax

public java.lang.String getPassword();

getPort()

Description

Retrieves the database port number as a String.

Syntax

public java.lang.String getPort();

getResBuffer()

Description

Retrieves the content of the result buffer.

Syntax

public java.lang.String getResBuffer();

getResCLOBFileName()

Description

Retrieves the result CLOB file name.

Syntax

public java.lang.String getResCLOBFileName();

getResCLOBTableName()

Description

Retrieves the result CLOB table name.

Syntax

public java.lang.String getResCLOBTableName();

getResFileName()

Description

Retrieves the result file name.

Syntax

public java.lang.String getResFileName();

getUsername()

Description

Retrieves the user name.

Syntax

public java.lang.String getUsername();

getXmlBuffer()

Description

Retrieves the content of the XML buffer.

Syntax

public java.lang.String getXmlBuffer();

getXmlCLOBFileName()

Description

Retrieves the XML CLOB file name.

Syntax

public java.lang.String getXmlCLOBFileName();

getXmlCLOBTableName()

Description

Retrieves the XML CLOB table name.

Syntax

public java.lang.String getXmlCLOBTableName();

getXmlFileName()

Description

Retrieves the XML file name.

Syntax

public java.lang.String getXmlFileName();

getXMLStringFromSQL()

Description

Retrieves the XML presentation of a result set from SQL query as an XMLString.

Syntax

public java.lang.String getXMLStringFromSQL( java.lang.String sqlText);

Parameter Description

sqlText

The SQL text.

getXslBuffer()

Description

Retrieves the content of the XSL buffer.

Syntax

public java.lang.String getXslBuffer();

getXslCLOBFileName()

Description

Retrieves the XSL CLOB file name.

Syntax

public java.lang.String getXslCLOBFileName();

getXslCLOBTableName()

Description

Retrieves XSL CLOB table name.

Syntax

public java.lang.String getXslCLOBTableName();

getXslFileName()

Description

Retrieves XSL file name.

Syntax

public java.lang.String getXslFileName();

loadResBuffer()

Description

Loads the result buffer. The options are described in the following table.

Syntax Description

public void loadResBuffer(

String filename);

Loads the result buffer from file.

public void loadResBuffer(

String clobTablename,

String clobFilename);

Loads the result buffer from a CLOB file.

public void loadResBuffer(

oracle.xml.parser.v2.XMLDocument resDoc);

Loads the result buffer from an XMLDocument.


Parameter Description

filename

The file name.

clobTablename

The CLOB table name.

clobFilename

The CLOB file name.

resDoc

The XMLDocument.

loadResBufferFromClob()

Description

Loads the result buffer from CLOB file.

Syntax

public void loadResBufferFromClob();

loadResBufferFromFile()

Description

Loads the result buffer from file.

Syntax

public void loadResBufferFromFile();

loadXmlBuffer()

Description

Loads the XML buffer. The options are described in the following table.

Syntax Description

public void loadXmlBuffer( j

String filename);

Loads the XML buffer from file.

public void loadXmlBuffer(

String clobTablename,

String clobFilename);

Loads the XML buffer from CLOB file.

public void loadXmlBuffer(

oracle.xml.parser.v2.XMLDocument xmlDoc);

Loads the XML buffer from XMLDocument.


Parameter Description

filename

The file name.

clobTablename

The CLOB table name.

clobFilename

The CLOB file name.

resDoc

The XMLDocument.

loadXmlBufferFromClob()

Description

Loads the XML buffer from CLOB file.

Syntax

public void loadXmlBufferFromClob();

loadXmlBufferFromFile()

Description

Loads the XML buffer from file.

Syntax

public void loadXmlBufferFromFile();

loadXMLBufferFromSQL()

Description

Loads the XML buffer from SQL result set.

Syntax

public void loadXMLBufferFromSQL( String sqlText);

Parameter Description

sqlText

SQL text

loadXslBuffer()

Description

Loads the XSL buffer from file. The options are described in the following table.

Syntax Description

public void loadXslBuffer(

String filename);

Loads the XSL buffer from file.

public void loadXslBuffer(

String clobTablename,

String clobFilename);

Loads the XSL buffer from CLOB file.

public void loadXslBuffer(

oracle.xml.parser.v2.XMLDocument xslDoc);

Loads the XSL buffer from XMLDocument.


Parameter Description

filename

The file name.

clobTablename

The CLOB table name.

clobFilename

The CLOB file name.

xslDoc

The XMLDocument.

loadXslBufferFromClob()

Description

Loads the XSL buffer from CLOB file.

Syntax

public void loadXslBufferFromClob();

loadXslBufferFromFile()

Description

Loads the XSL buffer from file.

Syntax

public void loadXslBufferFromFile();

parseResBuffer()

Description

Parses the result buffer, refreshes the tree and source views, and returns the XMLDocument.

Syntax

public oracle.xml.parser.v2.XMLDocument parseResBuffer();

parseXmlBuffer()

Description

Parse the XML buffer, refreshes the tree and source views, and returns the XMLDocument.

Syntax

public oracle.xml.parser.v2.XMLDocument parseXmlBuffer();

parseXslBuffer()

Description

Parses the XSL buffer, refreshes the tree and source views, and returns the XMLDocument.

Syntax

public oracle.xml.parser.v2.XMLDocument parseXslBuffer();

saveResBuffer()

Description

Saves the result buffer to file. The options are described in the following table.

Syntax Description

public void saveResBuffer(

String filename);

Save the result buffer to file.

public void saveResBuffer(

String tablename,

String filename);

Save the result buffer to CLOB file.


Parameter Description

tablename

The CLOB table name.

filename

The CLOB file name.

saveResBufferToClob()

Description

Saves the result buffer to CLOB file.

Syntax

public void saveResBufferToClob();

saveResBufferToFile()

Description

Saves the result buffer to file.

Syntax

public void saveResBufferToFile();

saveXmlBuffer()

Saves the XML buffer to file. The options are described in the following table.

Syntax Description

public void saveXmlBuffer(

String filename);

Saves the XML buffer to file.

public void saveXmlBuffer(

String tablename,

String filename);

Saves the XML buffer to CLOB file.


Parameter Description

tablename

The CLOB table name.

filename

The CLOB file name.

saveXmlBufferToClob()

Description

Saves the XML buffer to CLOB file.

Syntax

public void saveXmlBufferToClob();

saveXmlBufferToFile()

Description

Saves the XML buffer to file.

Syntax

public void saveXmlBufferToFile();

saveXslBuffer()

Description

Saves the XSL buffer to file. The options are described in the following table.

Syntax Description

public void saveXslBuffer(

String fileName);

Saves the XSL buffer to file in the file system.

public void saveXslBuffer(

String tableName,

String fileName);

Saves the XSL buffer to a CLOB file.


Parameter Description

tableName

The table name.

fileName

The file name.

saveXslBufferToClob()

Description

Saves the XSL buffer to CLOB file.

Syntax

public void saveXslBufferToClob();

saveXslBufferToFile()

Description

Saves the XSL buffer to file.

Syntax

public void saveXslBufferToFile();

setHostname()

Description

Sets database host name.

Syntax

public void setHostname( java.lang.String hostname);

Parameter Description

hostname

The host name.

setInstancename()

Description

Sets database instance name.

Syntax

public void setInstancename( String instancename);

Parameter Description

instancename

The database instance name.

setPassword()

Description

Sets user password.

Syntax

public void setPassword( String password);

Parameter Description

password

The user password.

setPort()

Description

Sets database port number.

Syntax

public void setPort( String port);

Parameter Description

port

String containing the port number.

setResBuffer()

Description

Sets new text in the result buffer.

Syntax

public void setResBuffer( String text);

Parameter Description

text

The new text.

setResCLOBFileName()

Description

Sets result CLOB file name.

Syntax

public void setResCLOBFileName( String name);

Parameter Description

name

Result CLOB file name.

setResCLOBTableName()

Description

Sets result CLOB table name.

Syntax

public void setResCLOBTableName( String name);

Parameter Description

name

Result CLOB table name.

setResFileName()

Description

Sets result file name.

Syntax

public void setResFileName( String name);

Parameter Description

name

Result file name.

setResHtmlView()

Description

Show the result buffer as rendered HTML.

Syntax

public void setResHtmlView( boolean on);

Parameter Description

on

Switch for showing result buffer as HTML; TRUE for showing, FALSE otherwise.

setResSourceEditView()

Description

Shows the result buffer as XML source and enter edit mode.

Syntax

public void setResSourceEditView( boolean on);

Parameter Description

on

Switch for showing result buffer as HTML with edit mode; TRUE for showing, FALSE otherwise.

setResSourceView()

Description

Shows the result buffer as XML source.

Syntax

public void setResSourceView( boolean on);

Parameter Description

on

Switch for showing result buffer as XML source; TRUE for showing, FALSE otherwise.

setResTreeView()

Description

Shows the result buffer as an XML tree view.

Syntax

public void setResTreeView( boolean on);

Parameter Description

on

Switch for showing result buffer as an XML tree view; TRUE for showing, FALSE otherwise.

setUsername()

Description

Sets the user name.

Syntax

public void setUsername( String username);

Parameter Description

username

The user name.

setXmlBuffer()

Description

Sets new text in the XML buffer.

Syntax

public void setXmlBuffer( String text)

Parameter Description

text

The XML text

setXmlCLOBFileName()

Description

Sets XML CLOB file name.

Syntax

public void setXmlCLOBFileName( String name);

Parameter Description

name

The XML CLOB file name.

setXmlCLOBTableName()

Description

Sets the XML CLOB table name.

Syntax

public void setXmlCLOBTableName( String name);

Parameter Description

name

The XML CLOB table name.

setXmlFileName()

Description

Sets the XML file name.

Syntax

public void setXmlFileName( String name);

Parameter Description

name

The XML file name.

setXmlSourceEditView()

Description

Shows the XML buffer as XML source and enter edit mode.

Syntax

public void setXmlSourceEditView( boolean on);

Parameter Description

on

Switch for showing the XML buffer as XML source with edit mode; TRUE for showing, FALSE otherwise.

setXmlSourceView()

Description

Shows the XML buffer as an XML source.

Syntax

public void setXmlSourceView( boolean on);

Parameter Description

on

Switch for showing the XML buffer as XML source; TRUE for showing, FALSE otherwise.

setXmlTreeView()

Description

Shows the XML buffer as tree.

Syntax

public void setXmlTreeView( boolean on);

Parameter Description

on

Switch for showing the XML buffer as XML tree; TRUE for showing, FALSE otherwise.

setXslBuffer()

Description

Sets new text in the XSL buffer.

Syntax

public void setXslBuffer( String text);

Parameter Description

text

The XSL text.

setXslCLOBFileName()

Description

Sets the XSL CLOB file name.

Syntax

public void setXslCLOBFileName( String name);

Parameter Description

name

The XSL CLOB file name.

setXslCLOBTableName()

Description

Sets the XSL CLOB table name.

Syntax

public void setXslCLOBTableName( String name);

Parameter Description

name

The XSL CLOB table name.

setXslFileName()

Description

Sets the XSL file name.

Syntax

public void setXslFileName( String name);

Parameter Description

name

The XSL file name.

setXslSourceEditView()

Description

Shows the XSL buffer as XML source and enter edit mode.

Syntax

public void setXslSourceEditView( boolean on);

Parameter Description

on

Switch for showing the XSL buffer as XML source with edit mode; TRUE for showing, FALSE otherwise.

setXslSourceView()

Description

Shows the XSL buffer as an XML source.

Syntax

public void setXslSourceView( boolean on);

Parameter Description

on

Switch for showing the XSL buffer as XML source; TRUE for showing, FALSE otherwise.

setXslTreeView()

Description

Shows the XSL buffer as tree.

Syntax

public void setXslTreeView( boolean on);

Parameter Description

on

Switch for showing the XSL buffer as XML tree; TRUE for showing, FALSE otherwise.

transformToDoc()

Description

Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.

Syntax

public oracle.xml.parser.v2.XMLDocument transformToDoc();

transformToRes()

Description

Applies the stylesheet transformation from the XSL buffer to the XML in the XML buffer, and stores the result in the result buffer.

Syntax

public void transformToRes();

transformToString()

Description

Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

Syntax

public java.lang.String transformToString();

DBViewerBeanInfo Class


Description of DBViewerBeanInfo

This class provides information about the DBViewer Bean.


Syntax of DBViewerBeanInfo

public class DBViewerBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.dbviewer.DBViewerBeanInfo


Implemented Interfaces of DBViewerBeanInfo


Methods of DBViewerBeanInfo

Table 10-21 Summary of Methods of DBViewerBeanInfo  
Method Description

DBViewerBeanInfo()

Class constructor.

getIcon()

Retrieves an image object representing the requested icon type for DBViewer bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves an array of DBViwer bean's editable PropertyDescriptors.

DBViewerBeanInfo()

Description

Class constructor.

Syntax

public  DBViewerBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for DBViewer bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves an array of DBViwer bean's editable PropertyDescriptors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

oracle.xml.srcviewer Package


Description

This is a visual bean used to display an XML source document with syntax highlighting. The color, fonts and sizes of different XML language element are customizable.

The classes of the oOracle.xml.srcviewer as summarized in Table 10-22.

Table 10-22 Summary of Classes of oracle.xml.srcviewer
Class Description

XMLSourceView Class

Shows an XML document.

XMLSourceViewBeanInfo Class

This class provides information about the XMLSourceView Bean.


XMLSourceView Class


Description of XMLSourceView

Shows an XML document. Recognizes the following XML token types: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Each token type has a foreground color and font. The default color/font settings can be changed by the user. Takes as input an org.w3c.dom.Document object.


Syntax of XMLSourceView

public class XMLSourceView extends javax.swing.JPanel implements 
java.io.Serializable
 
java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--oracle.xml.srcviewer.XMLSourceView


Implemented Interfaces of XMLSourceView


Fields of XMLSourceView

Table 10-23 Fields of ElementDecl
Field Syntax Description

inputDOMDocument

protected

org.w3c.dom.Document inputDOMDocument

XML Document to be displayed.

jScrollPane

protected

javax.swing.JScrollPane jScrollPane

The java swing component used by XMLSourveView to enable scrolling.

jTextPane

protected

javax.swing.JTextPane jTextPane

The java swing component used by XMLSourceView to display text.

xmlStyledDocument

protected

oracle.xml.srcviewer.XMLStyledDocument

xmlStyledDocument

Represents a stylized XML document; associates XML tokens with attributes, such as font and color.


Methods of XMLSourceView

Table 10-24 Summary of Methods of XMLSourceView  
Method Description

XMLSourceView()

The class constructor. Creates an object of type XMLSourceView.

fontGet()

Extracts and returns the font from a given attribute set.

fontSet()

Sets the mutable attribute set font.

getAttributeNameFont()

Returns the Attribute Value font.

getAttributeNameForeground()

Returns the Attribute Name foreground color.

getAttributeValueFont()

Returns the Attribute Value font.

getAttributeValueForeground()

Returns the Attribute Value foreground color.

getBackground()

Returns the background color.

getCDATAFont()

Returns the CDATA font.

getCDATAForeground()

Returns the CDATA foreground color.

;getCommentDataFont()

Returns the Comment Data font.

getCommentDataForeground()

Returns the Comment Data foreground color.

getEditedText()

Returns the edited text.

getJTextPane()

Returns the viewer JTextPane component used by XMLSourceViewer.

getMinimumSize()

Returns the XMLSourceView minimal size.

getNodeAtOffset()

Returns the XML node at a given offset.

getPCDATAFont()

Returns the PCDATA font.

getPCDATAForeground()

Returns the PCDATA foreground color.

getPIDataFont()

Returns the PI Data font.

getPIDataForeground()

Returns the PI Data foreground color.

getPINameFont()

Returns the PI Name font.

getPINameForeground()

Returns the PI Data foreground color.

getSymbolFont()

Returns the NOTATION Symbol font.

getSymbolForeground()

Returns the NOTATION Symbol foreground color.

getTagFont()

Returns the Tag font.

getTagForeground()

Returns the Tag foreground color.

getText()

Returns the XML document as a String.

isEditable()

Returns boolean to indicate whether this object is editable.

selectNodeAt()

Moves the cursor to XML Node at specified offset.

setAttributeNameFont()

Sets the Attribute Name font.

setAttributeNameForeground()

Sets the Attribute Name foreground color.

setAttributeValueFont()

Sets the Attribute Value font.

setAttributeValueForeground()

Sets the Attribute Value foreground color.

setBackground()

Sets the background color.

setCDATAFont()

Sets the CDATA font.

setCDATAForeground()

Sets the CDATA foreground color.

setCommentDataFont()

Sets the Comment font.

setCommentDataForeground()

Sets the Comment foreground color.

setEditable()

Sets the specified boolean to indicate whether this object should be editable.

setPCDATAFont()

Sets the PCDATA font.

setPCDATAForeground()

Sets the PCDATA foreground color.

setPIDataFont()

Sets the PI Data font.

setPIDataForeground()

Sets the PI Data foreground color.

setPINameFont()

Sets the PI Name font.

setPINameForeground()

Sets the PI Name foreground color.

setSelectedNode()

Sets the cursor position at the selected XML node.

setSymbolFont()

Sets the NOTATION Symbol font.

setSymbolForeground()

Sets the NOTATION Symbol foreground color.

setTagFont()

Sets the Tag font.

setTagForeground()

Sets the Tag foreground color.

setXMLDocument()

Associates the XMLviewer with a XML document.

XMLSourceView()

Description

The class constructor. Creates an object of type XMLSourceView.

Syntax

public  XMLSourceView();

fontGet()

Description

Extracts and returns the font from a given attribute set.

Syntax

public static java.awt.Font fontGet( 
                    javax.swing.text.AttributeSet attributeSet);

Parameter Description

attributeSet

The source AttributeSet.

fontSet()

Description

Sets the mutable attribute set font.

Syntax

public static void fontSet( 
                    javax.swing.text.MutableAttributeSet mutAttributeSet,
                    java.awt.Font font);

Parameter Description

mutAttributeSet

The mutableattributeset to update.

font

The new Font for the mutableattributeset.

getAttributeNameFont()

Description

Returns the Attribute Value font.

Syntax

public java.awt.Font getAttributeNameFont();

getAttributeNameForeground()

Description

Returns the Attribute Name foreground color.

Syntax

public java.awt.Color getAttributeNameForeground();

getAttributeValueFont()

Description

Returns the Attribute Value font.

Syntax

public java.awt.Font getAttributeValueFont();

getAttributeValueForeground()

Description

Returns the Attribute Value foreground color.

Syntax

public java.awt.Color getAttributeValueForeground();

getBackground()

Description

Returns the background color. Overrides getBackground() in java.awt.Component class.

Syntax

public java.awt.Color getBackground();

getCDATAFont()

Description

Returns the CDATA font.

Syntax

public java.awt.Font getCDATAFont();

getCDATAForeground()

Description

Returns the CDATA foreground color.

Syntax

public java.awt.Color getCDATAForeground();

;getCommentDataFont()

Description

Returns the Comment Data font.

Syntax

public java.awt.Font getCommentDataFont();

getCommentDataForeground()

Description

Returns the Comment Data foreground color.

Syntax

public java.awt.Color getCommentDataForeground();

getEditedText()

Description

Returns the edited text.

Syntax

public java.lang.String getEditedText();

getJTextPane()

Description

Returns the viewer JTextPane component used by XMLSourceViewer.

Syntax

public javax.swing.JTextPane getJTextPane();

getMinimumSize()

Description

Returns the XMLSourceView minimal size. Overrides getMinimumSize() in javax.swing.JComponent class.

Syntax

public java.awt.Dimension getMinimumSize();

getNodeAtOffset()

Description

Returns the XML node at a given offset.

Syntax

public org.w3c.dom.Node getNodeAtOffset( int i);

Parameter Description

i

The node offset.

getPCDATAFont()

Description

Returns the PCDATA font.

Syntax

public java.awt.Font getPCDATAFont();

getPCDATAForeground()

Description

Returns the PCDATA foreground color.

Syntax

public java.awt.Color getPCDATAForeground();

getPIDataFont()

Description

Returns the PI Data font.

Syntax

public java.awt.Font getPIDataFont();

getPIDataForeground()

Description

Returns the PI Data foreground color.

Syntax

public java.awt.Color getPIDataForeground();

getPINameFont()

Description

Returns the PI Name font.

Syntax

public java.awt.Font getPINameFont();

getPINameForeground()

Description

Returns the PI Data foreground color.

Syntax

public java.awt.Color getPINameForeground();

getSymbolFont()

Description

Returns the NOTATION Symbol font.

Syntax

public java.awt.Font getSymbolFont();

getSymbolForeground()

Description

Returns the NOTATION Symbol foreground color.

Syntax

public java.awt.Color getSymbolForeground();

getTagFont()

Description

Returns the Tag font.

Syntax

public java.awt.Font getTagFont();

getTagForeground()

Description

Returns the Tag foreground color.

Syntax

public java.awt.Color getTagForeground();

getText()

Description

Returns the XML document as a String.

Syntax

public java.lang.String getText();

isEditable()

Description

Returns boolean to indicate whether this object is editable.

Syntax

public boolean isEditable();

selectNodeAt()

Description

Moves the cursor to XML Node at the specified offset.

Syntax

public void selectNodeAt( int i);

Parameter Description

i

The node offset.

setAttributeNameFont()

Description

Sets the Attribute Name font.

Syntax

public void setAttributeNameFont( java.awt.Font font);

Parameter Description

font

The new Font Attribute Name.

setAttributeNameForeground()

Description

Sets the Attribute Name foreground color.

Syntax

public void setAttributeNameForeground( java.awt.Color color);

Parameter Description

color

The new Color for Attribute Name.

setAttributeValueFont()

Description

Sets the Attribute Value font.

Syntax

public void setAttributeValueFont( java.awt.Font font);

Parameter Description

font

The new Font Attribute Value

setAttributeValueForeground()

Description

Sets the Attribute Value foreground color.

Syntax

public void setAttributeValueForeground( java.awt.Color color);

Parameter Description

color

The new Color for Attribute Value.

setBackground()

Description

Sets the background color. Overrides setBackground() in javax.swing.JComponent class.

Syntax

public void setBackground( java.awt.Color color);

Parameter Description

font

The new background Color.

setCDATAFont()

Description

Sets the CDATA font.

Syntax

public void setCDATAFont( java.awt.Font font);

Parameter Description

font

The new Font for CDATA.

setCDATAForeground()

Description

Sets the CDATA foreground color.

Syntax

public void setCDATAForeground( java.awt.Color color);

Parameter Description

color

The new Color for CDATA.

setCommentDataFont()

Description

Sets the Comment font.

Syntax

public void setCommentDataFont( java.awt.Font font);

Parameter Description

font

The new Font for the XML Comments.

setCommentDataForeground()

Description

Sets the Comment foreground color.

Syntax

public void setCommentDataForeground( java.awt.Color color);

Parameter Description

color

The new Color for Comment.

setEditable()

Description

Sets the specified boolean to indicate whether this object should be editable.

Syntax

public void setEditable( boolean edit);

Parameter Description

edit

Flag indicating if the object should be editable; TRUE when text displayed can be edited, FALSE otherwise.

setPCDATAFont()

Description

Sets the PCDATA font.

Syntax

public void setPCDATAFont( java.awt.Font font);

Parameter Description

font

The new Font for PCDATA.

setPCDATAForeground()

Description

Sets the PCDATA foreground color.

Syntax

public void setPCDATAForeground( java.awt.Color color);

Parameter Description

color

The new Color for PCDATA.

setPIDataFont()

Description

Sets the PI Data font.

Syntax

public void setPIDataFont( java.awt.Font font);

Parameter Description

font

The new Font for PI Data.

setPIDataForeground()

Description

Sets the PI Data foreground color.

Syntax

public void setPIDataForeground( java.awt.Color color);

Parameter Description

color

The new Color for PI Data.

setPINameFont()

Description

Sets the PI Name font.

Syntax

public void setPINameFont(java.awt.Font font);

Parameter Description

font

The new Font for the PI Names.

setPINameForeground()

Description

Sets the PI Name foreground color.

Syntax

public void setPINameForeground( java.awt.Color color);

Parameter Description

color

The new Color for PI Name.

setSelectedNode()

Description

Sets the cursor position at the selected XML node.

Syntax

public void setSelectedNode( org.w3c.dom.Node node);

Parameter Description

node

The selected node.

setSymbolFont()

Description

Sets the NOTATION Symbol font.

Syntax

public void setSymbolFont( java.awt.Font font);

Parameter Description

font

The new Font for NOTATION Symbol.

setSymbolForeground()

Description

Sets the NOTATION Symbol foreground color.

Syntax

public void setSymbolForeground( java.awt.Color color);

Parameter Description

color

The new Color for NOTATION Symbol.

setTagFont()

Description

Sets the Tag font.

Syntax

public void setTagFont( java.awt.Font font);

Parameter Description

font

The new Font for the XML Tags.

setTagForeground()

Description

Sets the Tag foreground color.

Syntax

public void setTagForeground( java.awt.Color color);

Parameter Description

color

The new Color for the XML Tags.

setXMLDocument()

Description

Associates the XMLviewer with a XML document.

Syntax

public void setXMLDocument( org.w3c.dom.Document document);

Parameter Description

document

The Document to display.


XMLSourceViewBeanInfo Class


Derscription of XMLSourceViewBeanInfo

This class provides information about the XMLSourceView Bean.


Syntax of XMLSourceViewBeanInfo

public class XMLSourceViewBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.srcviewer.XMLSourceViewBeanInfo


Implemented Interfaces of XMLSourceViewBeanInfo

java.beans.BeanInfo

Methods of XMLSourceViewBeanInfo

Table 10-25 Summary of Methods of XMLSourceViewBeanInfo  
Method Description

XMLSourceViewBeanInfo()

Class constructor.

getIcon()

Retrieves an image object representing the requested icon type for XMLSourceView bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves an array of XMLSourveView bean's editable PropertyDescriptors.

XMLSourceViewBeanInfo()

Description

Class constructor.

Syntax

public  XMLSourceViewBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for XMLSourceView bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves an array of XMLSourveView bean's editable PropertyDescriptors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

oracle.xml.transviewer Package


Description

This is a visual bean. It allows users to load XML and XSL buffers from the file system or from the database's CLOB tables. The XML buffer can be transformed using the XSL buffer. XML, XSL or HTML buffers can be saved in the file system or in the database as CLOB tables. Each CLOB table has two columns, string type to hold the filename and CLOB type to hold the file data. CLOB tables can be created or deleted. The XML and XSL buffers can be edited and parsed.

The classes of the oOracle.xml.srcviewer as summarized in Table 10-26.

Table 10-26 Summary of Classes of oracle.xml.transviewer  
Class Description

DBAccess Class

Maintains CLOB tables that can hold multiple XML and text documents.

DBAccessBeanInfo Class

This class provides information about the DBAccess Bean.

XMLTransformPanel Class

Applies XSL transformations to XML documents and visualizes the result.

XMLTransformPanelBeanInfo Class

This class provides information about the XMLTransformPanel Bean

XMLTransViewer Class

Simple application that uses XMLTransformPanel. Can be used from the command line to edit and parse XML files, edit and apply XSL transformations and retrieve and save XML, XSL and result files in the file system or in the database.


DBAccess Class


Description of DBAccess

Maintains CLOB tables that can hold multiple XML and text documents. Each table is created using the statement:

CREATE TABLE tablename FILENAME CHAR( 16) UNIQUE, FILEDATA CLOB) LOB(FILEDATA) 
STORE AS (DISABLE STORAGE IN ROW).


Syntax of DBAccess

public class DBAccess extends java.lang.Object
 
java.lang.Object
  |
  +--oracle.xml.transviewer.DBAccess


Methods of DBAccess

Table 10-27 Summary of Methods of DBAcceess  
Method Description

DBAccess()

Class constructor.

createBLOBTable()

Create BLOB table, returning TRUE if successful.

createXMLTable()

Creates XML table, returning TRUE if successful.

deleteBLOBName()

Deletes binary file from BLOB table, returning TRUE if successful.

deleteXMLName()

Delete file from XML table, returning TRUE if successful.

dropBLOBTable()

Deletes BLOB table. TRUE if successful.

dropXMLTable()

Deletes XML table. Returns TRUE if successful.

getBLOBData()

Retrieves binary file from BLOB table as a byte array. Returns TRUE if successful.

getNameSize()

Returns the size of the field where the filename is kept.

getXMLData()

Retrieves text file from XML table as a String.

getXMLNames()

Returns all file names in XML table as a String array.

getXMLTableNames()

Retrieves an array of all XML table names, starting with a user-specified string.

insertBLOBData()

Inserts binary file as a row in BLOB table. Returns TRUE if successful.

insertXMLData()

Inserts text file as a row in XML table. Returns TRUE if successful.

isXMLTable()

Checks if the table is an XML table, in which case returns TRUE.

replaceXMLData()

Replaces text file as a row in XML table, returning TRUE if successful.

xmlTableExists()

Checks if the XML table exists, returning TRUE if successful.

DBAccess()

Description

Class constructor.

Syntax

public  DBAccess();

createBLOBTable()

Description

Create BLOB table, returning TRUE if successful.

Syntax

public boolean createBLOBTable( Connection con,
                                  String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.

createXMLTable()

Description

Creates XML table, returning TRUE if successful.

Syntax

public boolean createXMLTable( Connection con,
                               String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.

deleteBLOBName()

Description

Deletes binary file from BLOB table, returning TRUE if successful.

Syntax

public boolean deleteBLOBName( java.sql.Connection con,
                                 String tableName,
                               String blobName);

Parameter Description

con

The Connection object.

tableName

The table name.

blobName

The file name.

deleteXMLName()

Description

Delete file from XML table, returning TRUE if successful.

Syntax

public boolean deleteXMLName( java.sql.Connection con,
                              String tableName,
                              String xmlName);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

dropBLOBTable()

Description

Deletes BLOB table. TRUE if successful.

Syntax

public boolean dropBLOBTable( java.sql.Connection con,
                              String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.

dropXMLTable()

Description

Deletes XML table. Returns TRUE if successful.

Syntax

public boolean dropXMLTable( java.sql.Connection con,
java.lang.String tableName);
Parameter Description

con

The Connection object.

tableName

The table name.

getBLOBData()

Description

Retrieves binary file from BLOB table as a byte array. Returns TRUE if successful.

Syntax

public byte[] getBLOBData( java.sql.Connection con,
                           String tableName,
                           String xmlName);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

getNameSize()

Description

Returns the size of the field where the filename is kept.

Syntax

public int getNameSize();

getXMLData()

Description

Retrieves text file from XML table as a String.

Syntax

public java.lang.String getXMLData( java.sql.Connection con,
                                    String tableName,
                                    String xmlName);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

getXMLNames()

Description

Returns all file names in XML table as a String array.

Syntax

public java.lang.String[] getXMLNames( java.sql.Connection con,
                                       String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.

getXMLTableNames()

Description

Retrieves an array of all XML table names, starting with a user-specified string.

Syntax

public java.lang.String[] getXMLTableNames( java.sql.Connection con,
                                            String tablePrefix);

Parameter Description

con

The Connection object.

tablePrefix

The table prefix string that starts the retrieved array of XML table names.

insertBLOBData()

Description

Inserts binary file as a row in BLOB table. Returns TRUE if successful.

Syntax

public boolean insertBLOBData( java.sql.Connection con,
                               String tableName,
                               String xmlName,
                               byte[] xmlData);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

xmlData

The byte array with file data.

insertXMLData()

Description

Inserts text file as a row in XML table. Returns TRUE if successful.

Syntax

public boolean insertXMLData( java.sql.Connection con,
                              String tableName, 
                              String xmlName,
                              String xmlData);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

xmlData

The String with file data.

isXMLTable()

Description

Checks if the table is an XML table, in which case returns TRUE.

Syntax

public boolean isXMLTable( java.sql.Connection con,
                           String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.

replaceXMLData()

Description

Replaces text file as a row in XML table, returning TRUE if successful.

Syntax

public boolean replaceXMLData( java.sql.Connection con,
                               String tableName,
                               String xmlName,
                               String xmlData);

Parameter Description

con

The Connection object.

tableName

The table name.

xmlName

The file name.

xmlData

The String with file data.

xmlTableExists()

Description

Checks if the XML table exists, returning TRUE if successful.

Syntax

public boolean xmlTableExists( java.sql.Connection con,
                               String tableName);

Parameter Description

con

The Connection object.

tableName

The table name.


DBAccessBeanInfo Class


Description of DBAccessBeanInfo

This class provides information about the DBAccess Bean.


Syntax of DBAccessBeanInfo

public class DBAccessBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.transviewer.DBAccessBeanInfo


Implemented Interfaces of DBAccessBeanInfo


Methods of DBAccessBeanInfo

Table 10-28 Summary of Methods of DBAccessBeanInfo  
Method Description

DBAccessBeanInfo()

Class constructor.

getIcon()

Retrieves an image object representing the requested icon type for DBAcceess bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves an array of DBAccess bean's editable PropertyDescriptors.

DBAccessBeanInfo()

Description

Class constructor.

Syntax

public  DBAccessBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for DBAcceess bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon(int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves an array of DBAccess bean's editable PropertyDescriptors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

XMLTransformPanel Class


Description of XMLTransformPanel

XMLTransformPanel visual bean. Applies XSL transformations to XML documents and visualizes the result. Allows editing of input XML and XSL documents and files.


Syntax of XMLTransformPanel

public class XMLTransformPanel extends javax.swing.JPanel
 
java.lang.Object
  |
  +--java.awt.Component
     |
     +--java.awt.Container
        |
        +--javax.swing.JComponent
           |
           +--javax.swing.JPanel
              |
              +--oracle.xml.transviewer.XMLTransformPanel


Implemented Interfaces of XMLTransformPanel


Methods of Description of XMLTransformPanel

XMLTransformPanel()

Description

The class constructor. Creates an object of type XMLTransformPanel.

Syntax

public  XMLTransformPanel();

XMLTransformPanelBeanInfo Class


Description of XMLTransformPanelBeanInfo

This class provides information about the XMLTransformPanel Bean.


Syntax of XMLTransformPanelBeanInfo

public class XMLTransformPanelBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.transviewer.XMLTransformPanelBeanInfo


Implemented Interfaces of XMLTransformPanelBeanInfo


Methods of XMLTransformPanelBeanInfo

Table 10-29 Summary of Methods of XMLTransformPanelBeanInfo  
Method Description

XMLTransformPanelBeanInfo()

Class constructor.

getIcon()

Retrieves an image object representing the requested icon type for XMLTransformPanel bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves an array of XMLTransformPanel bean's editable PropertyDescriptors.

XMLTransformPanelBeanInfo()

Description

Class constructor.

Syntax

public  XMLTransformPanelBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for XMLTransformPanel bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves an array of XMLTransformPanel bean's editable PropertyDescriptors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

XMLTransViewer Class


Description of XMLTransViewer

Simple application that uses XMLTransformPanel. Can be used from the command line to edit and parse XML files, edit and apply XSL transformations and retrieve and save XML, XSL and result files in the file system or in the database.


Syntax of XMLTransViewer

public class XMLTransViewer extends java.lang.Object
 
java.lang.Object
  |
  +--oracle.xml.transviewer.XMLTransViewer


Methods of XMLTransViewer

Table 10-30 Summary of Methods of XMLTransViewer  
Method Description

XMLTransViewer()

Class constructor

getReleaseVersion()

Returns the release version of the Oracle XML Transviewer, as a String.

main()

Starts a new XMLTransViewer.

XMLTransViewer()

Description

Class constructor

Syntax

public  XMLTransViewer();

getReleaseVersion()

Description

Returns the release version of the Oracle XML Transviewer, as a String.

Syntax

public static java.lang.String getReleaseVersion();

main()

Description

The main function which starts a new XMLTransViewer.

Syntax

public static void main( String[] args);

Parameter Description

args

Arguments of an XMLTransViewer instance.


oracle.xml.treeviewer Package


Description

This is a visual bean. It displays XML documents as a tree, illustrating the DOM tree structure of a XML document. The user can collapse or expand the nodes.

The classes of the oOracle.xml.treeviewer as summarized in Table 10-31.

Table 10-31 Summary of Classes of oracle.xml.transviewer  
Class Description

XMLTreeView Class

Shows an XML document as a tree.

XMLTreeViewBeanInfo Class

This class provides information about the XMLTreeView Bean.


XMLTreeView Class


Description of XMLTreeView

Shows an XML document as a tree. Recognizes the following XML DOM nodes: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Takes as input an org.w3c.dom.Document object.


Syntax of XMLTreeView

public class XMLTreeView extends javax.swing.JPanel
 
java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--oracle.xml.treeviewer.XMLTreeView


Implemented Interfaces of XMLTreeView

javax.accessibility.Accessible, java.awt.image.ImageObserver, 
java.awt.MenuContainer, java.io.Serializable

Fields of XMLTreeView of XMLTreeView

Table 10-32 Fields of XMLTreeView  
Field Syntax Description

model

protected

oracle.xml.treeviewer.XMLTreeModel model

Data model for JTree using information from DOM nodes.

scrollPane

protected transient

javax.swing.JScrollPane scrollPane

Container used to display the Tree. Supports horizontal and vertical scrolling.

theTree

protected transient

javax.swing.JTree theTree

Java component to render the various nodes of the DOM Tree.


Methods of XMLTreeView

Table 10-33 Summary of Methods of XMLTreeView  
Method Description

XMLTreeView()

The class constructor.

getPreferredSize()

Returns the XMLTreeView preferred size.

getTree()

Returns the visual tree as a JTree.

getXMLTreeModel()

Returns the datamodel for JTree as XMLTreeModel.

setXMLDocument()

Associates the XMLTreeViewer with a XML document.

updateUI()

Forces the XMLTreeView to update/refresh UI.

XMLTreeView()

Description

The class constructor. Creates an object of type XMLTreeView.

Syntax

public  XMLTreeView();

getPreferredSize()

Description

Returns the Dimension object containing the XMLTreeView preferred size. Overrides getPreferredSize() in javax.swing.JComponent class.

Syntax

public java.awt.Dimension getPreferredSize();

getTree()

Description

Returns the visual tree as a JTree.

Syntax

protected javax.swing.JTree getTree();

getXMLTreeModel()

Description

Returns the datamodel for JTree as XMLTreeModel.

Syntax

protected oracle.xml.treeviewer.XMLTreeModel getXMLTreeModel();

setXMLDocument()

Description

Associates the XMLTreeViewer with a XML document.

Syntax

public void setXMLDocument( org.w3c.dom.Document document);

Parameter Description

doc

The Document to display.

updateUI()

Description

Forces the XMLTreeView to update/refresh UI.

Syntax

public void updateUI();

XMLTreeViewBeanInfo Class


Description of XMLTreeViewBeanInfo

This class provides information about the XMLTreeView Bean.


Syntax of XMLTreeViewBeanInfo

public class XMLTreeViewBeanInfo extends java.beans.SimpleBeanInfo
 
java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.treeviewer.XMLTreeViewBeanInfo


Implemented Interfaces of XMLTreeViewBeanInfo

java.beans.BeanInfo

Methods of XMLTreeViewBeanInfo

Table 10-34 Summary of Methods of XMLTreeViewBeanInfo  
Method Description

XMLTreeViewBeanInfo()

Class constructor.

getIcon()

Retrieves an image object representing the requested icon type for XMLTreeView bean in toolbars, toolboxes, and so on.

getPropertyDescriptors()

Retrieves an array of XMLTreeViewl bean's editable PropertyDescriptors.

XMLTreeViewBeanInfo()

Description

Class constructor.

Syntax

public  XMLTreeViewBeanInfo();

getIcon()

Description

Retrieves an image object representing the requested icon type for XMLTreeView bean in toolbars, toolboxes, and so on.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.

getPropertyDescriptors()

Description

Retrieves an array of XMLTreeViewl bean's editable PropertyDescriptors.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

oracle.xml.differ Package


Description

The oracle.xml.differ is a non-visual bean with a visual demo. It enables comparisons of two XML documents and generation of the differences as XSLT code. The XSLT can be applied to the first file to transform it into the second file. The visual demo enables the user to view the differences between the two XML documents graphically.

The classes of the oOracle.xml.differ as summarized in Table 10-35.

Table 10-35 Summary of Classes of oracle.xml.differ  
Class Description

XMLDiff Class

Defines an interface for comparing two XML files.

XMLDiffBeanInfo Class

This class provides information about the XMLDiff Bean.


XMLDiff Class


Description of XMLDiff

Defines an interface for comparing two XML files. It enables two XML files to be compared to check for their equivalence. It provides the objects to display the differences, if any, in a graphical format. The differences can also be represented as XSL. The corresponding XSL stylesheet with the differences can be generated as a file or an XMLDocument object. The first XML file can be transformed into the second XML file by using the XSL stylesheet generated.


Syntax of XMLDiff

oracle.xml.differ

java.lang.Object
  |
  +--oracle.xml.differ.XMLDiff


Implemented Interfaces of XMLDiff


Methods of XMLDiff

Table 10-36 Summer of Methods of XMLDiff  
Method Description

XMLDiff()

Class constructor.

setFiles()

Sets the XML files which need to be compared.

setDocuments()

Sets the XML documents which need to be compared.

setInput1()

Sets the first XML file or document which need to be compared.

setInput2()

Sets the second XML file or document which need to be compared.

getDocument1()

Gets the document root as an XMLDocument object of the first XML tree.

getDocument2()

Gets the document root as an XMLDocument object of the second XML tree.

diff()

Finds the differences between the two XML files or the two XMLDocument objects. Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.

getDiffPane1()

Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.

getDiffPane2()

Retrieves the visual text panel as JTextPane object which visually shows the differences in the second XML file or document.

setIndentIncr()

Sets the indentation for the XSL generation.

setNewNodeIndentIncr()

Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files.

generateXSLFile()

Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files.

generateXSLDOC()

Generates an XSL stylesheet as an XMLDocument which represents the differences between the two initially set XML documents.

equals()

Compares two nodes. It is called by the differ algorithm. If needed, this function can be overwritten for customized comparisons.

domBuilderErrorCalled()

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser when there is an error while parsing.

domBuilderError()

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser.

domBuilderOver()

Method implementing DOMBuilderListener interface called only by a DOM parser thread when parsing completes.

domBuilderStarted()

Method implementing DOMBuilderListener interface called only by the DOM parser when the parsing starts.

printDiffTree()

Prints the differences tree which contains the node names and values which have been identified as differences by the algorithm. Useful for debugging.

setNoMoves()

Assume that there are no moves to be detected by the diff algorithm. This function should be called before the diff() function. It will result in a performance gain.

XMLDiff()

Description

Class constructor.

Syntax

public XMLDiff();

setFiles()

Description

Sets the XML files which need to be compared. Both files are parsed into DOM trees for comparison. This is faster than calling setInput1() and setInput2(). Throws the following exceptions:

Syntax

public void setFiles( java.io.File file1,
                      java.io.File file2);

Parameter Description

file1

First XML file.

file2

Second XML file.

setDocuments()

Description

Sets the XML documents which need to be compared.

Syntax

public void setDocuments( XMLDocument doc1,
                          XMLDocument doc2);

Parameter Description

doc1

First XML document.

setInput1()

Description

Sets the first XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:

The options are described in the following table.

Syntax Description

public void setInput1(

File file1);

Sets the first XML file which needs to be compared.

public void setInput1(

XMLDocument doc1);

Sets the first XML document which needs to be compared.


Parameter Description

file1

The first XML file.

doc1

The first XML document.

setInput2()

Description

Sets the second XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:

The options are described in the following table.

Syntax Description

public void setInput2(

File file2);

Sets the second XML file which needs to be compared.

public void setInput2(

XMLDocument doc2);

Sets the second XML document which needs to be compared.


Parameter Description

file2

The second XML file.

doc2

The second XML document.

getDocument1()

Description

Gets the document root as an XMLDocument object of the first XML tree.

Syntax

public XMLDocument getDocument1();

getDocument2()

Description

Gets the document root as an XMLDocument object of the second XML tree.

Syntax

public XMLDocument getDocument2();

diff()

Description

Finds the differences between the two XML files or the two XMLDocument objects. Returns FALSE if the XML files or docs are same, TRUE if they are different. Throws java.lang.NullPointerException when XML files are not parsed successfully, or if xml documents have not been set.

Syntax

public boolean diff();

getDiffPane1()

Description

Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.

Syntax

public javax.swing.JTextPane getDiffPane1();

getDiffPane2()

Description

Retrieves the visual text panel as JTextPane object which visually shows the differences in the second XML file or document.

Syntax

public javax.swing.JTextPane getDiffPane2();

setIndentIncr()

Description

Sets the indentation for the XSL generation. This should be called before the generateXSLFile() or generateXSLDoc(). The indentation will be applied to all attributes only. For indenting newly inserted nodes, see setNewNodeIndentIncr().

Syntax

public void setIndentIncr( int spaces);

Parameter Description

spaces

Indentation increment in number of spaces for attributes.

setNewNodeIndentIncr()

Description

Sets the indentation for the XSL generation. This should be called before the generateXSLFile() or generateXSLDoc(). The indentation will be applied to all newly inserted nodes only. For attributes indentation support, see setIndentIncr().

Syntax

public void setNewNodeIndentIncr( int spaces);

Parameter Description

spaces

Indentation increment in number of spaces for new nodes.

generateXSLFile()

Description

Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files. If the input filename is NULL, a default XSL file named XMLDiff.xsl will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws java.io.IOException if the XSL file is not created successfully.

Syntax

public void generateXSLFile( String fileName);

Parameter Description

fileName

Output XSL file name.

generateXSLDOC()

Description

Generates an XSL stylesheet as an XMLDocument which represents the differences between the two initially set XML documents. If the input filename is NULL, a default XSL file named XMLDiff.xsl will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws the following exceptions:

Syntax

public void generateXSLDoc();

equals()

Description

Compares two nodes. It is called by the differ algorithm. If needed, this function can be overwritten for customized comparisons.

Syntax

protected boolean equals( Node node1,
                          Node node2);

Parameter Description

node1

The first node to compare.

node2

The second node to compare.

domBuilderErrorCalled()

Description

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser when there is an error while parsing. Specified by domBuilderErrorCalled in DOMBuilderErrorListener Interface.

Syntax

public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);

Parameter Description

p0

Error object thrown by the parser.

domBuilderError()

Description

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser. Specified by domBuilderError in DOMBuilderListener interface.

Syntax

public void domBuilderError( DOMBuilderEvent p0);

Parameter Description

p0

Parser event errors handled by domBuilderErrorCalled().

domBuilderOver()

Description

Method implementing DOMBuilderListener interface called only by a DOM parser thread when parsing completes. Specified by domBuilderOver in DOMBuilderListener interface

Syntax

public void domBuilderOver ( DOMBuilderEvent p0);

Parameter Description

p0

Parser event.

domBuilderStarted()

Description

Method implementing DOMBuilderListener interface called only by the DOM parser when the parsing starts. Specified by domBuilderStarted in DOMBuilderListener interface.

Syntax

public void domBuilderStarted( DOMBuilderEvent p0);

Parameter Description

p0

Parser event.

printDiffTree()

Description

Prints the diff tree which contains the node names and values which have been identified as different by the algorithm. Useful for debugging. Throws java.io.IOException if the XSL file is not created successfully.

Syntax

public void printDiffTree( int tree,
                           BufferedWriter out);

Parameter Description

tree

The tree to print, 1 or 2.

out

The BufferredWriter containing the printed diff tree.

setNoMoves()

Description

Assume that there are no moves to be detected by the diff algorithm. This function should be called before the diff() function. It will result in a performance gain.

Syntax

public void setNoMoves();

XMLDiffBeanInfo Class


Description of XMLDiffBeanInfo

This class provides information about the XMLDiff Bean.


Syntax of XMLDiffBeanInfo

public class XMLDiffBeanInfo extends java.beans.SimpleBeanInfo

XMLSjava.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--oracle.xml.differ.XMLDiffBeanInfo


Methods of XMLDiffBeanInfo

Table 10-37 Summary of Methods of XMLDiffBeanInfo  
Method Description

XMLDiffBeanInfo()

Class constructor.

getPropertyDescriptors()

Retrieves an image object representing the requested icon type for XMLDiff bean in toolbars, toolboxes, and so on.

getIcon()

Retrieves an array of XMLDiff bean's editable PropertyDescriptors

XMLDiffBeanInfo()

Description

Class constructor.

Syntax

public XMLDiffBeanInfo();

getPropertyDescriptors()

Description

Retrieves an array of XMLDiff bean's editable PropertyDescriptors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.

Syntax

public java.beans.PropertyDescriptor[] getPropertyDescriptors();

getIcon()

Description

Retrieves an image object representing the requested icon type for XMLDiff bean in toolbars, toolboxes, and so on. Overrides getIcon() in java.beans.SimpleBeanInfo class.

Syntax

public java.awt.Image getIcon( int iconKind);

Parameter Description

iconKind

The kind of icon requested.


Go to previous page Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback