jodd-lagarto/src/main/java/jodd/csselly/CSSelly.java
public List<CssSelector> parse() {
		try {
			lexer.yylex();
			if (lexer.selectors.isEmpty()) {
				return null;
			}

			// fixes last combinator
			CssSelector last = lexer.selectors.get(lexer.selectors.size() - 1);
			if (last.getCombinator() == Combinator.DESCENDANT) {
				last.setCombinator(null);
			}

			// set previous css selector
			CssSelector prevCssSelector = null;
			for (CssSelector cssSelector : lexer.selectors) {
				if (prevCssSelector != null) {
					cssSelector.setPrevCssSelector(prevCssSelector);
				}
				prevCssSelector = cssSelector;
			}

			return lexer.selectors;
		} catch (IOException ioex) {
			throw new CSSellyException(ioex);
		}
	}
public List<CssSelector> parse() {
		try {
			lexer.yylex();
			if (lexer.selectors.isEmpty()) {
				return null;
			}

			// fixes last combinator
			CssSelector last = lexer.selectors.get(lexer.selectors.size() - 1);
			if (last.getCombinator() == Combinator.DESCENDANT) {
				last.setCombinator(null);
			}

			// set previous css selector
			CssSelector prevCssSelector = null;
			for (CssSelector cssSelector : lexer.selectors) {
				if (prevCssSelector != null) {
					cssSelector.setPrevCssSelector(prevCssSelector);
				}
				prevCssSelector = cssSelector;
			}

			return lexer.selectors;
		} catch (IOException ioex) {
			throw new CSSellyException(ioex);
		}
	}
public List < CssSelector > parse ( ) { try { lexer . yylex ( ) ; if ( lexer . selectors . isEmpty ( ) ) { return null ; } // fixes last combinator CssSelector last = lexer . selectors . get ( lexer . selectors . size ( ) - 1 ) ; if ( last . getCombinator ( ) == Combinator . DESCENDANT ) { last . setCombinator ( null ) ; } // set previous css selector CssSelector prevCssSelector = null ; for ( CssSelector cssSelector : lexer . selectors ) { if ( prevCssSelector != null ) { cssSelector . setPrevCssSelector ( prevCssSelector ) ; } prevCssSelector = cssSelector ; } return lexer . selectors ; } catch ( IOException ioex ) { throw new CSSellyException ( ioex ) ; } }
Parses selector string.
Returns <code>null</code> if no selector can be parsed.
Parses selector string . Returns <code > null< / code > if no selector can be parsed .