Class CssParser

java.lang.Object
org.eclipse.e4.ui.css.core.impl.parser.CssParser

public final class CssParser extends Object
Recursive-descent CSS parser for the Eclipse engine's supported subset. It builds CSSStyleSheetImpl with CSSStyleRuleImpl / CSSImportRuleImpl rules, Selectors selector trees, and CssValues value records.

@media, @font-face and @page are parsed and discarded; !important is recorded on the declaration; @import is kept as an import rule.

  • Method Details

    • parseStyleSheet

      public static CSSStyleSheetImpl parseStyleSheet(String css)
      Parse a complete style sheet.
    • parseStyleDeclaration

      public static CSSStyleDeclaration parseStyleDeclaration(String style)
      Parse a standalone declaration list, e.g. "color: red; margin: 0".
    • parsePropertyValue

      public static CSSValue parsePropertyValue(String value)
      Parse a single property value, e.g. "1px 2px" or "#fff".
    • parseSelectors

      public static Selectors.SelectorList parseSelectors(String selectors)
      Parse a standalone selector group, e.g. for CSSEngine.parseSelectors.