public class CompoundMode extends Mode
Mode.RuleAction, Mode.RuleFilter
DEFAULT_MODE_NAME, hasRules, modeName, mustBeTyped, mustBeUntyped, OMNI_MODE, UNNAMED_MODE_NAME
body
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
|
String |
getCodeForBuiltInRuleSet(BuiltInRuleSet builtInRuleSet)
Return a code string for a built-in rule set.
|
Set<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, getBuiltInRuleSetForCode, getComponentKind, getConstructType, getModeName, getModeTitle, getNextMatchRule, getObjectName, getRecoveryPolicy, getRule, getSymbolicName, isDeclaredStreamable, isUnnamedMode, makeNewContext, makeNewContextIfNeeded, setRecoveryPolicy, setStreamable
allocateBindingSlotsRecursive, getBody, getColumnNumber, getDeclaredVisibility, getDeclaringComponent, getLineNumber, getLocation, getPackageData, getProperties, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, makeDeclaringComponent, saveLocation, setBody, 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 Set<String> getExplicitNamespaces(NamePool pool)
getExplicitNamespaces
in class Mode
pool
- the NamePool for the configurationpublic void allocateAllBindingSlots(StylesheetPackage pack)
allocateAllBindingSlots
in class ComponentCode<SimpleMode>
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 String getCodeForBuiltInRuleSet(BuiltInRuleSet builtInRuleSet)
Mode
getCodeForBuiltInRuleSet
in class Mode
builtInRuleSet
- the rule set to get a codepublic void exportTemplateRules(ExpressionPresenter presenter)
exportTemplateRules
in class Mode
presenter
- the expression presenter used to generate the XML representation of the structurepublic void explainTemplateRules(ExpressionPresenter presenter)
explainTemplateRules
in class Mode
presenter
- the expression presenter used to generate the XML representation of the structureCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.