Class NodeTypeItemFilter

java.lang.Object
org.apache.jackrabbit.vault.fs.filter.DepthItemFilter
org.apache.jackrabbit.vault.fs.filter.NodeTypeItemFilter
All Implemented Interfaces:
Dumpable, Filter, ItemFilter

public class NodeTypeItemFilter extends DepthItemFilter
Filters on the node type of a node.
  • Constructor Details

    • NodeTypeItemFilter

      public NodeTypeItemFilter()
      Default constructor
    • NodeTypeItemFilter

      public NodeTypeItemFilter(String nodeType, boolean respectSupertype, int minDepth, int maxDepth)
      Creates a new node type filter.
      Parameters:
      nodeType - the node type to filter on
      respectSupertype - indicates if super type should be respected
      minDepth - the minimal depth
      maxDepth - the maximal depth
    • NodeTypeItemFilter

      public NodeTypeItemFilter(String nodeType, boolean respectSupertype)
      Creates a new node type filter.
      Parameters:
      nodeType - the node type to filter on
      respectSupertype - indicates if super type should be respected
  • Method Details

    • setNodeType

      public void setNodeType(String nodeType)
      Sets the node type to filter on
      Parameters:
      nodeType - the node type
    • setRespectSupertype

      public void setRespectSupertype(String respectSupertype)
      Sets the flag that indicates if super type should be respected.
      Parameters:
      respectSupertype - if true, super types are respected.
    • matches

      public boolean matches(Item item) throws RepositoryException
      Returns true. Subclasses can override to implement something useful that is dependant of the depth. Returns true if the item is a node and if the configured node type is equal to the primary type of the node. if super types are respected it also returns true if the items node type extends from the configured node type (Node.isNodeType() check).
      Overrides:
      matches in class DepthItemFilter
      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
      Overrides:
      dump in class DepthItemFilter
      Parameters:
      ctx - the dump context
      isLast - specifies if this is the last element to dump on this level