// Javadoc inherited.
public void visit(CombinedSelector selector) {
// Visit the left which is the contextual selector.
selector.getContext().accept(this);
Matcher context = constructedMatcher;
final CombinatorEnum combinator = selector.getCombinator();
Operator operator = null;
if (combinator == CombinatorEnum.DESCENDANT) {
operator = Operator.DESCENDANT;
} else if (combinator == CombinatorEnum.CHILD) {
operator = Operator.CHILD;
} else if (combinator == CombinatorEnum.INDIRECT_ADJACENT) {
operator = Operator.SIBLING;
} else if (combinator == CombinatorEnum.DIRECT_ADJACENT) {
operator = Operator.ADJACENT;
} else {
throw new IllegalStateException("Unknown combinator " + combinator);
}
// Visit the right selector which is the subject selector.
selector.getSubject().accept(this);
Matcher subject = constructedMatcher;
// Construct the composite matcher.
constructedMatcher = factory.createCompositeMatcher(
context, subject, operator, builderContext);
}