Class PathQuery

java.lang.Object
jodd.json.PathQuery

public class PathQuery extends Object
Path query is used to match properties with some Path. Query is expressed in dot notation. Each term between the dots is a property name of a parent. Query may contains wildcard: '*' that can be used instead of a named term.

Included and excluded path matching works a bit differently. Included query matches all sub-paths. Excluded query is strict and match only paths with the same length.

  • Field Details

    • expression

      protected final String[] expression
    • wildcard

      protected final boolean wildcard
    • included

      protected final boolean included
  • Constructor Details

    • PathQuery

      public PathQuery(String expression, boolean included)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • matches

      public boolean matches(Path path)
      Returns true if path matches the query.
    • isWildcard

      public boolean isWildcard()
      Returns true if this query contains a wildcard.
    • isIncluded

      public boolean isIncluded()
      Returns true if this query indicates that matching properties should be included.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object