com.ibm.xml.xapi

Interface XCompilationFactory


  1. 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

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

Method Detail

compileXPath

  1. boolean compileXPath(java.lang.String expression,
  2. 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:
java.lang.NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:

compileXPath

  1. boolean compileXPath(java.lang.String expression,
  2. XStaticContext context,
  3. 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:
java.lang.NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:

compileXPath

  1. boolean compileXPath(javax.xml.transform.stream.StreamSource expression,
  2. 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:
java.lang.NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:

compileXPath

  1. boolean compileXPath(javax.xml.transform.stream.StreamSource expression,
  2. XStaticContext context,
  3. 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:
java.lang.NullPointerException - if the expression is null.
XProcessException - if the compile fails because of errors in the expression.
See Also:

loadXPath

  1. 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:

compileXQuery

  1. boolean compileXQuery(java.lang.String query,
  2. 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:
java.lang.NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:

compileXQuery

  1. boolean compileXQuery(java.lang.String query,
  2. XStaticContext context,
  3. 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:
java.lang.NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:

compileXQuery

  1. boolean compileXQuery(javax.xml.transform.stream.StreamSource query,
  2. 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:
java.lang.NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:

compileXQuery

  1. boolean compileXQuery(javax.xml.transform.stream.StreamSource query,
  2. XStaticContext context,
  3. 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:
java.lang.NullPointerException - if the query is null.
XProcessException - if the compile fails because of errors in the query.
See Also:

loadXQuery

  1. 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:

compileXSLT

  1. boolean compileXSLT(javax.xml.transform.stream.StreamSource stylesheet,
  2. 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:
java.lang.NullPointerException - if the stylesheet is null.
XProcessException - if the compile fails because of errors in the stylesheet.
See Also:

compileXSLT

  1. boolean compileXSLT(javax.xml.transform.stream.StreamSource stylesheet,
  2. XStaticContext context,
  3. 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:
java.lang.NullPointerException - if the stylesheet is null.
XProcessException - if the compile fails because of errors in the stylesheet.
See Also:

loadXSLT

  1. 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

  1. XCompilationParameters newCompilationParameters( java.lang.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:
java.lang.NullPointerException - if className is null.