| Modifier and Type | Field and Description |
|---|---|
| private List | _attribNodeGroup
Group for patterns with node()-type kernel and attribute axis. |
| private TestSeq | _attribNodeTestSeq
Test sequence for patterns with node()-type kernel and attribute axis. |
| private List | _childNodeGroup
Group for patterns with node()-type kernel and child axis. |
| private TestSeq | _childNodeTestSeq
Test sequence for patterns with node()-type kernel and child axis. |
| private int | _currentIndex
Variable index for the current node used in code generation. |
| private List | _idxGroup
Group for patterns with id() or key()-type kernel. |
| private TestSeq | _idxTestSeq
Test sequence for patterns with id() or key()-type kernel. |
| private Map | _importLevels
Stores ranges of template precendences for the compilation of apply-imports. |
| private Map | _keys
A mapping between key names and keys. |
| private final String | _methodName
The name of the method in which this mode is compiled. |
| private final QName | _name
The name of this mode as defined in the stylesheet. |
| private Map | _namedTemplates
A mapping between named templates and Mode objects. |
| private Map | _neededTemplates
A mapping between templates and test sequences. |
| private List | _patternGroups
Group for patterns with any other kernel type. |
| private LocationPathPattern | _rootPattern
A reference to the pattern matching the root node. |
| private final Stylesheet | _stylesheet
A reference to the stylesheet object that owns this mode. |
| private Map | _templateIHs
A mapping between templates and instruction handles. |
| private Map | _templateILs
A mapping between templates and instruction lists. |
| private List | _templates
A vector of all the templates in this mode. |
| private TestSeq[] | _testSeq
Test sequence for patterns with any other kernel type. |
| Access | Constructor and Description |
|---|---|
| public | Mode(QName
A textual representation of the mode's QName name, Stylesheet The Stylesheet in which the mode occured stylesheet, String A suffix to append to the method name for this mode
(normally a sequence number - still in a String). suffix)Creates a new Mode. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | addPatternToGroup(final LocationPathPattern lpp)
Group patterns by NodeTests of their last Step Keep them sorted by priority within group |
| public void | |
| private void | |
| private void | |
| public void | |
| public void | compileApplyTemplates(ClassGenerator classGen)
Compiles the applyTemplates() method and adds it to the translet. |
| private InstructionList | compileDefaultRecursion(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next)
Compiles the default handling for DOM elements: traverse all children |
| private InstructionList | compileDefaultText(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next)
Compiles the default action for DOM text nodes and attribute nodes: output the node's text value |
| public static void | |
| private void | |
| private InstructionList | compileNamespaces(ClassGenerator classGen, MethodGenerator methodGen, boolean[] isNamespace, boolean[] isAttribute, boolean attrFlag, InstructionHandle defaultTarget)
|
| private void | compileTemplateCalls(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next, int min, int max)
|
| private void | |
| private void | completeTestSequences(int nodeType, List<LocationPathPattern> patterns)
Complete test sequences of a given type by adding all patterns from a given group. |
| private void | |
| public String | Returns: Method name for this modeReturns the name of the method (_not_ function) that will be compiled for this mode. |
| public String | |
| private String | |
| public Stylesheet | |
| public InstructionHandle | |
| private static boolean | |
| private static boolean | |
| private int | |
| private void | |
| private void | |
| public void | |
| private List |
| _attribNodeGroup | back to summary |
|---|---|
| private List<LocationPathPattern> _attribNodeGroup Group for patterns with node()-type kernel and attribute axis. | |
| _attribNodeTestSeq | back to summary |
|---|---|
| private TestSeq _attribNodeTestSeq Test sequence for patterns with node()-type kernel and attribute axis. | |
| _childNodeGroup | back to summary |
|---|---|
| private List<LocationPathPattern> _childNodeGroup Group for patterns with node()-type kernel and child axis. | |
| _childNodeTestSeq | back to summary |
|---|---|
| private TestSeq _childNodeTestSeq Test sequence for patterns with node()-type kernel and child axis. | |
| _currentIndex | back to summary |
|---|---|
| private int _currentIndex Variable index for the current node used in code generation. | |
| _idxGroup | back to summary |
|---|---|
| private List<LocationPathPattern> _idxGroup Group for patterns with id() or key()-type kernel. | |
| _idxTestSeq | back to summary |
|---|---|
| private TestSeq _idxTestSeq Test sequence for patterns with id() or key()-type kernel. | |
| _importLevels | back to summary |
|---|---|
| private Map<Integer, Integer> _importLevels Stores ranges of template precendences for the compilation of apply-imports. | |
| _keys | back to summary |
|---|---|
| private Map<String, Key> _keys A mapping between key names and keys. | |
| _methodName | back to summary |
|---|---|
| private final String _methodName The name of the method in which this mode is compiled. | |
| _name | back to summary |
|---|---|
| private final QName _name The name of this mode as defined in the stylesheet. | |
| _namedTemplates | back to summary |
|---|---|
| private Map<Template, Mode> _namedTemplates A mapping between named templates and Mode objects.
| |
| _neededTemplates | back to summary |
|---|---|
| private Map<Template, Object> _neededTemplates A mapping between templates and test sequences.
| |
| _patternGroups | back to summary |
|---|---|
| private List<LocationPathPattern>[] _patternGroups Group for patterns with any other kernel type. | |
| _rootPattern | back to summary |
|---|---|
| private LocationPathPattern _rootPattern A reference to the pattern matching the root node. | |
| _stylesheet | back to summary |
|---|---|
| private final Stylesheet _stylesheet A reference to the stylesheet object that owns this mode. | |
| _templateIHs | back to summary |
|---|---|
| private Map<Template, InstructionHandle> _templateIHs A mapping between templates and instruction handles. | |
| _templateILs | back to summary |
|---|---|
| private Map<Template, InstructionList> _templateILs A mapping between templates and instruction lists. | |
| _templates | back to summary |
|---|---|
| private List<Template> _templates A vector of all the templates in this mode. | |
| _testSeq | back to summary |
|---|---|
| private TestSeq[] _testSeq Test sequence for patterns with any other kernel type. | |
| Mode | back to summary |
|---|---|
| public Mode(QName name, Stylesheet stylesheet, String suffix) Creates a new Mode.
| |
| addPattern | back to summary |
|---|---|
| private void addPattern(int kernelType, LocationPathPattern pattern) Adds a pattern to a pattern group | |
| addPatternToGroup | back to summary |
|---|---|
| private void addPatternToGroup(final LocationPathPattern lpp) Group patterns by NodeTests of their last Step Keep them sorted by priority within group | |
| addTemplate | back to summary |
|---|---|
| public void addTemplate(Template template) | |
| appendTemplateCode | back to summary |
|---|---|
| private void appendTemplateCode(InstructionList body) | |
| appendTestSequences | back to summary |
|---|---|
| private void appendTestSequences(InstructionList body) | |
| compileApplyImports | back to summary |
|---|---|
public void compileApplyImports(ClassGenerator classGen, int min, int max)
| |
| compileApplyTemplates | back to summary |
|---|---|
| public void compileApplyTemplates(ClassGenerator classGen) Compiles the applyTemplates() method and adds it to the translet. This is the main dispatch method. | |
| compileDefaultRecursion | back to summary |
|---|---|
| private InstructionList compileDefaultRecursion(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) Compiles the default handling for DOM elements: traverse all children | |
| compileDefaultText | back to summary |
|---|---|
| private InstructionList compileDefaultText(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) Compiles the default action for DOM text nodes and attribute nodes: output the node's text value | |
| compileGetChildren | back to summary |
|---|---|
| public static void compileGetChildren(ClassGenerator classGen, MethodGenerator methodGen, int node) | |
| compileNamedTemplate | back to summary |
|---|---|
| private void compileNamedTemplate(Template template, ClassGenerator classGen) | |
| compileNamespaces | back to summary |
|---|---|
| private InstructionList compileNamespaces(ClassGenerator classGen, MethodGenerator methodGen, boolean[] isNamespace, boolean[] isAttribute, boolean attrFlag, InstructionHandle defaultTarget) | |
| compileTemplateCalls | back to summary |
|---|---|
| private void compileTemplateCalls(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next, int min, int max) | |
| compileTemplates | back to summary |
|---|---|
| private void compileTemplates(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) | |
| completeTestSequences | back to summary |
|---|---|
| private void completeTestSequences(int nodeType, List<LocationPathPattern> patterns) Complete test sequences of a given type by adding all patterns from a given group. | |
| flattenAlternative | back to summary |
|---|---|
| private void flattenAlternative(Pattern pattern, Template template, Map<String, Key> keys) This method will break up alternative patterns (ie. unions of patterns, such as match="A/B | C/B") and add the basic patterns to their respective pattern groups. | |
| functionName | back to summary |
|---|---|
| public String functionName() Returns the name of the method (_not_ function) that will be compiled for this mode. Normally takes the form 'applyTemplates()' or * 'applyTemplates2()'.
| |
| functionName | back to summary |
|---|---|
| public String functionName(int min, int max) | |
| getClassName | back to summary |
|---|---|
| private String getClassName() Shortcut to get the class compiled for this mode (will be inlined). | |
| getStylesheet | back to summary |
|---|---|
| public Stylesheet getStylesheet() | |
| getTemplateInstructionHandle | back to summary |
|---|---|
| public InstructionHandle getTemplateInstructionHandle(Template template) | |
| isAttributeName | back to summary |
|---|---|
| private static boolean isAttributeName(String qname) Auxiliary method to determine if a qname is an attribute. | |
| isNamespaceName | back to summary |
|---|---|
| private static boolean isNamespaceName(String qname) Auxiliary method to determine if a qname is a namespace qualified "*". | |
| partition | back to summary |
|---|---|
| private int partition(List<Template> templates, int p, int r) | |
| peepHoleOptimization | back to summary |
|---|---|
| private void peepHoleOptimization(MethodGenerator methodGen) Peephole optimization. | |
| prepareTestSequences | back to summary |
|---|---|
| private void prepareTestSequences() Build test sequences. The first step is to complete the test sequences by including patterns of "*" and "node()" kernel to all element test sequences, and of "@*" to all attribute test sequences. | |
| processPatterns | back to summary |
|---|---|
| public void processPatterns(Map<String, Key> keys) Process all the test patterns in this mode | |
| quicksort | back to summary |
|---|---|
| private List | |