public class CompoundMode extends Mode
Mode.RuleAction, Mode.RuleFilter
DEFAULT_MODE_NAME, modeName, mustBeTyped, mustBeUntyped, OMNI_MODE, UNNAMED_MODE_NAME
Constructor and Description |
---|
CompoundMode(Mode base,
SimpleMode overrides)
Create a compound Mode
|
Modifier and Type | Method and Description |
---|---|
void |
allocateAllBindingSlots(StylesheetPackage pack)
Allocate slot numbers to all the external component references in this component
|
void |
computeRankings(int start)
Compute a rank for each rule, as a combination of the precedence and priority, to allow
rapid comparison.
|
void |
explainTemplateRules(ExpressionPresenter presenter)
Explain expression structure.
|
void |
exportTemplateRules(ExpressionPresenter presenter)
Export expression structure.
|
SimpleMode |
getActivePart()
Get the active component of this mode.
|
BuiltInRuleSet |
getBuiltInRuleSet()
Get the built-in template rules to be used with this Mode in the case where there is no
explicit template rule
|
java.util.Set<java.lang.String> |
getExplicitNamespaces(NamePool pool)
Get the "explicit namespaces" matched by this mode.
|
int |
getMaxPrecedence()
Get the maximum precedence of the rules in this mode
|
int |
getMaxRank()
Get the highest rank of the rules in this mode
|
Rule |
getRule(Item item,
XPathContext context)
Get the rule corresponding to a given item, by finding the best pattern match.
|
Rule |
getRule(Item item,
XPathContext context,
Mode.RuleFilter filter)
Get the rule corresponding to a given item, by finding the best Pattern match.
|
int |
getStackFrameSlotsNeeded() |
boolean |
isEmpty()
Ask whether there are any template rules in this mode
(a mode could exist merely because it is referenced in apply-templates)
|
void |
processRules(Mode.RuleAction action)
Walk over all the rules, applying a specified action to each one.
|
applyTemplates, explain, export, exportUseAccumulators, getAccumulators, getBuiltInRuleSetForCode, getCodeForBuiltInRuleSet, getComponentKind, getConstructType, getDeclaringComponent, getModeName, getModeTitle, getNextMatchRule, getObjectName, getRecoveryPolicy, getRule, getSymbolicName, isDeclaredStreamable, isModeTracing, isMustBeTyped, isUnnamedMode, makeNewContext, setAccumulators, setHasRules, setModeTracing, setRecoveryPolicy, setStreamable
allocateBindingSlotsRecursive, getBody, getColumnNumber, getDeclaredVisibility, getLineNumber, getLocation, getPackageData, getProperties, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, isExportable, makeDeclaringComponent, obtainDeclaringComponent, saveLocation, setBody, setChildExpression, setDeclaredVisibility, setDeclaringComponent, setLineNumber, setPackageData, setRetainedStaticContext, setStackFrameMap, setSystemId
public CompoundMode(Mode base, SimpleMode overrides)
base
- the mode from the base (used) packageoverrides
- the mode containing (only) the overriding template rules from the using packagepublic BuiltInRuleSet getBuiltInRuleSet()
getBuiltInRuleSet
in class Mode
public SimpleMode getActivePart()
getActivePart
in class Mode
public boolean isEmpty()
public int getMaxPrecedence()
getMaxPrecedence
in class Mode
public int getMaxRank()
getMaxRank
in class Mode
public void computeRankings(int start) throws XPathException
computeRankings
in class Mode
start
- the lowest rank to useXPathException
- if an error occurs processing the rulespublic void processRules(Mode.RuleAction action) throws XPathException
processRules
in class Mode
action
- an action that is to be applied to all the rules in this ModeXPathException
- if an error occurs processing any of the rulespublic java.util.Set<java.lang.String> getExplicitNamespaces(NamePool pool)
getExplicitNamespaces
in class Mode
pool
- the NamePool for the configurationpublic void allocateAllBindingSlots(StylesheetPackage pack)
allocateAllBindingSlots
in class Actor
pack
- the containing packagepublic Rule getRule(Item item, XPathContext context) throws XPathException
getRule
in class Mode
item
- the item to be matchedcontext
- the XPath dynamic evaluation contextXPathException
- if an error occurs matching a patternpublic int getStackFrameSlotsNeeded()
getStackFrameSlotsNeeded
in class Mode
public Rule getRule(Item item, XPathContext context, Mode.RuleFilter filter) throws XPathException
getRule
in class Mode
item
- the item to be matchedcontext
- the XPath dynamic evaluation contextfilter
- a filter to select which rules should be consideredXPathException
- if an error occurspublic void exportTemplateRules(ExpressionPresenter presenter) throws XPathException
exportTemplateRules
in class Mode
presenter
- the expression presenter used to generate the XML representation of the structureXPathException
public void explainTemplateRules(ExpressionPresenter presenter) throws XPathException
explainTemplateRules
in class Mode
presenter
- the expression presenter used to generate the XML representation of the structureXPathException
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.