| 
WPI GDC CMS 0.0.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.wpi.gdc.cms.db.Restriction
Restrictions describe what values are required for certain fields.
Generally speaking, a restriction should be translatable into a SQL WHERE clause. Restrictions can form a chain, or they can be used specifically to constrain certain fields.
| Field Summary | |
protected  int | 
bool
Boolean to the next restriction in the chain.  | 
protected  boolean | 
bool_not
When true, signifies that the boolean logic for this restriction should be reversed; otherwise, the boolean logic is normal.  | 
static int | 
BOOLEAN_AND
Boolean AND operator.  | 
static int | 
BOOLEAN_OR
Boolean OR operator.  | 
protected  java.lang.String | 
field
The field this applies to - varies based on object.  | 
protected  Restriction | 
next
The next restriction in the chain or null if there is none. | 
| Constructor Summary | |
Restriction()
 | 
|
| Method Summary | |
 int | 
getBoolean()
Retrieves the boolean value for the next restriction in the chain.  | 
 java.lang.String | 
getField()
Retrieves the field.  | 
 boolean | 
getNot()
Determines if the logic for this restriction is reveresed or not (if it has a logical NOT applied to it).  | 
 void | 
setBoolean(int bool)
Sets the boolean value for the next restriction in the chain.  | 
 void | 
setField(java.lang.String field)
Sets the field.  | 
 void | 
setNot(boolean not)
Sets if the logic for this restriction is reveresed or not (if it has a logical NOT applied to it).  | 
abstract  boolean | 
validate(java.lang.Object o)
Validate this restriction against a sample object.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final int BOOLEAN_AND
public static final int BOOLEAN_OR
protected int bool
 One of BOOLEAN_AND or BOOLEAN_OR.
BOOLEAN_AND, 
BOOLEAN_ORprotected Restriction next
null if there is none.protected boolean bool_not
protected java.lang.String field
 This field can only be null when the field is not important,
 other uses may result in a java.lang.NullPointerException.
| Constructor Detail | 
public Restriction()
| Method Detail | 
public java.lang.String getField()
The field is the portion of an object that this restriction applies to. The various load methods that accept restrictions will list what fields are acceptable.
field, 
setField(String)public void setField(java.lang.String field)
field - The new field value.field, 
getField()public int getBoolean()
BOOLEAN_AND or
 BOOLEAN_OR.bool, 
BOOLEAN_AND, 
BOOLEAN_ORpublic void setBoolean(int bool)
bool - The boolean value, one of BOOLEAN_AND or
 BOOLEAN_OR.java.lang.IllegalArgumentException - if the passed value is not
 one of BOOLEAN_AND or BOOLEAN_OR.bool, 
BOOLEAN_AND, 
BOOLEAN_ORpublic boolean getNot()
true if the logic is inverted, false if not.public void setNot(boolean not)
true - if the logic is to be inverted, false if not.public abstract boolean validate(java.lang.Object o)
  | 
WPI GDC CMS 0.0.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||