Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.xml
Class XMLUtils

java.lang.Object
  |
  +--oracle.cabo.share.xml.XMLUtils

public class XMLUtils
extends java.lang.Object

Utility class for XML parsing.


Field Summary
static java.lang.String APACHE_PROVIDER
          Constant for the class name of the Apache XML Provider.
static java.lang.String ORACLE_PROVIDER
          Constant for the class name of the Oracle XML Provider.
 
Method Summary
static InputStreamProvider getInputStreamProvider(ParseContext context)
          Gets the InputStreamProvider stored on the ParseContext.
static java.lang.Object getLocalProperty(ParseContext context, java.lang.String namespace, java.lang.Object key)
          Gets a "local" ParseContext property.
static NameResolver getResolver(ParseContext context)
          Gets the NameResolver stored on the ParseContext.
static XMLProvider getXMLProvider(Configuration config, ErrorLog log)
          Convenience object for getting an XML provider off a Configuration object.
static java.lang.Object parseInclude(ParseContext context, java.lang.String sourceName, java.lang.Class expectedType)
          Parses an include of an XML file.
static java.lang.String[] parseNameTokens(java.lang.String stringValue)
          Parses a whitespace separated series of name tokens.
static java.lang.Object parseSource(ParseContext context, XMLProvider xmlProvider, ParserManager manager, NameResolver resolver, java.lang.String sourceName, java.lang.Class expectedType)
          Parses an XML file.
static void setInputStreamProvider(ParseContext context, InputStreamProvider provider)
          Stores a InputStreamProvider on a ParseContext.
static void setLocalProperty(ParseContext context, java.lang.String namespace, java.lang.Object key, java.lang.Object value)
          Sets a "local" ParseContext property.
static void setResolver(ParseContext context, NameResolver source)
          Stores a NameResolver on a ParseContext.
static void setXMLProvider(ConfigurationImpl config, java.lang.String providerClassName)
          Convenience function for setting an XML provider on a configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORACLE_PROVIDER

public static final java.lang.String ORACLE_PROVIDER
Constant for the class name of the Oracle XML Provider.

APACHE_PROVIDER

public static final java.lang.String APACHE_PROVIDER
Constant for the class name of the Apache XML Provider.
Method Detail

parseSource

public static java.lang.Object parseSource(ParseContext context,
                                           XMLProvider xmlProvider,
                                           ParserManager manager,
                                           NameResolver resolver,
                                           java.lang.String sourceName,
                                           java.lang.Class expectedType)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException
Parses an XML file. For includes, see parseInclude().
Parameters:
context - the current ParseContext, which will be cloned
xmlProvider - an XML provider
manager - a ParserManager
resolver - a NameResolver to locate the target
sourceName - the name of the target, relative to the current file
expectedType - the expected Java type of the target.

parseInclude

public static java.lang.Object parseInclude(ParseContext context,
                                            java.lang.String sourceName,
                                            java.lang.Class expectedType)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException
Parses an include of an XML file. The include will be located using an already-stored NameResolver object.
Parameters:
context - the current ParseContext, which will be cloned
sourceName - the name of the target, relative to the current file
expectedType - the expected Java type of the target.
See Also:
getResolver(oracle.cabo.share.xml.ParseContext), setResolver(oracle.cabo.share.xml.ParseContext, oracle.cabo.share.io.NameResolver)

getResolver

public static NameResolver getResolver(ParseContext context)
Gets the NameResolver stored on the ParseContext.

setResolver

public static void setResolver(ParseContext context,
                               NameResolver source)
Stores a NameResolver on a ParseContext.

getInputStreamProvider

public static InputStreamProvider getInputStreamProvider(ParseContext context)
Gets the InputStreamProvider stored on the ParseContext.

setInputStreamProvider

public static void setInputStreamProvider(ParseContext context,
                                          InputStreamProvider provider)
Stores a InputStreamProvider on a ParseContext.

setXMLProvider

public static void setXMLProvider(ConfigurationImpl config,
                                  java.lang.String providerClassName)
Convenience function for setting an XML provider on a configuration.

setLocalProperty

public static void setLocalProperty(ParseContext context,
                                    java.lang.String namespace,
                                    java.lang.Object key,
                                    java.lang.Object value)
Sets a "local" ParseContext property. ParseContext properties set with the standard setProperty() method will still be available in included files, and if set inside an included file will be available to the parent file. Local properties are available to this document only.
See Also:
getLocalProperty(oracle.cabo.share.xml.ParseContext, java.lang.String, java.lang.Object)

getLocalProperty

public static java.lang.Object getLocalProperty(ParseContext context,
                                                java.lang.String namespace,
                                                java.lang.Object key)
Gets a "local" ParseContext property. ParseContext properties set with the standard setProperty() method will still be available in included files, and if set inside an included file will be available to the parent file. Local properties are available to this document only.
See Also:
setLocalProperty(oracle.cabo.share.xml.ParseContext, java.lang.String, java.lang.Object, java.lang.Object)

getXMLProvider

public static XMLProvider getXMLProvider(Configuration config,
                                         ErrorLog log)
Convenience object for getting an XML provider off a Configuration object.
Parameters:
config - the configuration object
log - an (optional) error log
Returns:
an XMLProvider implementation

parseNameTokens

public static java.lang.String[] parseNameTokens(java.lang.String stringValue)
Parses a whitespace separated series of name tokens.
Parameters:
stringValue - the full string
Returns:
an array of each constituent value, or null if there are no tokens (that is, the string is empty or all whitespace)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.