EscapeQuerySyntaxImpl (Lucene 10.5.0 queryparser API)
Description: declaration: package: org.apache.lucene.queryparser.flexible.standard.parser, class: EscapeQuerySyntaxImpl

Package org.apache.lucene.queryparser.flexible.standard.parser

# Class EscapeQuerySyntaxImpl

java.lang.Object
org.apache.lucene.queryparser.flexible.standard.parser.EscapeQuerySyntaxImpl

All Implemented Interfaces:
  `EscapeQuerySyntax`

public class EscapeQuerySyntaxImpl extends Object implements EscapeQuerySyntax
Implementation of `EscapeQuerySyntax` for the standard lucene syntax.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax

  `EscapeQuerySyntax.Type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EscapeQuerySyntaxImpl()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static UnescapedCharSequence`
  `discardEscapeChar(CharSequence input)`
  Returns a String where the escape char has been removed, or kept only once if there was a double escape.
  `CharSequence`
  `escape(CharSequence text, Locale locale, EscapeQuerySyntax.Type type)`

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

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

- ## Constructor Details

  - ### EscapeQuerySyntaxImpl

    public EscapeQuerySyntaxImpl()

- ## Method Details

  - ### escape

    public CharSequence escape(CharSequence text, Locale locale, EscapeQuerySyntax.Type type)
    Specified by:
      `escape` in interface `EscapeQuerySyntax`
    Parameters:
      `text` - - text to be escaped
      `locale` - - locale for the current query
      `type` - - select the type of escape operation to use
    Returns:
      escaped text

  - ### discardEscapeChar

    public static UnescapedCharSequence discardEscapeChar(CharSequence input) throws ParseException
    Returns a String where the escape char has been removed, or kept only once if there was a double escape.

    Supports escaped Unicode characters, e.g. translates `\u0041` to `A`.

    Throws:
      `ParseException`