public abstract class FilterSet<E extends Filter> extends java.lang.Object implements Dumpable
Additionally it contains a "root" path for which the filters are evaluated. if an item has not the node addressed by the root path as ancestor, it is always excluded.
Modifier and Type | Class and Description |
---|---|
static class |
FilterSet.Entry<E extends Filter>
Holds a filter entry
|
Constructor and Description |
---|
FilterSet()
Default constructor.
|
FilterSet(java.lang.String root)
Creates a new item filter set and sets the respective root path
|
Modifier and Type | Method and Description |
---|---|
FilterSet |
addAll(FilterSet<E> set)
Adds (replaces) all entries from the given set to this one.
|
FilterSet |
addExclude(E filter)
Adds a new item filter as excluded entry.
|
FilterSet |
addInclude(E filter)
Adds a new item filter as included entry.
|
boolean |
covers(java.lang.String path)
Checks if the given item is covered by this filter set.
|
void |
dump(DumpContext ctx,
boolean isLast)
Dumps some human readable information using the given context.
|
boolean |
equals(java.lang.Object o) |
java.util.List<FilterSet.Entry<E>> |
getEntries()
Returns the list of entries
|
ImportMode |
getImportMode()
Returns the import mode that is specified for this filter set.
|
java.lang.String |
getRoot()
Returns the root path
|
int |
hashCode() |
boolean |
isAncestor(java.lang.String path)
Checks if the given item is an ancestor of the root node.
|
boolean |
isEmpty()
Checks if this filter set has any entries defined.
|
boolean |
isSealed()
Checks if this filter set is sealed.
|
FilterSet |
seal()
Seals this list, i.e.
|
void |
setImportMode(ImportMode mode)
Sets the import mode.
|
void |
setRoot(java.lang.String path)
Sets the root path
|
public FilterSet()
public FilterSet(java.lang.String root)
root
- pathpublic java.lang.String getRoot()
public void setRoot(java.lang.String path)
path
- root pathpublic ImportMode getImportMode()
ImportMode.REPLACE
.public void setImportMode(ImportMode mode)
mode
- import modepublic FilterSet seal()
public boolean isSealed()
true
if sealed.public FilterSet addAll(FilterSet<E> set)
set
- the set of entriesthis
suitable for chaining.public FilterSet addInclude(E filter)
filter
- the filterthis
suitable for chaining.public FilterSet addExclude(E filter)
filter
- the filterthis
suitable for chaining.public java.util.List<FilterSet.Entry<E>> getEntries()
public boolean isEmpty()
true
if emptypublic boolean covers(java.lang.String path)
root
path is an ancestor of the given item.path
- path of the itemtrue
if this set covers the given itempublic boolean isAncestor(java.lang.String path)
path
- path of the item to checktrue
if the given item is an ancestorpublic void dump(DumpContext ctx, boolean isLast)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"