Class DeclaringTypeItemFilter
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.filter.DepthItemFilter
-
- org.apache.jackrabbit.vault.fs.filter.DeclaringTypeItemFilter
-
- All Implemented Interfaces:
Dumpable
,Filter
,ItemFilter
public class DeclaringTypeItemFilter extends DepthItemFilter
Filter that checks the declared type of an item
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.vault.fs.api.ItemFilter
ALL, NONE
-
-
Constructor Summary
Constructors Constructor Description DeclaringTypeItemFilter()
Default constructor.DeclaringTypeItemFilter(String nodeType, boolean propsOnly)
Creates a new filter for the given node type and flagsDeclaringTypeItemFilter(String nodeType, boolean propsOnly, int minDepth, int maxDepth)
Creates a new filter for the given node type and flags.
-
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 match the declaring one of the itemvoid
setPropsOnly(String propsOnly)
Sets the flag that indicates if only properties are to be checked.-
Methods inherited from class org.apache.jackrabbit.vault.fs.filter.DepthItemFilter
matches, setMaxDepth, setMinDepth
-
-
-
-
Constructor Detail
-
DeclaringTypeItemFilter
public DeclaringTypeItemFilter()
Default constructor.
-
DeclaringTypeItemFilter
public DeclaringTypeItemFilter(String nodeType, boolean propsOnly, int minDepth, int maxDepth)
Creates a new filter for the given node type and flags.- Parameters:
nodeType
- the node type name to checkpropsOnly
- iftrue
only properties are checkedminDepth
- the minimal depthmaxDepth
- the maximal depth
-
DeclaringTypeItemFilter
public DeclaringTypeItemFilter(String nodeType, boolean propsOnly)
Creates a new filter for the given node type and flags- Parameters:
nodeType
- the node type name to checkpropsOnly
- iftrue
only properties are checked
-
-
Method Detail
-
setNodeType
public void setNodeType(String nodeType)
Sets the node type to match the declaring one of the item- Parameters:
nodeType
- the node type
-
setPropsOnly
public void setPropsOnly(String propsOnly)
Sets the flag that indicates if only properties are to be checked.- Parameters:
propsOnly
- iftrue
only properties are checked.
-
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. Matches if the declaring node type of the item is equal to the one specified in this filter. If the item is a node andpropsOnly
flag istrue
it returnsfalse
.- 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
-
-