Package jodd.json

Class PathQuery


  • public class PathQuery
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String[] expression  
      protected boolean included  
      protected boolean wildcard  
    • Constructor Summary

      Constructors 
      Constructor Description
      PathQuery​(java.lang.String expression, boolean included)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      boolean isIncluded()
      Returns true if this query indicates that matching properties should be included.
      boolean isWildcard()
      Returns true if this query contains a wildcard.
      boolean matches​(Path path)
      Returns true if path matches the query.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • expression

        protected final java.lang.String[] expression
      • wildcard

        protected final boolean wildcard
      • included

        protected final boolean included
    • Constructor Detail

      • PathQuery

        public PathQuery​(java.lang.String expression,
                         boolean included)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object