Class SpelQueryContext.SpelExtractor

java.lang.Object
org.springframework.data.repository.query.SpelQueryContext.SpelExtractor
Enclosing class:
SpelQueryContext

public class SpelQueryContext.SpelExtractor extends Object
Parses a query string, identifies the contained SpEL expressions, replaces them with bind parameters and offers a Map from those bind parameters to the SpEL expression.

The parser detects quoted parts of the query string and does not detect SpEL expressions inside such quoted parts of the query.

Since:
2.1
Author:
Jens Schauder, Oliver Gierke, Mark Paluch
  • Method Details

    • getQueryString

      public String getQueryString()
      The query with all the SpEL expressions replaced with bind parameters.
      Returns:
      Guaranteed to be not null.
    • isQuoted

      public boolean isQuoted(int index)
      Return whether the query at index is quoted.
      Parameters:
      index -
      Returns:
      true if quoted; false otherwise.
    • getParameter

      public String getParameter(String name)
    • size

      public int size()
      Returns the number of expressions in this extractor.
      Returns:
      the number of expressions in this extractor.
      Since:
      3.0.9