public class CompoundMode extends Mode
Mode.RuleAction, Mode.RuleFilterDEFAULT_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.lang.String |
getCodeForBuiltInRuleSet(BuiltInRuleSet builtInRuleSet)
Return a code string for a built-in rule set.
|
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, getComponentKind, getConstructType, getDeclaringComponent, getModeName, getModeTitle, getNextMatchRule, getObjectName, getRecoveryPolicy, getRule, getSymbolicName, isDeclaredStreamable, isMustBeTyped, isUnnamedMode, makeNewContext, makeNewContextIfNeeded, setAccumulators, setHasRules, setRecoveryPolicy, setStreamableallocateBindingSlotsRecursive, getBody, getColumnNumber, getDeclaredVisibility, getLineNumber, getLocation, getPackageData, getProperties, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, isExportable, makeDeclaringComponent, saveLocation, setBody, setChildExpression, setDeclaredVisibility, setDeclaringComponent, setLineNumber, setPackageData, setRetainedStaticContext, setStackFrameMap, setSystemIdpublic 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 Modepublic SimpleMode getActivePart()
getActivePart in class Modepublic boolean isEmpty()
public int getMaxPrecedence()
getMaxPrecedence in class Modepublic int getMaxRank()
getMaxRank in class Modepublic void computeRankings(int start)
throws XPathException
computeRankings in class Modestart - the lowest rank to useXPathException - if an error occurs processing the rulespublic void processRules(Mode.RuleAction action) throws XPathException
processRules in class Modeaction - 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 Modepool - the NamePool for the configurationpublic void allocateAllBindingSlots(StylesheetPackage pack)
allocateAllBindingSlots in class Actorpack - the containing packagepublic Rule getRule(Item item, XPathContext context) throws XPathException
getRule in class Modeitem - the item to be matchedcontext - the XPath dynamic evaluation contextXPathException - if an error occurs matching a patternpublic int getStackFrameSlotsNeeded()
getStackFrameSlotsNeeded in class Modepublic Rule getRule(Item item, XPathContext context, Mode.RuleFilter filter) throws XPathException
getRule in class Modeitem - the item to be matchedcontext - the XPath dynamic evaluation contextfilter - a filter to select which rules should be consideredXPathException - if an error occurspublic java.lang.String getCodeForBuiltInRuleSet(BuiltInRuleSet builtInRuleSet)
ModegetCodeForBuiltInRuleSet in class ModebuiltInRuleSet - the rule set to get a codepublic void exportTemplateRules(ExpressionPresenter presenter) throws XPathException
exportTemplateRules in class Modepresenter - the expression presenter used to generate the XML representation of the structureXPathExceptionpublic void explainTemplateRules(ExpressionPresenter presenter) throws XPathException
explainTemplateRules in class Modepresenter - the expression presenter used to generate the XML representation of the structureXPathExceptionCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.