net.sf.saxon.functions

Class Component

Implemented Interfaces:
EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator

public class Component
extends SystemFunction

This class supports the get_X_from_Y functions defined in XPath 2.0

Field Summary

static int
DAY
static int
HOURS
static int
LOCALNAME
static int
MICROSECONDS
static int
MINUTES
static int
MONTH
static int
NAMESPACE
static int
PREFIX
static int
SECONDS
static int
TIMEZONE
static int
WHOLE_SECONDS
static int
YEAR
static int
YEAR_ALLOWING_ZERO

Fields inherited from class net.sf.saxon.functions.SystemFunction

operation

Fields inherited from class net.sf.saxon.expr.FunctionCall

argument

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Method Summary

Expression
copy()
Copy an expression.
Item
evaluateItem(XPathContext context)
Evaluate the expression
int
getRequiredComponent()
Get the required component
String
getRequiredComponentAsString()
Get the required component name as a string
Expression
simplify(ExpressionVisitor visitor)
Simplify an expression.

Methods inherited from class net.sf.saxon.functions.SystemFunction

addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault

Methods inherited from class net.sf.saxon.expr.FunctionCall

addExternalFunctionCallToPathMap, checkArgumentCount, checkArguments, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, optimize, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Field Details

DAY

public static final int DAY
Field Value:
3

HOURS

public static final int HOURS
Field Value:
4

LOCALNAME

public static final int LOCALNAME
Field Value:
8

MICROSECONDS

public static final int MICROSECONDS
Field Value:
11

MINUTES

public static final int MINUTES
Field Value:
5

MONTH

public static final int MONTH
Field Value:
2

NAMESPACE

public static final int NAMESPACE
Field Value:
9

PREFIX

public static final int PREFIX
Field Value:
10

SECONDS

public static final int SECONDS
Field Value:
6

TIMEZONE

public static final int TIMEZONE
Field Value:
7

WHOLE_SECONDS

public static final int WHOLE_SECONDS
Field Value:
12

YEAR

public static final int YEAR
Field Value:
1

YEAR_ALLOWING_ZERO

public static final int YEAR_ALLOWING_ZERO
Field Value:
13

Method Details

copy

public Expression copy()
Copy an expression. This makes a deep copy.
Overrides:
copy in interface SystemFunction
Returns:
the copy of the original expression

evaluateItem

public Item evaluateItem(XPathContext context)
            throws XPathException
Evaluate the expression
Specified by:
evaluateItem in interface EvaluableItem
Overrides:
evaluateItem in interface Expression

getRequiredComponent

public int getRequiredComponent()
Get the required component

getRequiredComponentAsString

public String getRequiredComponentAsString()
Get the required component name as a string

simplify

public Expression simplify(ExpressionVisitor visitor)
            throws XPathException
Simplify an expression. This performs any static optimization (by rewriting the expression as a different expression). The default implementation does nothing.
Overrides:
simplify in interface FunctionCall
Parameters:
visitor - an expression visitor
Returns:
the simplified expression
Throws:
XPathException - if an error is discovered during expression rewriting