public class ContextFilteringRules
extends java.lang.Object
A structure representing a set of context property filtering rules. Contains an list of ContextFilterRule objects; The order of the objects is immaterial. Objects of this type can fall into one of the two categories, one a global rule which is a single rule for filtering and does not refer to specific membership contexts, second an array of context specific rules.
Filtering constraints can be added to an application's repository query through the
QueryBuilder.addContextMembershipFilters(Query, ContextFilteringRules)
method or
as a post-processing step on the results. One can use the RepositoryItemContextFilter
class to filter an array of RepositoryItems. Note that post filtering is much less efficient than repository filtering.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
ContextFilteringRules(ContextFilteringRule[] pRules) |
ContextFilteringRules(GlobalContextType pGlobalContextType) |
Modifier and Type | Method and Description |
---|---|
void |
addRule(ContextFilteringRule pContextFilteringRule)
Adds the specified ContextFilteringRule to the end of the list of
filtering rules.
|
ContextFilteringRules |
copy()
Returns a deep copy of this object
|
boolean |
equals(java.lang.Object obj)
Returns true if the given ContextFilteringRules has same number of
elements as this one and each individual ContextFilteringRule object
in the given ContextFilteringRules equals (via its equals method) the
corresponding ContextFilteringRule in this ContextFilteringRules object.
|
RepositoryItem[] |
filter(RepositoryItem[] pItems)
Filter elements based on context membership property value.
|
GlobalContextType |
getGlobalContextType() |
int |
getNumRules()
Returns the number of filtering rules.
|
ContextFilteringRule |
getRule(int pIndex)
Returns the filtering rule at the specified index.
|
int |
hashCode()
Return an integer hash code for this object
|
boolean |
isEmpty()
Returns true if there are no ContextFilteringRules rules.
|
boolean |
isGlobal()
Is this rules object a global rule as opposed to a rules comprised of other
ContextFilteringRule objects.
|
void |
removeRule(ContextFilteringRule pContextFilteringRule)
Removes the filtering rule at the specified index.
|
java.lang.String |
toString()
Returns the string representation of the object.
|
java.lang.String |
toString(java.lang.String pIndent)
Returns the string representation of the object, indenting the
text using the specified pIndent string.
|
public ContextFilteringRules(ContextFilteringRule[] pRules)
public ContextFilteringRules(GlobalContextType pGlobalContextType)
public boolean isGlobal()
public GlobalContextType getGlobalContextType()
public ContextFilteringRules copy()
public boolean isEmpty()
public int getNumRules()
public ContextFilteringRule getRule(int pIndex)
public void addRule(ContextFilteringRule pContextFilteringRule)
public void removeRule(ContextFilteringRule pContextFilteringRule)
public java.lang.String toString(java.lang.String pIndent)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public RepositoryItem[] filter(RepositoryItem[] pItems) throws RepositoryException
pItems
- RepositoryException
public java.lang.String toString()
toString
in class java.lang.Object