|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xsl.process.RuleCollection
A collection of rules organized for pattern matching.
The collection automatically optimizes its internal storage before doing any matching. This optimization may be time consuming for a large collections, so there is a method available to force the optimization to happen up front.
Constructor Summary | |
RuleCollection()
Constructs an empty rule collection. |
Method Summary | |
void |
add(Rule rule)
Adds the specified rule to this collection. |
void |
dump(PrintWriter out,
int indent)
Dumps this object to the specified output stream. |
Rule |
findMatchingImportedRule(Node source,
ProcessingEnv env,
Rule currentRule)
Optimizes this rule collection for matching (if it isn't already optimized) and returns the rule that matches the specified source node and the specified mode, looking only at rules that were imported into the stylesheet containing the current rule. |
Rule |
findMatchingRule(Node source,
ProcessingEnv env,
Mode mode)
Optimizes this rule collection for matching (if it isn't already optimized) and returns the rule that matches the specified source node and the specified mode. |
Rule |
getNamedRule(ExpandedQName name)
Return a rule by name, if there is a matching rule. |
void |
optimize()
Optimizes this rule collection for matching. |
void |
setBuiltIn(Rule rule,
int nodeType)
Sets the specified rule as this collection's built-in rule for nodes of the specified type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RuleCollection()
Method Detail |
public void add(Rule rule)
Note: Rule collections cannot handle rules whose
getTargetType
method returns
FilterExpr.OTHER_TARGET
. Such rules should never occur in
XSL.
rule
- the rule to be added
IllegalArgumentException
- if the rule's target type is
FilterExpr.OTHER_TARGET
public void setBuiltIn(Rule rule, int nodeType)
rule
- the built-in rule to be addednodeType
- the node type that the built-in rule is forpublic Rule findMatchingRule(Node source, ProcessingEnv env, Mode mode) throws XSLException
source
- the source node to be matchedenv
- the XSLT processing environmentmode
- the mode to be matched
null
if no rule
matches
XSLException
- if a fatal error occurs during evaluationpublic Rule findMatchingImportedRule(Node source, ProcessingEnv env, Rule currentRule) throws XSLException
source
- the source node to be matchedenv
- the XSLT processing environmentcurrentRule
- the current template rule
null
if no rule
matches
XSLException
- if a fatal error occurs during evaluationpublic Rule getNamedRule(ExpandedQName name)
name
- The expanded name of the rule to return.
public void optimize()
public void dump(PrintWriter out, int indent)
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 |