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.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.vault.fs.api.ItemFilter
ALL, NONE
-
-
Constructor Summary
Constructors Constructor Description NodeTypeItemFilter()Default constructorNodeTypeItemFilter(String nodeType, boolean respectSupertype)Creates a new node type filter.NodeTypeItemFilter(String nodeType, boolean respectSupertype, int minDepth, int maxDepth)Creates a new node type filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(DumpContext ctx, boolean isLast)Dumps some human readable information using the given context.booleanmatches(Item item)Returnstrue.voidsetNodeType(String nodeType)Sets the node type to filter onvoidsetRespectSupertype(String respectSupertype)Sets the flag that indicates if super type should be respected.-
Methods inherited from class org.apache.jackrabbit.vault.fs.filter.DepthItemFilter
matches, setMaxDepth, setMinDepth
-
-
-
-
Constructor Detail
-
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 onrespectSupertype- indicates if super type should be respectedminDepth- the minimal depthmaxDepth- the maximal depth
-
NodeTypeItemFilter
public NodeTypeItemFilter(String nodeType, boolean respectSupertype)
Creates a new node type filter.- Parameters:
nodeType- the node type to filter onrespectSupertype- indicates if super type should be respected
-
-
Method Detail
-
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- iftrue, super types are respected.
-
matches
public boolean matches(Item item) throws RepositoryException
Returnstrue. Subclasses can override to implement something useful that is dependant of the depth. Returnstrueif 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 returnstrueif the items node type extends from the configured node type (Node.isNodeType() check).- Overrides:
matchesin classDepthItemFilter- Parameters:
item- the item to match- Returns:
trueif the item matches;falseotherwise.- 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:
dumpin interfaceDumpable- Overrides:
dumpin classDepthItemFilter- Parameters:
ctx- the dump contextisLast- specifies if this is the last element to dump on this level
-
-