Package com.saxonica.ee.bytecode

## Class ValueOfCompiler

- java.lang.Object
- - com.saxonica.ee.bytecode.ExpressionCompiler
  - - com.saxonica.ee.bytecode.ToIteratorCompiler
    - - com.saxonica.ee.bytecode.ToPushCompiler
      - - com.saxonica.ee.bytecode.SimpleNodeConstructorCompiler
        - - com.saxonica.ee.bytecode.ValueOfCompiler

-     public class ValueOfCompiler
      extends SimpleNodeConstructorCompiler

  Generate code for a ValueOf instruction

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `compileToItem​(CompilerService compiler, Expression expression)` | Generate bytecode to get the ValueOf text from the instruction Precondition: none.
    `protected boolean` | `isNoNodeIfEmpty​(Expression expr)` | Overridable method to ask whether no node should be produced in the case that the content is empty
    `protected void` | `pushNode​(CompilerService compiler, Expression expression)` | Generate code to write the node to the current receiver.

    - ### Methods inherited from class com.saxonica.ee.bytecode.SimpleNodeConstructorCompiler

      `checkContent, compileNodeName, compileToPush, isNamedNodeKind`

    - ### Methods inherited from class com.saxonica.ee.bytecode.ToPushCompiler

      `compilePushToSequenceCollector, compileToIterator`

    - ### Methods inherited from class com.saxonica.ee.bytecode.ToIteratorCompiler

      `compileToBoolean`

    - ### Methods inherited from class com.saxonica.ee.bytecode.ExpressionCompiler

      `allocateStatic, compileItemFromInt, compileToPrimitive, generateMethod, handleEmptyStringResult, printStackTop, verify, visitAnnotation, visitLineNumber`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ValueOfCompiler

          public ValueOfCompiler()

  - ### Method Detail

    - #### compileToItem

          public void compileToItem​(CompilerService compiler,
                                    Expression expression)
                             throws CannotCompileException

      Generate bytecode to get the ValueOf text from the instruction Precondition: none. Postcondition: the stack contains an item from evaluating this instruction
      Overrides:
        `compileToItem` in class `SimpleNodeConstructorCompiler`
      Parameters:
        `compiler` - the compiler service
        `expression` - the expression to be compiled
      Throws:
        `CannotCompileException` - if the expression cannot be compiled to bytecode

    - #### isNoNodeIfEmpty

          protected boolean isNoNodeIfEmpty​(Expression expr)

      Overridable method to ask whether no node should be produced in the case that the content is empty
      Overrides:
        `isNoNodeIfEmpty` in class `SimpleNodeConstructorCompiler`
      Returns:
        true if the rules for this instruction are that when the content is empty, no node is generated

    - #### pushNode

          protected void pushNode​(CompilerService compiler,
                                  Expression expression)

      Generate code to write the node to the current receiver. On entry the stack holds the current receiver, the node name (for named node kinds only) and the content (for all nodes)
      Specified by:
        `pushNode` in class `SimpleNodeConstructorCompiler`
      Parameters:
        `compiler` - the compiler service
        `expression` - the expression to be compiled