com.saxonica.bytecode
Class GeneratedCode

java.lang.Object
  extended by com.saxonica.bytecode.GeneratedCode

public abstract class GeneratedCode
extends Object

This abstract class is extended by the compiled code representing an Expression. The concrete subclasses of this class are generated dynamically by the expression compiler.


Constructor Summary
GeneratedCode()
           
 
Method Summary
 void dynamicError(String message, String code)
          Helper method for use at run-time allowing the generated code to throw a dynamic error
abstract  boolean effectiveBooleanValue(AtomicValue val)
           
abstract  boolean effectiveBooleanValue(SequenceIterator seq)
           
 boolean effectiveBooleanValue(XPathContext context)
          Method that can be implemented in each generated subclass, to actually evaluate the compiled code.
 Item evaluateItem(XPathContext context)
          Method that can be implemented in each generated subclass, to actually evaluate the compiled code.
 Configuration getConfiguration()
          Get the configuration.
 SequenceIterator iterate(XPathContext context)
          Method that can be implemented in each generated subclass, to actually evaluate the compiled code.
 void process(XPathContext context)
          Method that can be implemented in each generated subclass, to actually evaluate the compiled code.
 void setConfiguration(Configuration config)
          Set the configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedCode

public GeneratedCode()
Method Detail

setConfiguration

public final void setConfiguration(Configuration config)
Set the configuration. Note that the same Configuration is used when this code is generated (compiled) and when it is evaluated.

Parameters:
config - the Saxon configuration

getConfiguration

public final Configuration getConfiguration()
Get the configuration. Note that the same Configuration is used when this code is generated (compiled) and when it is evaluated.

Returns:
the Saxon configuration

effectiveBooleanValue

public abstract boolean effectiveBooleanValue(AtomicValue val)

effectiveBooleanValue

public abstract boolean effectiveBooleanValue(SequenceIterator seq)

dynamicError

public final void dynamicError(String message,
                               String code)
                        throws XPathException
Helper method for use at run-time allowing the generated code to throw a dynamic error

Parameters:
message - the error message
code - the error code
Throws:
XPathException - the exception representing the dynamic error

iterate

public SequenceIterator iterate(XPathContext context)
                         throws XPathException
Method that can be implemented in each generated subclass, to actually evaluate the compiled code. This class provides a fallback implementation that relies on the process() method being implemented.

Parameters:
context - the XPath dynamic context
Returns:
a SequenceIterator representing the results of evaluating the expression
Throws:
XPathException - if any dynamic error occurs during the evaluation

process

public void process(XPathContext context)
             throws XPathException
Method that can be implemented in each generated subclass, to actually evaluate the compiled code. This class provides a fallback implementation that relies on the iterate() method being implemented.

Parameters:
context - the XPath dynamic context
Throws:
XPathException - if any dynamic error occurs during the evaluation

evaluateItem

public Item evaluateItem(XPathContext context)
                  throws XPathException
Method that can be implemented in each generated subclass, to actually evaluate the compiled code. This class provides a fallback implementation that relies on the iterate() method being implemented.

Parameters:
context - the XPath dynamic context
Throws:
XPathException - if any dynamic error occurs during the evaluation

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)
                              throws XPathException
Method that can be implemented in each generated subclass, to actually evaluate the compiled code. This class provides a fallback implementation that relies on the iterate() method being implemented.

Parameters:
context - the XPath dynamic context
Throws:
XPathException - if any dynamic error occurs during the evaluation


Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.