Package: groovy.console.ui.text

## [Java] Class StructuredSyntaxDocumentFilter.LexerNode

- groovy.console.ui.text.StructuredSyntaxDocumentFilter.LexerNode

-     public final class StructuredSyntaxDocumentFilter.LexerNode
      extends Object

  Regex-driven lexer node that applies styles and nested lexers.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Style` | `getDefaultStyle()` Returns the fallback style for unmatched text.
    `` | `public boolean` | `isInitialized()` Returns: true if initialised
    `` | `public void` | `parse(CharBuffer buffer, int offset, int length)` Parses the supplied buffer and applies styles to matching ranges.
    `` | `public void` | `putChild(String regexp, StructuredSyntaxDocumentFilter.LexerNode node)` Registers a child lexer for matches of the supplied expression.
    `` | `public void` | `putChild(String[] regexps, StructuredSyntaxDocumentFilter.LexerNode node)` Registers a child lexer for matches of any supplied expression.
    `` | `public void` | `putStyle(String regexp, Style style)` Associates a style with matches of the supplied expression.
    `` | `public void` | `putStyle(String[] regexps, Style style)` Associates a style with matches of any supplied expression.
    `` | `public void` | `removeChild(String regexp)` Removes the child lexer registered for the supplied expression.
    `` | `public void` | `removeStyle(String regexp)` Removes the style associated with the supplied expression.
    `` | `public void` | `removeStyle(String[] regexps)` Removes the style associated with any of the supplied expressions.
    `` | `public void` | `setDefaultStyle(Style style)` Sets the fallback style for unmatched text.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public Style getDefaultStyle()

      Returns the fallback style for unmatched text.

      Returns:
        the default style

    - #### public boolean isInitialized()

      Returns:
        true if initialised

    - #### public void parse(CharBuffer buffer, int offset, int length)

      Parses the supplied buffer and applies styles to matching ranges.

      throws:
        BadLocationException if document positions cannot be resolved
      Parameters:
        `buffer` - the character buffer to parse
        `offset` - the starting offset
        `length` - the number of characters to parse

    - #### public void putChild(String regexp, StructuredSyntaxDocumentFilter.LexerNode node)

      Registers a child lexer for matches of the supplied expression.

      Parameters:
        `regexp` - the expression to match
        `node` - the child lexer to apply within matching text

    - #### public void putChild(String[] regexps, StructuredSyntaxDocumentFilter.LexerNode node)

      Registers a child lexer for matches of any supplied expression.

      Parameters:
        `regexps` - the expressions to match
        `node` - the child lexer to apply within matching text

    - #### public void putStyle(String regexp, Style style)

      Associates a style with matches of the supplied expression.

      Parameters:
        `regexp` - the expression to match
        `style` - the style to apply

    - #### public void putStyle(String[] regexps, Style style)

      Associates a style with matches of any supplied expression.

      Parameters:
        `regexps` - the expressions to match
        `style` - the style to apply

    - #### public void removeChild(String regexp)

      Removes the child lexer registered for the supplied expression.

      Parameters:
        `regexp` - the expression whose child lexer should be removed

    - #### public void removeStyle(String regexp)

      Removes the style associated with the supplied expression.

      Parameters:
        `regexp` - the expression whose style should be removed

    - #### public void removeStyle(String[] regexps)

      Removes the style associated with any of the supplied expressions.

      Parameters:
        `regexps` - the expressions whose combined style should be removed

    - #### public void setDefaultStyle(Style style)

      Sets the fallback style for unmatched text.

      Parameters:
        `style` - the default style to use