# Class SelectorMatcher

java.lang.Object
org.eclipse.e4.ui.css.core.impl.engine.selector.SelectorMatcher

public final class SelectorMatcher extends Object
Matches a `Selectors.Selector` against an `Element`.

Every method is static; the matcher carries no state. Callers pass the element being tested plus an optional pseudo-element string (the same argument the SAC engine carried) so that pseudo-class matching can defer to the existing `CSSStylableElement.isPseudoInstanceOf(String)` contract.

Tag-name comparison is case sensitive, matching the existing SAC matcher (Phase 1 test `testTagNameCaseSensitivity` in `CSSEngineTest` locks this in). Pseudo-class semantics also follow the existing engine: the static-pseudo-instance carve-out from `CSSPseudoClassConditionImpl` is preserved so cascade behaviour does not shift.

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`matches(Selectors.Selector selector, Element element, String pseudoElement)`
`static boolean`
`matches(Selectors.Selector selector, Element element, String pseudoElement, Element[] hierarchy, int hierarchyIndex)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### matches

public static boolean matches(Selectors.Selector selector, Element element, String pseudoElement)

Returns:
  `true` if `selector` matches `element` for the given pseudo state.

### matches

public static boolean matches(Selectors.Selector selector, Element element, String pseudoElement, Element[] hierarchy, int hierarchyIndex)

Returns:
  `true` if `selector` matches `element` for the given pseudo state, using a pre-computed ancestor hierarchy array if available.