com.saxonica.codegen
Class ValueCompiler

java.lang.Object
  extended by com.saxonica.codegen.ValueCompiler
Direct Known Subclasses:
AnyURIValueCompiler, Base64BinaryValueCompiler, BigIntegerValueCompiler, BooleanValueCompiler, DateTimeValueCompiler, DateValueCompiler, DayTimeDurationValueCompiler, DecimalValueCompiler, DoubleValueCompiler, DurationValueCompiler, EmptySequenceCompiler, FloatValueCompiler, GDayValueCompiler, GMonthDayValueCompiler, GMonthValueCompiler, GYearMonthValueCompiler, GYearValueCompiler, HexBinaryValueCompiler, Int64ValueCompiler, IntegerRangeCompiler, NotationValueCompiler, QNameValueCompiler, SequenceExtentCompiler, StringValueCompiler, TimeValueCompiler, UntypedAtomicValueCompiler, YearMonthDurationValueCompiler

public abstract class ValueCompiler
extends Object

Compile a literal value to Java code


Constructor Summary
ValueCompiler()
           
 
Method Summary
 void compilePush(CompilerService compiler, Value value)
           
 String compileToCharSequence(CompilerService compiler, AtomicValue av)
          Compile Java code whose effect is to compute the string value of the expression; the generated code returns a CharSequence.
 String compileToEffectiveBooleanValue(CompilerService compiler, Value expr, ReturnAction options)
           
 String compileToItem(CompilerService compiler, AtomicValue value)
           
 String compileToIterator(CompilerService compiler, Value val)
           
 Class getJavaClass(AtomicValue value)
           
abstract  String toJavaExpression(AtomicValue value, CompilerService compiler)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueCompiler

public ValueCompiler()
Method Detail

compilePush

public void compilePush(CompilerService compiler,
                        Value value)

compileToItem

public String compileToItem(CompilerService compiler,
                            AtomicValue value)

compileToIterator

public String compileToIterator(CompilerService compiler,
                                Value val)

compileToEffectiveBooleanValue

public String compileToEffectiveBooleanValue(CompilerService compiler,
                                             Value expr,
                                             ReturnAction options)

compileToCharSequence

public String compileToCharSequence(CompilerService compiler,
                                    AtomicValue av)
Compile Java code whose effect is to compute the string value of the expression; the generated code returns a CharSequence. This method must only be called for an expression that is known to return a value of type xs:string

Parameters:
av - The atomic value to be compiled
Returns:
the name of a variable to which the resulting CharSequence is assigned, or a Java expression that can be used in a place where a variable reference of type CharSequence is allowed.

toJavaExpression

public abstract String toJavaExpression(AtomicValue value,
                                        CompilerService compiler)

getJavaClass

public Class getJavaClass(AtomicValue value)


Copyright (C) Michael H. Kay. All rights reserved.