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:
javax.xml.transform.SourceLocator
,ExpressionOwner
,Location
,org.xml.sax.Locator
public class Accumulator extends Actor
Represents a single accumulator declared in an XSLT 3.0 stylesheet
-
-
Constructor Summary
Constructors Constructor Description Accumulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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, java.util.Map<Component,java.lang.Integer> componentIdMap)
Export expression structure.StructuredQName
getAccumulatorName()
Get the name of the accumulatorint
getImportPrecedence()
Get the import precedenceExpression
getInitialValueExpression()
Get the expression that computes the initial value of the accumulatorStructuredQName
getObjectName()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.SimpleMode
getPostDescentRules()
Get the set of rules for phase="end", held in the form of a Mode objectSimpleMode
getPreDescentRules()
Get the set of rules for phase="start", held in the form of a Mode objectSlotManager
getSlotManagerForInitialValueExpression()
Get the slotManager to be used for evaluating the initial-value expressionSymbolicName
getSymbolicName()
Get the symbolic name of the componentSequenceType
getType()
Get the declared type of the accumulator.boolean
isCompatible(Accumulator other)
Determine whether this accumulator is compatible with one that it overridesboolean
isDeclaredStreamable()
Ask whether the accumulator is declared streamableboolean
isTracing()
Ask whether diagnostic tracing is enabled for this accumulatorboolean
isUniversallyApplicable()
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 documents-
Methods 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
-
-
-
-
Method Detail
-
getSymbolicName
public SymbolicName 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
public StructuredQName getAccumulatorName()
Get the name of the accumulator- Returns:
- the accumulator name
-
setAccumulatorName
public void setAccumulatorName(StructuredQName firstName)
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
public SlotManager 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
public SimpleMode 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
public void setPreDescentRules(SimpleMode preDescentRules)
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
public SimpleMode 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
public void setPostDescentRules(SimpleMode postDescentRules)
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
public Expression getInitialValueExpression()
Get the expression that computes the initial value of the accumulator- Returns:
- the initial value expression
-
setInitialValueExpression
public void setInitialValueExpression(Expression initialValueExpression)
Set the expression that computes the initial value of the accumulator- Parameters:
initialValueExpression
- the initial value expression
-
addChildExpression
public void addChildExpression(Expression expression)
Add an expression to the list of expressions used by this accumulator- Parameters:
expression
- the expression to be added to the list
-
getType
public SequenceType 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
public void setType(SequenceType type)
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
public boolean isCompatible(Accumulator other)
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
public StructuredQName 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
public void export(ExpressionPresenter presenter) throws XPathException
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, java.util.Map<Component,java.lang.Integer> componentIdMap) throws XPathException
Export 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
-
-