|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xsl.process.Rule com.novell.xsl.process.TemplateRule
Represents a template rule corresponding to an xsl:template
element.
Nested Class Summary | |
protected static class |
TemplateRule.RecursionCounter
Class to keep track of recursion for multiple instances of TemplateRule that share everything but their patterns (i.e., were created with cloneForUnion() |
Field Summary | |
protected TemplateRule.RecursionCounter |
recursionLevel
Keeps track of how many times this rule and clones have been instantiated in a recursive fashion. |
Constructor Summary | |
|
TemplateRule(Pattern pattern,
ExpandedQName name,
Template[] templates,
Collection variables,
Mode mode,
int importance,
Priority priority,
int number,
Node nsContext)
Constructs a new template rule. |
protected |
TemplateRule(TemplateRule original,
Pattern pattern)
Constructs a new template rule that is (almost) a shallow copy of the specified rule, with the intent of using the new rule as one of the multiple instances representing a union of path expressions. |
Method Summary | |
Rule |
cloneForUnion(Pattern pattern)
Creates a new template rule that is (almost) a shallow copy of this rule and whose actual class is the same as this rule's actual class, with the intent of using the new rule as one of the multiple instances representing a union of path expressions. |
void |
dump(PrintWriter out,
int indent)
Dumps this object to the specified output stream. |
Template[] |
getTemplates()
Returns the templates that are instantiated when this rule's pattern is successfully matched. |
void |
instantiate(ProcessingEnv env,
Node currentNode,
Mode currentMode,
ResultHandler result)
Instantiates this rule's template for the specified current node and sends the result to the specified result handler. |
protected void |
popVariables(ExpressionValue[] state)
Restore any variable values that were saved by pushVariables() |
protected ExpressionValue[] |
pushVariables()
Save any variable values that are currently in effect in preparation for a recursive instantiation. |
Methods inherited from class com.novell.xsl.process.Rule |
compareTo, getImportance, getMode, getName, getNamespaceContext, getNumber, getPattern, getPriority, indent, matches |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TemplateRule.RecursionCounter recursionLevel
Constructor Detail |
public TemplateRule(Pattern pattern, ExpandedQName name, Template[] templates, Collection variables, Mode mode, int importance, Priority priority, int number, Node nsContext)
pattern
- the rule's path match patternname
- the rule's expanded nametemplates
- the templates to be instantiated when this rule's
pattern is successfully matchedvariables
- all descendant variables and parameters (may be null)mode
- the rule's modeimportance
- the rule's importancepriority
- the rule's priority; null
means use the
default priority based on the rule's patternnumber
- the rule's identifying numbernsContext
- The node in the style sheet from which this rule comesprotected TemplateRule(TemplateRule original, Pattern pattern)
Template
objects.
original
- the original template rulepattern
- the clone's path expression, represented as a chain of
FilterExpr
objectscloneForUnion(com.novell.xsl.pattern.Pattern)
Method Detail |
public Template[] getTemplates()
public Rule cloneForUnion(Pattern pattern)
Template
objects.
cloneForUnion
in class Rule
pattern
- the clone's path expression, represented as a chain of
FilterExpr
objects
public void instantiate(ProcessingEnv env, Node currentNode, Mode currentMode, ResultHandler result) throws XSLException
env
- the current processing environmentcurrentNode
- the current source nodecurrentMode
- the current processing mode, this is really only for
built-in rules which handle all modesresult
- the handler to which results are sent
XSLException
- if a fatal error occurs during instantiationprotected ExpressionValue[] pushVariables()
ExpressionValue
objects containing the current
values of all descendant variables, or null if nothing to save.protected void popVariables(ExpressionValue[] state)
pushVariables()
state
- The return from pushVariables()
public void dump(PrintWriter out, int indent)
dump
in class Rule
out
- the output stream to write toindent
- the number of tabs to indent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |