Class DepthItemFilter

    • Field Summary

      • Fields inherited from interface org.apache.jackrabbit.vault.fs.api.ItemFilter

        ALL, NONE
    • Constructor Summary

      Constructors 
      Constructor Description
      DepthItemFilter()
      Default constructor.
      DepthItemFilter​(int minDepth, int maxDepth)
      Creates a new depth filter for the given depths.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump​(DumpContext ctx, boolean isLast)
      Dumps some human readable information using the given context.
      boolean matches​(Item item)
      Returns true.
      boolean matches​(Item item, int depth)
      Checks if the given item matches this filters criteria.
      void setMaxDepth​(java.lang.String maxDepth)
      Sets the maximal depth
      void setMinDepth​(java.lang.String minDepth)
      Sets the minimal depth
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DepthItemFilter

        public DepthItemFilter()
        Default constructor.
      • DepthItemFilter

        public DepthItemFilter​(int minDepth,
                               int maxDepth)
        Creates a new depth filter for the given depths.
        Parameters:
        minDepth - the minimal depth
        maxDepth - the maximal depth
    • Method Detail

      • setMinDepth

        public void setMinDepth​(java.lang.String minDepth)
        Sets the minimal depth
        Parameters:
        minDepth - the minimal depth
      • setMaxDepth

        public void setMaxDepth​(java.lang.String maxDepth)
        Sets the maximal depth
        Parameters:
        maxDepth - the maximal depth
      • matches

        public boolean matches​(Item item,
                               int depth)
                        throws RepositoryException
        Checks if the given item matches this filters criteria. The given depth is relative to some invoker related depth and may not reflect the hierarchical depth of the item in the repository. It up to the implementation how to deal with this value. Matches if the given depth is greater or equal the minimum depth and less or equal the maximum depth and if the call to matches(Item) returns true.
        Specified by:
        matches in interface ItemFilter
        Parameters:
        item - the item to check
        depth - a relative depth.
        Returns:
        true if this filter matches the criteria; false otherwise.
        Throws:
        RepositoryException - if an error occurs.
      • matches

        public boolean matches​(Item item)
                        throws RepositoryException
        Returns true. Subclasses can override to implement something useful that is dependant of the depth.
        Parameters:
        item - the item to match
        Returns:
        true if the item matches; false otherwise.
        Throws:
        RepositoryException - if an error occurs.
      • dump

        public void dump​(DumpContext ctx,
                         boolean isLast)
        Dumps some human readable information using the given context.
        Specified by:
        dump in interface Dumpable
        Parameters:
        ctx - the dump context
        isLast - specifies if this is the last element to dump on this level