Interface ScimFilter

All Known Implementing Classes:
ScimFilter.And, ScimFilter.Comparison, ScimFilter.Not, ScimFilter.Or, ScimFilter.Present, ScimFilter.ValuePath

A bounded immutable SCIM filter syntax tree (RFC 7644 section 3.4.2.2). AND and OR are ordered, flattened n-ary nodes. NOT binds more tightly than AND, which binds more tightly than OR. ValuePath predicates describe one array element and cannot contain another ValuePath.

A successful syntax parse does not bind paths to schemas, validate attribute types, approve a filter policy, or authorize query execution. Applications must perform those checks before using a tree to select resources.

Parsed and schema-bound roots privately retain their bounded original expression for later receiving-provider checks. This text may contain personal data and grants no query permission. Equality is structural, with the path's ASCII case-insensitive equality and numeric-value literal equality. Explicit serialization contains the complete filter and may expose personal data; every diagnostic toString redacts it.

The six permitted node kinds are stable within a major version and may be matched exhaustively. Adding a node kind or an abstract visitor callback requires a major release.

Since:
1.0.0
  • Method Details

    • fromExpressionResult

      @CheckReturnValue static @NonNull ScimFilterParseResult fromExpressionResult(@NonNull String expression)
      Parses filter syntax under the shared immutable default limits.
      Parameters:
      expression - untrusted filter expression
      Returns:
      success or a fixed rejection with a UTF-16 expression offset
      Throws:
      NullPointerException - if expression is null
      Since:
      1.0.0
    • fromExpressionResult

      Parses filter syntax directly into a result, without exception-driven handling of malformed input. Bounds apply before recursive stack growth, AST construction and literal/number allocation. Depth covers retained AST levels as well as transient grouping/NOT/ValuePath nesting; nodes count the retained flattened tree, rather than discarded parentheses.
      Parameters:
      expression - untrusted filter expression
      limits - immutable limits
      Returns:
      syntax success or a fixed rejection with a UTF-16 expression offset
      Throws:
      NullPointerException - if either argument is null
      Since:
      1.0.0
    • accept

      @CheckReturnValue <R extends @NonNull Object> @NonNull R accept(@NonNull ScimFilterVisitor<@NonNull R> visitor)
      Dispatches this node to a Java 17 visitor. The visitor controls traversal.
      Type Parameters:
      R - nonnull result type
      Parameters:
      visitor - visitor
      Returns:
      the visitor's result
      Throws:
      NullPointerException - if visitor or its result is null
      Since:
      1.0.0
    • toScimString

      @CheckReturnValue @NonNull String toScimString()
      Emits a canonical filter with lowercase operators and minimal grouping. Strings use JSON escapes; numeric exponent notation remains compact and never expands an exponent into zeros. The output contains personal data and can exceed the original input-character limit after schema normalization. Rendering does not prove that this text fits a receiving parser's limits.
      Returns:
      canonical SCIM syntax, subject to receiving parser limits
      Since:
      1.0.0