Package org.htmlunit

# Class WebClient.PooledCSS3Parser

java.lang.Object
org.htmlunit.cssparser.parser.AbstractCSSParser
org.htmlunit.cssparser.parser.javacc.CSS3Parser
org.htmlunit.WebClient.PooledCSS3Parser

All Implemented Interfaces:
  `AutoCloseable`, `org.htmlunit.cssparser.parser.javacc.CSS3ParserConstants`

Enclosing class:
  `WebClient`

public static class WebClient.PooledCSS3Parser extends org.htmlunit.cssparser.parser.javacc.CSS3Parser implements AutoCloseable
This is a poolable CSS3Parser which can be reused automatically when closed. A regular CSS3Parser is not thread-safe, hence also our pooled parser is not thread-safe. INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

- ## Field Summary

  ### Fields inherited from class org.htmlunit.cssparser.parser.javacc.CSS3Parser

  `jj_nt, token, token_source`

  ### Fields inherited from interface org.htmlunit.cssparser.parser.javacc.CSS3ParserConstants

  `A_LETTER, AND, ANGLE_DEG, ANGLE_GRAD, ANGLE_RAD, ANGLE_TURN, ASTERISK, ATKEYWORD, C_LETTER, CDC, CDO, CH, CHARSET_SYM, COLON, COMMA, COMMENT, COMMENT_, CUSTOM_PROPERTY_NAME, D_LETTER, DASHMATCH, DEFAULT, DIMENSION, DOT, E_LETTER, EMS, EOF, EQUALS, ESCAPE, EXS, F_LETTER, FONT_FACE_SYM, FREQ_HZ, FREQ_KHZ, FROM, FUNCTION, FUNCTION_CALC, FUNCTION_HSL, FUNCTION_HWB, FUNCTION_LAB, FUNCTION_LANG, FUNCTION_LCH, FUNCTION_NOT, FUNCTION_RGB, FUNCTION_VAR, G_LETTER, GREATER, H, H_LETTER, H_PLACEHOLDER, HASH, HNUM, I_LETTER, IDENT, IMPORT_SYM, IMPORTANT_SYM, INCLUDES, INHERIT, K_LETTER, L_LETTER, LBRACE, LENGTH_CM, LENGTH_IN, LENGTH_MM, LENGTH_PC, LENGTH_PT, LENGTH_PX, LENGTH_Q, LROUND, LSQUARE, M_LETTER, MEDIA_SYM, MINUS, N_LETTER, NAME, NL, NMCHAR, NMSTART, NONASCII, NONE, NOT, NUM, NUMBER, O_LETTER, ONLY, P_LETTER, PAGE_SYM, PERCENTAGE, PLUS, PREFIXMATCH, R_LETTER, RBRACE, REM, RESOLUTION_DPCM, RESOLUTION_DPI, RROUND, RSQUARE, S, S_LETTER, SEMICOLON, SLASH, STRING, STRING1, STRING2, SUBSTRINGMATCH, SUFFIXMATCH, T_LETTER, TILDE, TIME_MS, TIME_S, tokenImage, U_LETTER, UNICODE, UNICODE_RANGE, UNKNOWN, URI, URL, VH, VMAX, VMIN, VW, X_LETTER, Z_LETTER`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `PooledCSS3Parser(org.htmlunit.WebClient.CSS3ParserPool pool)`
  Create a new poolable parser.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Implements the AutoClosable interface.
  `protected WebClient.PooledCSS3Parser`
  `markInUse(org.htmlunit.WebClient.CSS3ParserPool pool)`
  Resets the parser's pool state so it can be safely returned again.

  ### Methods inherited from class org.htmlunit.cssparser.parser.javacc.CSS3Parser

  `_class, angle, attrib, calc, calcNumberProduct, calcNumberSum, calcNumberValue, calcProduct, calcSum, calcValue, charsetRule, combinator, declaration, dimension, disable_tracing, elementName, enable_tracing, expr, fontFaceRule, function, generateParseException, getGrammarUri, getNextToken, getParserVersion, getToken, hash, hexcolor, hslColor, hwbColor, ident, identExcludingInherit, identExcludingOnly, importRule, labColor, lchColor, mediaExpression, mediaList, mediaQuery, mediaRule, mediaRuleList, medium, number, operator, pageRule, pageSelector, pageSelectorList, parseSelectorsInternal, percentage, prio, pseudo, pseudoPage, ReInit, ReInit, rgbColor, selector, selectorList, simpleSelector, styleDeclaration, styleRule, styleSheet, styleSheetRuleList, styleSheetRuleSingle, term, trace_enabled, unaryOperator, unicodeRange, unknownAtRule, var`

  ### Methods inherited from class org.htmlunit.cssparser.parser.AbstractCSSParser

  `addEscapes, createLocator, createSkipWarning, doubleValue, functionInternal, getDocumentHandler, getErrorHandler, getInputSource, getLastNumPos, getParserMessage, handleCharset, handleEndDocument, handleEndFontFace, handleEndMedia, handleEndPage, handleEndSelector, handleIgnorableAtRule, handleImportStyle, handleProperty, handleStartDocument, handleStartFontFace, handleStartMedia, handleStartPage, handleStartSelector, hexColorInternal, hslColorInternal, hwbColorInternal, intValue, labColorInternal, lchColorInternal, normalizeAndValidatePagePseudoClass, parseMedia, parsePriority, parsePropertyValue, parseRule, parseSelectors, parseStyleDeclaration, parseStyleSheet, rgbColorInternal, setDocumentHandler, setErrorHandler, toCSSParseException, toCSSParseException, toCSSParseException, toCSSParseException, unescape`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### PooledCSS3Parser

    protected PooledCSS3Parser(org.htmlunit.WebClient.CSS3ParserPool pool)
    Create a new poolable parser.
    Parameters:
      `pool` - the pool the parser should return to when it is closed

- ## Method Details

  - ### markInUse

    protected WebClient.PooledCSS3Parser markInUse(org.htmlunit.WebClient.CSS3ParserPool pool)
    Resets the parser's pool state so it can be safely returned again.
    Parameters:
      `pool` - the pool the parser should return to when it is closed
    Returns:
      this parser for fluid programming

  - ### close

    public void close()
    Implements the AutoClosable interface. The return method ensures that we are notified when we incorrectly close it twice which indicates a programming flow defect.
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `IllegalStateException` - in case the parser is closed several times