public class CastExpressionCompiler extends ToItemCompiler
Constructor and Description |
---|
CastExpressionCompiler() |
Modifier and Type | Method and Description |
---|---|
void |
compileToItem(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the CastExpression as an Item
Precondition: none.
|
void |
compileToPrimitive(CompilerService compiler,
Expression expression,
Class requiredClass,
OnEmpty onEmpty)
Generate bytecode to evaluate the expression leaving a plain Java value on the stack.
|
static ConverterCompiler |
getConverterCompiler(PlainType sourceType,
AtomicType targetType) |
compileToBoolean, compileToIterator, compileToPush, returnZeroLengthStringIfNull
allocateStatic, compileItemFromInt, compileToLoop, generateMethod, handleEmptyStringResult, printStackTop, unboxItem, verify, visitAnnotation, visitLineNumber
public void compileToItem(CompilerService compiler, Expression expression) throws CannotCompileException
compileToItem
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
public void compileToPrimitive(CompilerService compiler, Expression expression, Class requiredClass, OnEmpty onEmpty) throws CannotCompileException
compileToPrimitive
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledrequiredClass
- the class of the Java value that is to be left on the stack if the generated code
exits normally. This must be one of Integer.TYPE, Double.TYPE, Float.TYPE, BigDecimal.class, CharSequence.class.onEmpty
- action to be taken if the result of the expression is an empty sequenceCannotCompileException
public static ConverterCompiler getConverterCompiler(PlainType sourceType, AtomicType targetType) throws CannotCompileException
CannotCompileException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.