# Class ExtendedAccessLogValve.PatternTokenizer

java.lang.Object
org.apache.catalina.valves.ExtendedAccessLogValve.PatternTokenizer

Enclosing class:
  `ExtendedAccessLogValve`

protected static class ExtendedAccessLogValve.PatternTokenizer extends Object
Tokenizer for parsing the log pattern string.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PatternTokenizer(String str)`
  Creates a new tokenizer for the given pattern string.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getParameter()`
  Returns the parameter value from the most recent parameter token.
  `String`
  `getRemains()`
  Returns the remaining unparsed portion of the pattern string.
  `String`
  `getToken()`
  Returns the next token from the pattern string.
  `String`
  `getWhiteSpaces()`
  Returns any whitespace following the current position.
  `boolean`
  `hasParameter()`
  Returns whether the last token was followed by a parameter indicator.
  `boolean`
  `hasSubToken()`
  Returns whether the last token was followed by a sub-token indicator.
  `boolean`
  `isEnded()`
  Returns whether the tokenizer has reached the end of the pattern string.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### PatternTokenizer

    public PatternTokenizer(String str)
    Creates a new tokenizer for the given pattern string.
    Parameters:
      `str` - the pattern string to tokenize

- ## Method Details

  - ### hasSubToken

    public boolean hasSubToken()
    Returns whether the last token was followed by a sub-token indicator.
    Returns:
      `true` if the last token had a sub-token

  - ### hasParameter

    public boolean hasParameter()
    Returns whether the last token was followed by a parameter indicator.
    Returns:
      `true` if the last token had a parameter

  - ### getToken

    public String getToken() throws IOException
    Returns the next token from the pattern string.
    Returns:
      the next token, or `null` if no more tokens are available
    Throws:
      `IOException` - if an I/O error occurs

  - ### getParameter

    public String getParameter() throws IOException
    Returns the parameter value from the most recent parameter token.
    Returns:
      the parameter value, or `null` if no parameter is available
    Throws:
      `IOException` - if an I/O error occurs

  - ### getWhiteSpaces

    public String getWhiteSpaces() throws IOException
    Returns any whitespace following the current position.
    Returns:
      the whitespace characters, or an empty string if none
    Throws:
      `IOException` - if an I/O error occurs

  - ### isEnded

    public boolean isEnded()
    Returns whether the tokenizer has reached the end of the pattern string.
    Returns:
      `true` if the end has been reached

  - ### getRemains

    public String getRemains() throws IOException
    Returns the remaining unparsed portion of the pattern string.
    Returns:
      the remaining characters in the pattern
    Throws:
      `IOException` - if an I/O error occurs