Exemple #1
0
  @Override
  public Set<Branch> check(Set<Branch> nodes) throws NodeSelectorException {
    Assert.notNull(nodes, "nodes is null!");
    this.nodes = nodes;
    result = new LinkedHashSet<Branch>();
    switch (selector.getCombinator()) {
      case DESCENDANT:
        getDescentantElements();
        break;
      case CHILD:
        getChildElements();
        break;
      case ADJACENT_SIBLING:
        getAdjacentSiblingElements();
        break;
      case GENERAL_SIBLING:
        getGeneralSiblingElements();
        break;
    }

    return result;
  }
Exemple #2
0
 public TagChecker(Selector selector) {
   Assert.notNull(selector, "selector is null!");
   this.selector = selector;
 }