com.saxonica.codegen
Class JavaDeclaration

java.lang.Object
  extended by com.saxonica.codegen.JavaDeclaration
All Implemented Interfaces:
ReturnAction

public class JavaDeclaration
extends java.lang.Object
implements ReturnAction

A return action that assigns the value of the expression to a variable supplied by the caller


Constructor Summary
JavaDeclaration(java.lang.Class theClass, java.lang.String varName)
          Create a JavaDeclaration
 
Method Summary
 java.lang.Class getVariableClass()
          Get the class of the variable
 java.lang.String getVariableName()
          Get the name of the variable holding the result
 java.lang.String output(CompilerService compiler, java.lang.String expression)
          Generate the return text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaDeclaration

public JavaDeclaration(java.lang.Class theClass,
                       java.lang.String varName)
Create a JavaDeclaration

Parameters:
theClass - the class of variable to be declared, currently always boolean.class
varName - the name of the variable to be declared
Method Detail

getVariableClass

public java.lang.Class getVariableClass()
Get the class of the variable

Returns:
the class of the variable, currently always boolean.class

output

public java.lang.String output(CompilerService compiler,
                               java.lang.String expression)
Generate the return text

Specified by:
output in interface ReturnAction
Parameters:
compiler - the compiler service
expression - the Java expression that computes the return value
Returns:
the Java statement to be output

getVariableName

public java.lang.String getVariableName()
Get the name of the variable holding the result

Specified by:
getVariableName in interface ReturnAction
Returns:
the Java variable name


Copyright (c) Saxonica Limited. All rights reserved.