/** * 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. */ private void flattenAlternative(Pattern pattern, Template template, Hashtable keys) { // Patterns on type id() and key() are special since they do not have // any kernel node type (it can be anything as long as the node is in // the id's or key's index). if (pattern instanceof IdKeyPattern) { final IdKeyPattern idkey = (IdKeyPattern)pattern; idkey.setTemplate(template); if (_idxGroup == null) _idxGroup = new Vector(); _idxGroup.add(pattern); } // Alternative patterns are broken up and re-processed recursively else if (pattern instanceof AlternativePattern) { final AlternativePattern alt = (AlternativePattern)pattern; flattenAlternative(alt.getLeft(), template, keys); flattenAlternative(alt.getRight(), template, keys); } // Finally we have a pattern that can be added to a test sequence! else if (pattern instanceof LocationPathPattern) { final LocationPathPattern lpp = (LocationPathPattern)pattern; lpp.setTemplate(template); addPatternToGroup(lpp); } }
/** * 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. */ private void flattenAlternative(Pattern pattern, Template template, Hashtable keys) { // Patterns on type id() and key() are special since they do not have // any kernel node type (it can be anything as long as the node is in // the id's or key's index). if (pattern instanceof IdKeyPattern) { final IdKeyPattern idkey = (IdKeyPattern)pattern; idkey.setTemplate(template); if (_idxGroup == null) _idxGroup = new Vector(); _idxGroup.add(pattern); } // Alternative patterns are broken up and re-processed recursively else if (pattern instanceof AlternativePattern) { final AlternativePattern alt = (AlternativePattern)pattern; flattenAlternative(alt.getLeft(), template, keys); flattenAlternative(alt.getRight(), template, keys); } // Finally we have a pattern that can be added to a test sequence! else if (pattern instanceof LocationPathPattern) { final LocationPathPattern lpp = (LocationPathPattern)pattern; lpp.setTemplate(template); addPatternToGroup(lpp); } }
/** * 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. */ private void flattenAlternative(Pattern pattern, Template template, Hashtable keys) { // Patterns on type id() and key() are special since they do not have // any kernel node type (it can be anything as long as the node is in // the id's or key's index). if (pattern instanceof IdKeyPattern) { final IdKeyPattern idkey = (IdKeyPattern)pattern; idkey.setTemplate(template); if (_idxGroup == null) _idxGroup = new Vector(); _idxGroup.add(pattern); } // Alternative patterns are broken up and re-processed recursively else if (pattern instanceof AlternativePattern) { final AlternativePattern alt = (AlternativePattern)pattern; flattenAlternative(alt.getLeft(), template, keys); flattenAlternative(alt.getRight(), template, keys); } // Finally we have a pattern that can be added to a test sequence! else if (pattern instanceof LocationPathPattern) { final LocationPathPattern lpp = (LocationPathPattern)pattern; lpp.setTemplate(template); addPatternToGroup(lpp); } }
/** * 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. */ private void flattenAlternative(Pattern pattern, Template template, Hashtable keys) { // Patterns on type id() and key() are special since they do not have // any kernel node type (it can be anything as long as the node is in // the id's or key's index). if (pattern instanceof IdKeyPattern) { final IdKeyPattern idkey = (IdKeyPattern)pattern; idkey.setTemplate(template); if (_idxGroup == null) _idxGroup = new Vector(); _idxGroup.add(pattern); } // Alternative patterns are broken up and re-processed recursively else if (pattern instanceof AlternativePattern) { final AlternativePattern alt = (AlternativePattern)pattern; flattenAlternative(alt.getLeft(), template, keys); flattenAlternative(alt.getRight(), template, keys); } // Finally we have a pattern that can be added to a test sequence! else if (pattern instanceof LocationPathPattern) { final LocationPathPattern lpp = (LocationPathPattern)pattern; lpp.setTemplate(template); addPatternToGroup(lpp); } }