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 void
dump(DumpContext ctx, boolean isLast)
Dumps some human readable information using the given context.boolean
matches(javax.jcr.Item item)
Returnstrue
.void
setNodeType(String nodeType)
Sets the node type to filter onvoid
setRespectSupertype(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(javax.jcr.Item item) throws javax.jcr.RepositoryException
Returnstrue
. Subclasses can override to implement something useful that is dependant of the depth. Returnstrue
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 returnstrue
if the items node type extends from the configured node type (Node.isNodeType() check).- Overrides:
matches
in classDepthItemFilter
- Parameters:
item
- the item to match- Returns:
true
if the item matches;false
otherwise.- Throws:
javax.jcr.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 interfaceDumpable
- Overrides:
dump
in classDepthItemFilter
- Parameters:
ctx
- the dump contextisLast
- specifies if this is the last element to dump on this level
-
-