public abstract class CastingExpression extends UnaryExpression
| Modifier and Type | Field and Description |
|---|---|
protected Converter |
converter |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD| Constructor and Description |
|---|
CastingExpression(Expression source,
AtomicType target,
boolean allowEmpty)
Create a cast expression
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsEmpty()
Ask whether the expression accepts an empty sequence as input (producing an empty sequence as output)
|
int |
computeSpecialProperties()
Determine the special properties of this expression
|
Converter |
getConverter()
Get the Converter allocated to implement this cast expression, if any
|
int |
getIntrinsicDependencies()
Get the expression's dependencies.
|
NamespaceResolver |
getNamespaceResolver()
Get the namespace resolver, if any
|
protected OperandRole |
getOperandRole()
Get the usage (in terms of streamability analysis) of the single operand
|
AtomicType |
getTargetPrimitiveType()
Get the primitive base type of the target type of the cast
|
AtomicType |
getTargetType()
Get the target type (the result type)
|
boolean |
isOperandIsStringLiteral()
Ask whether the operand to the cast expression was supplied in the form of a string literal.
|
void |
setAllowEmpty(boolean allow)
Say whether the expression accepts an empty sequence as input (producing an empty sequence as output)
|
void |
setOperandIsStringLiteral(boolean option)
Say whether the operand to the cast expression was supplied in the form of a string literal.
|
void |
setTargetType(AtomicType type)
Set the target type
|
Expression |
simplify()
Simplify the expression
|
computeCardinality, computeHashCode, displayOperator, equals, export, getBaseExpression, getItemType, getOperand, operands, optimize, setBaseExpression, toShortString, toString, typeCheckaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionName, getExtraProperty, getImplementationMethod, getIntegerBounds, getInterpretedExpression, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointersprotected Converter converter
public CastingExpression(Expression source, AtomicType target, boolean allowEmpty)
source - expression giving the value to be convertedtarget - the type to which the value is to be convertedallowEmpty - true if the expression allows an empty sequence as input, producing
an empty sequence as output. If false, an empty sequence is a type error.public AtomicType getTargetPrimitiveType()
public void setTargetType(AtomicType type)
type - the target type for the castpublic AtomicType getTargetType()
protected OperandRole getOperandRole()
UnaryExpressiongetOperandRole in class UnaryExpressionpublic void setAllowEmpty(boolean allow)
allow - true if an empty sequence is acceptedpublic boolean allowsEmpty()
public void setOperandIsStringLiteral(boolean option)
option - true if the operand was supplied as a string literalpublic boolean isOperandIsStringLiteral()
public Converter getConverter()
public NamespaceResolver getNamespaceResolver()
public int getIntrinsicDependencies()
getIntrinsicDependencies in class Expressionpublic Expression simplify() throws XPathException
simplify in class ExpressionXPathException - if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties in class UnaryExpressionStaticProperty.NO_NODES_NEWLY_CREATED.Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.