java.io.Serializable
, javax.xml.transform.SourceLocator
, LocationProvider
, SaxonLocator
, InstructionInfo
, org.xml.sax.Locator
CastableExpression
, CastExpression
public abstract class CastingExpression extends UnaryExpression
Modifier and Type | Field | Description |
---|---|---|
protected Converter |
converter |
|
protected NamespaceResolver |
nsResolver |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD
operand
Constructor | Description |
---|---|
CastingExpression(Expression source,
AtomicType target,
boolean allowEmpty) |
Create a cast expression
|
Modifier and Type | Method | 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
|
NamespaceResolver |
getNamespaceResolver() |
Get the namespace resolver, if any
|
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 |
setNamespaceResolver(NamespaceResolver resolver) |
Set the namespace resolver, if any
|
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(ExpressionVisitor visitor) |
Simplify the expression
|
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionName, getHostLanguage, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
computeCardinality, displayOperator, equals, explain, getBaseExpression, getItemType, hashCode, iterateSubExpressions, optimize, promote, replaceSubExpression, toString, typeCheck
protected Converter converter
protected NamespaceResolver nsResolver
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()
public 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 void setNamespaceResolver(NamespaceResolver resolver)
resolver
- the namespace resolver to be used if the target type is namespace-sensitivepublic NamespaceResolver getNamespaceResolver()
public Expression simplify(ExpressionVisitor visitor) throws XPathException
simplify
in class UnaryExpression
visitor
- an expression visitorXPathException
- if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties
in class UnaryExpression
StaticProperty.NON_CREATIVE
.