Package net.sf.saxon.expr.accum
Class Accumulator
java.lang.Object
net.sf.saxon.expr.instruct.Actor
net.sf.saxon.expr.accum.Accumulator
- All Implemented Interfaces:
SourceLocator
,ExpressionOwner
,Location
,Locator
Represents a single accumulator declared in an XSLT 3.0 stylesheet
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildExpression
(Expression expression) Add an expression to the list of expressions used by this accumulatorvoid
export
(ExpressionPresenter presenter) Export expression structure.void
export
(ExpressionPresenter out, Map<Component, Integer> componentIdMap) Export expression structure.Get the name of the accumulatorint
Get the import precedenceGet the expression that computes the initial value of the accumulatorGet a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.Get the set of rules for phase="end", held in the form of a Mode objectGet the set of rules for phase="start", held in the form of a Mode objectGet the slotManager to be used for evaluating the initial-value expressionGet the symbolic name of the componentgetType()
Get the declared type of the accumulator.boolean
isCompatible
(Accumulator other) Determine whether this accumulator is compatible with one that it overridesboolean
Ask whether the accumulator is declared streamableboolean
Ask whether diagnostic tracing is enabled for this accumulatorboolean
Ask whether this accumulator is universally appicable to all documentsvoid
setAccumulatorName
(StructuredQName firstName) Set the name of the pre-descent functionvoid
setDeclaredStreamable
(boolean streamable) Say whether the accumulator is declared streamablevoid
setImportPrecedence
(int importPrecedence) Set the import precedencevoid
setInitialValueExpression
(Expression initialValueExpression) Set the expression that computes the initial value of the accumulatorvoid
setPostDescentRules
(SimpleMode postDescentRules) Set the set of rules for phase="end", held in the form of a Mode objectvoid
setPreDescentRules
(SimpleMode preDescentRules) Set the set of rules for phase="start", held in the form of a Mode objectvoid
setSlotManagerForInitialValueExpression
(SlotManager slotManagerForInitialValueExpression) Set the slotManager to be used for evaluating the initial-value expressionvoid
setTracing
(boolean tracing) Say whether diagnostic tracing is to be enabled for this accumulatorvoid
setType
(SequenceType type) Set the declared type of the accumulator.void
setUniversallyApplicable
(boolean universal) Say whether this accumulator is universally appicable to all documentsMethods inherited from class net.sf.saxon.expr.instruct.Actor
allocateAllBindingSlots, allocateBindingSlotsRecursive, getBody, getChildExpression, getColumnNumber, getComponentName, getDeclaredVisibility, getDeclaringComponent, getLineNumber, getLocation, getPackageData, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, getTracingTag, isExportable, makeDeclaringComponent, obtainDeclaringComponent, process, saveLocation, setBody, setChildExpression, setColumnNumber, setDeclaredVisibility, setDeclaringComponent, setLineNumber, setPackageData, setRetainedStaticContext, setStackFrameMap, setSystemId
-
Constructor Details
-
Accumulator
public Accumulator()
-
-
Method Details
-
getSymbolicName
Get the symbolic name of the component- Specified by:
getSymbolicName
in classActor
- Returns:
- the symbolic name
-
isDeclaredStreamable
public boolean isDeclaredStreamable()Ask whether the accumulator is declared streamable- Returns:
- true if it is declared with streamable="yes"
-
setDeclaredStreamable
public void setDeclaredStreamable(boolean streamable) Say whether the accumulator is declared streamable- Parameters:
streamable
- true if it is declared with streamable="yes"
-
getAccumulatorName
Get the name of the accumulator- Returns:
- the accumulator name
-
setAccumulatorName
Set the name of the pre-descent function- Parameters:
firstName
- the function name (always present)
-
getImportPrecedence
public int getImportPrecedence()Get the import precedence- Returns:
- the import precedence of the accumulator
-
setImportPrecedence
public void setImportPrecedence(int importPrecedence) Set the import precedence- Parameters:
importPrecedence
- the import precedence of the accumulator
-
setUniversallyApplicable
public void setUniversallyApplicable(boolean universal) Say whether this accumulator is universally appicable to all documents- Parameters:
universal
- true if this accumulator is universally applicable
-
isUniversallyApplicable
public boolean isUniversallyApplicable()Ask whether this accumulator is universally appicable to all documents- Returns:
- true if this accumulator is universally applicable
-
isTracing
public boolean isTracing()Ask whether diagnostic tracing is enabled for this accumulator- Returns:
- true if diagnostic tracing is enabled
-
setTracing
public void setTracing(boolean tracing) Say whether diagnostic tracing is to be enabled for this accumulator- Parameters:
tracing
- true if diagnostic tracing is to be enabled
-
getSlotManagerForInitialValueExpression
Get the slotManager to be used for evaluating the initial-value expression- Returns:
- the slotManager for the initial-value expression (defining any local variables declared and used within this expression)
-
setSlotManagerForInitialValueExpression
public void setSlotManagerForInitialValueExpression(SlotManager slotManagerForInitialValueExpression) Set the slotManager to be used for evaluating the initial-value expression- Parameters:
slotManagerForInitialValueExpression
- the slotManager for the initial-value expression (defining any local variables declared and used within this expression)
-
getPreDescentRules
Get the set of rules for phase="start", held in the form of a Mode object- Returns:
- the Mode object containing all the rules that apply to phase="start"
-
setPreDescentRules
Set the set of rules for phase="start", held in the form of a Mode object- Parameters:
preDescentRules
- the Mode object containing all the rules that apply to phase="start"
-
getPostDescentRules
Get the set of rules for phase="end", held in the form of a Mode object- Returns:
- the Mode object containing all the rules that apply to phase="end"
-
setPostDescentRules
Set the set of rules for phase="end", held in the form of a Mode object- Parameters:
postDescentRules
- the Mode object containing all the rules that apply to phase="end"
-
getInitialValueExpression
Get the expression that computes the initial value of the accumulator- Returns:
- the initial value expression
-
setInitialValueExpression
Set the expression that computes the initial value of the accumulator- Parameters:
initialValueExpression
- the initial value expression
-
addChildExpression
Add an expression to the list of expressions used by this accumulator- Parameters:
expression
- the expression to be added to the list
-
getType
Get the declared type of the accumulator. The initial value and all intermediate values must conform to this type- Returns:
- the declared type of the accumulator
-
setType
Set the declared type of the accumulator. The initial value and all intermediate values must conform to this type- Parameters:
type
- the declared type of the accumulator
-
isCompatible
Determine whether this accumulator is compatible with one that it overrides- Parameters:
other
- the accumlator that this one overrides- Returns:
- true if they are compatible, as defined in the XSLT 3.0 specification
-
getObjectName
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.- Returns:
- the QName of the object declared or manipulated by this instruction or expression
-
export
Export expression structure. The abstract expression tree is written to the supplied outputstream.- Specified by:
export
in classActor
- Parameters:
presenter
- the expression presenter used to generate the XML representation of the structure- Throws:
XPathException
- if things go wrong, for example an I/O failure
-
export
public void export(ExpressionPresenter out, Map<Component, Integer> componentIdMap) throws XPathExceptionExport expression structure. The abstract expression tree is written to the supplied outputstream.- Parameters:
out
- the expression presenter used to display the structurecomponentIdMap
- map from components to component IDs- Throws:
XPathException
- if any error occurs
-