jd.xml.xslt.template
Class TemplateRuleList

java.lang.Object
  extended byjd.xml.xslt.template.TemplateRuleList

public class TemplateRuleList
extends Object

TemplateRuleList keeps a list of TemplateRules which all have a non-null match pattern and same mode value.


Constructor Summary
TemplateRuleList(String mode)
          Create a TemplateRuleList.
 
Method Summary
 void addTemplateRule(TemplateRule rule)
           
 TemplateRule getMatchingRule(XsltContext context, int maxImportPrecedence, ResultBuilder resultBuilder)
          Return a template that matches the current node of the given context.
 String getMode()
           
 int getNamePoolSize()
           
 Enumeration getRules()
          Return an enumeration of the TemplateRules.
 void setup(int namePoolSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateRuleList

public TemplateRuleList(String mode)
Create a TemplateRuleList.

Method Detail

getMode

public String getMode()

addTemplateRule

public void addTemplateRule(TemplateRule rule)

getRules

public Enumeration getRules()
Return an enumeration of the TemplateRules. If stup() has been called before, then the rules are sorts.


getNamePoolSize

public int getNamePoolSize()

setup

public void setup(int namePoolSize)

getMatchingRule

public TemplateRule getMatchingRule(XsltContext context,
                                    int maxImportPrecedence,
                                    ResultBuilder resultBuilder)
                             throws XsltException
Return a template that matches the current node of the given context.

Parameters:
context - the context
maxImportPrecedence - the maximal import precedence of the matching template
resultBuilder - the current ResultBuilder for fast execution of the built in rule "text()|@*"
Returns:
the best matching template rule with a non empty content or null if there is no template for the context node or the best match has empty content.
Throws:
XsltException - thrown if no such a template exists