| Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
Oracle XML JavaBeans are synonymous with the following packages:
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.
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.
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
Creates a new parser object. The options are described in the following table.
| Syntax | Description |
|---|---|
|
public DOMBuilder(); |
Creates a new parser object. |
|
int id); |
Creates a new parser object with a given id. |
| Parameter | Description |
|---|---|
|
id |
The DOMBuilder id. |
Adds DOMBuilderErrorListener.
public void addDOMBuilderErrorListener( DOMBuilderErrorListener p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderErrorListener to add. |
Adds DOMBuilderListener
public void addDOMBuilderListener(DOMBuilderListener p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderListener to add. |
Gets the DTD.
public synchronized oracle.xml.async.DTD getDoctype();
Gets the document for parsing.
public synchronized oracle.xml.async.XMLDocument getDocument();
Returns the parser object id (DOMBuilder).
public int getId();
Returns the release version of the Oracle XML Parser, as a String.
public synchronized java.lang.String getReleaseVersion();
Gets the document being parsed.
public synchronized org.w3c.dom.Document getResult();
Returns the validation mode; TRUE if XML parser is validating, FALSE otherwise.
public synchronized boolean getValidationMode()
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.
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.
Removes DOMBuilderErrorListener.
public synchronized void removeDOMBuilderErrorListener( DOMBuilderErrorListener p0);
| Parameter | Description |
|---|---|
|
po |
The DOMBuilderErrorListener to remove. |
Removes DOMBuilderListener.
public synchronized void removeDOMBuilderListener( DOMBuilderListener p0);
| Parameter | Description |
|---|---|
|
p1 |
The DOMBuilderListener to remove. |
This method runs in a thread. It is specified in java.lang.Runnable.run() in interface java.lang.Runnable.
public void run();
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.
public synchronized void setBaseURL( java.net.URL url);
| Parameter | Description |
|---|---|
|
url |
The base URL. |
Sets a flag to turn on debug information in the document.
public void setDebugMode(boolean flag);
| Parameter | Description |
|---|---|
|
flag |
Determines whether debug information is stored; |
Sets the DTD.
public synchronized void setDoctype(oracle.xml.async.DTD dtd)
| Parameter | Description |
|---|---|
|
dtd |
The DTD to set and use while parsing. |
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.
| Parameter | Description |
|---|---|
|
out |
The the output for errors and warnings. |
|
enc |
The encoding to use. |
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. |
public synchronized void setNodeFactory( oracle.xml.async.NodeFactory factory);
| Parameter | Description |
|---|---|
|
factory |
The NodeFactory to set. |
Sets the white space preservation mode.
public synchronized void setPreserveWhitespace( boolean flag);
| Parameter | Description |
|---|---|
|
flag |
The preserving mode; |
Sets the validation mode.
public synchronized void setValidationMode(boolean yes);
| Parameter | Description |
|---|---|
|
yes |
Determines whether the XML parser should be validating; |
Determines whether to print warnings.
public synchronized void showWarnings(boolean yes);
| Parameter | Description |
|---|---|
|
yes |
Switch; |
This class provides information about the DOMBuilder Bean.
public class DOMBuilderBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.async.DOMBuilderBeanInfo
The default constructor.
public DOMBuilderBeanInfo();
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.
public java.awt.Image getIcon( int iconKind);
| Parameter | Description |
|---|---|
|
iconKind |
The kind of icon requested. |
Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors. Overrides getPropertyDescriptors() in java.beans.SimpleBeanInfo Class.
public java.beans.PropertyDescriptor[] getPropertyDescriptors();
This class defines the error event which is sent when parse exception occurs.
public class DOMBuilderErrorEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.DOMBuilderErrorEvent
| Field | Syntax | Description |
|---|---|---|
|
|
protected java.lang.Exception |
The exception being raised. |
| Method | Description |
|---|---|
|
Constructor for DOMBuilderErrorEvent. |
|
|
Retrieves the exception being raised. |
|
|
Returns the error message generated by the parser. |
Constructor for DOMBuilderErrorEvent.
public DOMBuilderErrorEvent( Object p0, Exception e);
| Parameter | Description |
|---|---|
|
p0 |
The Object that created this error event. |
|
e |
The Exception being raised. |
Retrieves the exception being raised.
public java.lang.Exception getException();
Returns the error message generated by the parser, as a String.
public java.lang.String getMessage();
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.
public interface DOMBuilderErrorListener extends java.util.EventListener
This method is called when a parse error occurs.
public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderErrorEvent object produced by the DOMBuilder as result of parsing error. |
The event object that DOMBuilder uses to notify all registered listeners about parse events.
public class DOMBuilderEvent extends java.util.EventObject java.lang.Object | +--java.util.EventObject | +--oracle.xml.async.DOMBuilderEvent
| Field | Syntax | Description |
|---|---|---|
|
id |
protected int id |
ID of the source DOMBuilder object |
| Method | Description |
|---|---|
|
Creates a new DOMBuilderEvent. |
|
|
Returns unique id of the source DOMBuilder for the event. |
Creates a new DOMBuilderEvent.
public DOMBuilderEvent( Object p0, int p1);
| Parameter | Description |
|---|---|
|
p0 |
The Object creating this event. |
|
p1 |
Id of the DOMBuilder creating this event. |
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.
public int getID();
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.
public interface DOMBuilderListener extends java.util.EventListener
| Method | Description |
|---|---|
|
This method is called when parse error occur. |
|
|
This method is called when the parse is complete. |
|
|
This method is called when parse starts |
This method is called when parse error occur.
public void domBuilderError( DOMBuilderEvent p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
This method is called when the parse is complete.
public void domBuilderOver( DOMBuilderEvent p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
This method is called when parse starts.
public void domBuilderStarted( DOMBuilderEvent p0);
| Parameter | Description |
|---|---|
|
p0 |
The DOMBuilderEvent object produced by the DOMBuilder. |
Implements a semaphore and maintains access to a fixed number of logical resources.
public class ResourceManager extends java.lang.Object java.lang.Object | +--oracle.xml.async.ResourceManager
The ResourceManager constructor.
public ResourceManager(int i);
| Parameter | Description |
|---|---|
|
i |
The number of resources to manage. |
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.
public boolean activeFound();
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.
public synchronized void getResource();
Releases a resource. When this method is called, the number of resources available is increased by one.
public void releaseResource();
Allows use of Thread.sleep() without try/catch.
public void sleep(int i);
| Parameter | Description |
|---|---|
|
i |
The number of resources to manage. |
Applies XSL transformation in a background thread.
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
XSLTransformer constructor. The options are described in the following table.
| Syntax | Description |
|---|---|
|
public XSLTransformer(); |
XSLTransformer constructor. |
|
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 |
Adds an XSLTransformerErrortListener.
public void addXSLTransformerErrorListener( XSLTransformerErrorListerner p0);
| Parameter | Description |
|---|---|
|
p0 |
XSLTransformerErrorListener to be added. |
Adds a XSLTransformerListener.
public void addXSLTransformerListener( XSLTransformerListerner p0);
| Parameter | Description |
|---|---|
|
p0 |
XSLTransformerListener to be added. |
Returns the unique XSLTransformer id.
public int getId();
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.
public synchronized oracle.xml.async.DocumentFragment getResult();
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.
Removes an XSLTransformerErrorListener.
public synchronized void removeDOMTransformerErrorListener( XSLTransformerErrorListener p0);
| Parameter | Description |
|---|---|
|
p0 |
The XSLTransformerErrorListener to be removed. |
Removes a XSLTransformerListener.
public synchronized void removeXSLTransformerListener( XSLTransformerListener p0);
| Parameter | Description |
|---|---|
|
p0 |
The XSLTransformerListener to be removed. |
Starts a separate thread to perform the XSLTransformation. Specified by java.lang.Runnable.run() in java.lang.Runnable Interface.
public void run();