Package com.saxonica.ee.bytecode

## Class GeneratedCode

- java.lang.Object
- - com.saxonica.ee.bytecode.GeneratedCode

-     public abstract class GeneratedCode
      extends java.lang.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

    Constructors
    Constructor | Description
    --- | ---
    `GeneratedCode()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `dynamicError​(java.lang.String message, java.lang.String code)` | Helper method for use at run-time allowing the generated code to throw a dynamic error
    `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​(Outputter output, 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

    - #### dynamicError

          public final void dynamicError​(java.lang.String message,
                                         java.lang.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​(Outputter output,
                              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