UIX 2.2.16

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 DEFAULT_PROVIDER
          Constant for the class name of the Default XML Provider.
static java.lang.String ORACLE_PROVIDER
          Constant for the class name of the Oracle XML Provider.
 
Method Summary
static ApplicationConfiguration getApplicationConfiguration(ParseContext context)
          Gets the ApplicationConfiguration stored on the ParseContext.
static ExpressionParser getDefaultExpressionParser(ApplicationConfiguration appConfig, ParserManager pManager)
          gets the default binding parser.
static ExpressionParser getDefaultExpressionParser(ParseContext context)
          gets the default ExpressionParser, to use for the current file.
static ExpressionParser getExpressionParser(ParseContext context)
          gets the current binding parser to use from the context
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 registerFunctions(ParserManager manager, java.lang.String namespace, java.lang.Class klass)
          add the methods of a class to the list of available EL functions.
static void setApplicationConfiguration(ParseContext context, ApplicationConfiguration source)
          Stores an ApplicationConfiguration on a ParseContext.
static void setDefaultExpressionParser(ParseContext context, ExpressionParser parser)
          sets the default ExpressionParser to use for the current file
static ExpressionParser setExpressionParser(ParseContext context, java.lang.String expressionLanguage)
          sets a new ExpressionParser.
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

DEFAULT_PROVIDER

public static final java.lang.String DEFAULT_PROVIDER
Constant for the class name of the Default XML Provider.

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)

getApplicationConfiguration

public static ApplicationConfiguration getApplicationConfiguration(ParseContext context)
Gets the ApplicationConfiguration stored on the ParseContext.

setApplicationConfiguration

public static void setApplicationConfiguration(ParseContext context,
                                               ApplicationConfiguration source)
Stores an ApplicationConfiguration on a ParseContext.

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)

registerFunctions

public static void registerFunctions(ParserManager manager,
                                     java.lang.String namespace,
                                     java.lang.Class klass)
add the methods of a class to the list of available EL functions.
Parameters:
namespace - the namespace to register the methods under
klass - only the public static methods declared on this class are inspected

setExpressionParser

public static ExpressionParser setExpressionParser(ParseContext context,
                                                   java.lang.String expressionLanguage)
sets a new ExpressionParser. this parser is only valid for the current page

getExpressionParser

public static ExpressionParser getExpressionParser(ParseContext context)
gets the current binding parser to use from the context

getDefaultExpressionParser

public static ExpressionParser getDefaultExpressionParser(ApplicationConfiguration appConfig,
                                                          ParserManager pManager)
gets the default binding parser. This might be specified in the ApplicationConfiguration file

getDefaultExpressionParser

public static ExpressionParser getDefaultExpressionParser(ParseContext context)
gets the default ExpressionParser, to use for the current file. The default can be set using setDefaultExpressionParser(oracle.cabo.share.xml.ParseContext, oracle.cabo.share.expl.ExpressionParser). If it is not explicitly set the ExpressionParser returned by getDefaultExpressionParser(ApplicationConfiguration, ParserManager) is used.

setDefaultExpressionParser

public static void setDefaultExpressionParser(ParseContext context,
                                              ExpressionParser parser)
sets the default ExpressionParser to use for the current file

UIX 2.2.16