|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.ConditionGroup
public class ConditionGroup
A group of query conditions.
A ConditionGroup is a container for Condition objects that are evaluated together as a group using the Boolean operator passed to the constructor. ConditionGroups may be nested such that each ConditionGroup is evaluated using the Boolean operator passed to the constructor.
| Constructor Summary | |
|---|---|
ConditionGroup(GroupOperators ops)
Constructs a ConditionGroup |
|
| Method Summary | |
|---|---|
void |
addCondition(Condition cond)
Adds a Condition to this group |
void |
addCondition(ElementDef field,
ComparisonOperators ops,
java.lang.String value)
Adds a condition to this group. |
void |
addCondition(java.lang.String xPath,
ComparisonOperators ops,
java.lang.String value)
Add a condition to this group using a deeply nested path. |
void |
addGroup(ConditionGroup group)
Adds a nested ConditionGroup to this group |
Condition[] |
getConditions()
Gets the conditions in this group. |
ConditionGroup[] |
getGroups()
Gets the nested ConditionGroups in this group. |
GroupOperators |
getOperator()
Gets the Boolean operator for joining all conditions in this group |
Condition |
hasCondition(ElementDef elementOrAttr)
Deprecated. Please use hasCondition(String) to support deeply nested
query conditions |
Condition |
hasCondition(java.lang.String xPath)
Tests if this ConditionGroup has a Condition for a specific XPath. |
boolean |
hasConditions()
Determines if there are any conditions in this group, including any nested ConditionGroups |
int |
size()
Gets the number of conditions in this group. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConditionGroup(GroupOperators ops)
ops - The Boolean operator to use when joining conditions in this
group; either Condition.AND or Condition.OR| Method Detail |
|---|
public GroupOperators getOperator()
Condition.AND)public Condition[] getConditions()
public ConditionGroup[] getGroups()
public void addCondition(Condition cond)
cond - The condition to add to this group of conditions
public void addCondition(ElementDef field,
ComparisonOperators ops,
java.lang.String value)
This method of adding conditions is convenient for adding conditions involving
root attributes or elements to a query. If you need to add conditions on deeply
nested elements, use addCondition(String, ComparisonOperators, String)
field - The metadata element that represents the field, such as
StudentDTD.STUDENTPERSONAL_REFIDops - The ComparisonOperator to use for this query conditionvalue - The value to compare to this field using the comparison operator
public void addCondition(java.lang.String xPath,
ComparisonOperators ops,
java.lang.String value)
To ensure your code works with all versions of SIF, you should use
addCondition(ElementDef, ComparisonOperators, String) whenever possible.
xPath - The XPath representation of this fieldops - The ComparisonOperator to applyvalue - The value to compare the field topublic void addGroup(ConditionGroup group)
group - The ConditionGropu to add to this grouppublic boolean hasConditions()
public Condition hasCondition(ElementDef elementOrAttr)
hasCondition(String) to support deeply nested
query conditions
elementOrAttr - The ElementDef constant from the SIFDTD class that
identifies the specific attribute or element to search for
null if the group
does not contain a Condition for the specified element or attributepublic Condition hasCondition(java.lang.String xPath)
xPath - The xPath representation of the query field. e.g. "Name/FirstName"
null if the root
condition group does not contain a Condition for the specified path.public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||