API

com.ibm.xml.xapi
Interface XCompilationFactory


public interface XCompilationFactory

Factory for compiling expressions, queries and stylesheets into Java classes. Load methods are provided for loading the compiled java classes and instantiating the executable. Compiling the expression, query or stylesheet ahead of time means that the cost of preparation can be avoided during the application runtime. The getCompilationFactory method on XFactory can be used to get an XCompilationFactory instance.

See Also:
XFactory.getCompilationFactory()

Method Summary
 boolean compileXPath(StreamSource expression, XCompilationParameters parameters)
          Compile an XPath expression into Java classes.
 boolean compileXPath(StreamSource expression, XStaticContext context, XCompilationParameters parameters)
          Compile an XPath expression into Java classes.
 boolean compileXPath(String expression, XCompilationParameters parameters)
          Compile an XPath expression into Java classes.
 boolean compileXPath(String expression, XStaticContext context, XCompilationParameters parameters)
          Compile an XPath expression into Java classes.
 boolean compileXQuery(StreamSource query, XCompilationParameters parameters)
          Compile an XQuery expression into Java classes.
 boolean compileXQuery(StreamSource query, XStaticContext context, XCompilationParameters parameters)
          Compile an XQuery expression into Java classes.
 boolean compileXQuery(String query, XCompilationParameters parameters)
          Compile an XQuery expression into Java classes.
 boolean compileXQuery(String query, XStaticContext context, XCompilationParameters parameters)
          Compile an XQuery expression into Java classes.
 boolean compileXSLT(StreamSource stylesheet, XCompilationParameters parameters)
          Compile an XSL stylesheet into Java classes.
 boolean compileXSLT(StreamSource stylesheet, XStaticContext context, XCompilationParameters parameters)
          Compile an XSL stylesheet into Java classes.
 XPathExecutable loadXPath(XCompilationParameters parameters)
          Load the compiled XPath expression classes and return an XPathExecutable object.
 XQueryExecutable loadXQuery(XCompilationParameters parameters)
          Load the compiled XQuery expression classes and return an XQueryExecutable object.
 XSLTExecutable loadXSLT(XCompilationParameters parameters)
          Load the compiled XSL stylesheet classes and return an XSLTransformExecutable object.
 XCompilationParameters newCompilationParameters(String className)
          Create a new XCompilationParameters object.
 

Method Detail

compileXPath

boolean compileXPath(String expression,
                     XCompilationParameters parameters)
Compile an XPath expression into Java classes. The default static context settings are used.

Parameters:
expression - The XPath expression as a String.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:
newCompilationParameters(String)

compileXPath

boolean compileXPath(String expression,
                     XStaticContext context,
                     XCompilationParameters parameters)
Compile an XPath expression into Java classes.

Parameters:
expression - The XPath expression as a String.
context - The static context.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:
newCompilationParameters(String)

compileXPath

boolean compileXPath(StreamSource expression,
                     XCompilationParameters parameters)
Compile an XPath expression into Java classes. The default static context settings are used.

Parameters:
expression - The XPath expression as a StreamSource.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:
newCompilationParameters(String)

compileXPath

boolean compileXPath(StreamSource expression,
                     XStaticContext context,
                     XCompilationParameters parameters)
Compile an XPath expression into Java classes.

Parameters:
expression - The XPath expression as a StreamSource.
context - The static context.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:
newCompilationParameters(String)

loadXPath

XPathExecutable loadXPath(XCompilationParameters parameters)
Load the compiled XPath expression classes and return an XPathExecutable object.

Parameters:
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
An XPathExecutable object for the compiled XPath expression.
Throws:
XProcessException - if the compiled expression cannot be loaded.
See Also:
newCompilationParameters(String)

compileXQuery

boolean compileXQuery(String query,
                      XCompilationParameters parameters)
Compile an XQuery expression into Java classes. The default static context settings are used.

Parameters:
query - The XQuery expression as a String.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:
newCompilationParameters(String)

compileXQuery

boolean compileXQuery(String query,
                      XStaticContext context,
                      XCompilationParameters parameters)
Compile an XQuery expression into Java classes.

Parameters:
query - The XQuery expression as an String.
context - The static context.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:
newCompilationParameters(String)

compileXQuery

boolean compileXQuery(StreamSource query,
                      XCompilationParameters parameters)
Compile an XQuery expression into Java classes. The default static context settings are used.

Parameters:
query - The XQuery expression as a StreamSource.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:
newCompilationParameters(String)

compileXQuery

boolean compileXQuery(StreamSource query,
                      XStaticContext context,
                      XCompilationParameters parameters)
Compile an XQuery expression into Java classes.

Parameters:
query - The XQuery expression as an StreamSource.
context - The static context.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:
newCompilationParameters(String)

loadXQuery

XQueryExecutable loadXQuery(XCompilationParameters parameters)
Load the compiled XQuery expression classes and return an XQueryExecutable object.

Parameters:
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
An XQueryExecutable object for the compiled XQuery expression.
Throws:
XProcessException - if the compiled query cannot be loaded.
See Also:
newCompilationParameters(String)

compileXSLT

boolean compileXSLT(StreamSource stylesheet,
                    XCompilationParameters parameters)
Compile an XSL stylesheet into Java classes. The default static context is used.

Parameters:
stylesheet - The XSL stylesheet as an StreamSource.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the stylesheet is null.
XProcessException - if the compile fails because of errors in the stylesheet.
See Also:
newCompilationParameters(String)

compileXSLT

boolean compileXSLT(StreamSource stylesheet,
                    XStaticContext context,
                    XCompilationParameters parameters)
Compile an XSL stylesheet into Java classes.

Parameters:
stylesheet - The XSL stylesheet as an StreamSource.
context - The static context.
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
True if the compilation was successful, false otherwise.
Throws:
NullPointerException - if the stylesheet is null.
XProcessException - if the compile fails because of errors in the stylesheet.
See Also:
newCompilationParameters(String)

loadXSLT

XSLTExecutable loadXSLT(XCompilationParameters parameters)
Load the compiled XSL stylesheet classes and return an XSLTransformExecutable object.

Parameters:
parameters - The compilation parameters. Use newCompilationParameters to create a new XCompilationParameters object.
Returns:
An XSLTransformExecutable object for the compiled XSL stylesheet.
Throws:
XProcessException - if the compiled stylesheet cannot be loaded.
See Also:
newCompilationParameters(String)

newCompilationParameters

XCompilationParameters newCompilationParameters(String className)
Create a new XCompilationParameters object. Used to specify compile and load parameters such as the class name and package name for the generated classes. The class name is required.

Parameters:
className - The class name to use for the generated classes. Must be a valid Java class name.
Returns:
A new XCompilationParameters object.
Throws:
NullPointerException - if className is null.

IBM Copyright 2004-2008