|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.aspects.integrity.GenericConditions
Some basic methods for constraints on fields values.
Constraint methods must return a Boolean that is
Boolean.TRUE
if the test has been validated (passed),
Boolean.FALSE
else. Their parameters are :
Wrappee wrappee
: the substance object
(holding the field)FieldItem field
: the constrained fieldObject value
: the proposed future value of the
field (can be refused by the contraint)Object[] values
: some configuration params that
can be used in the test
IntegrityAC.addPreCondition(FieldItem,MethodItem,Object[],String)
,
IntegrityAC.addPostCondition(FieldItem,MethodItem,Object[],String)
,
IntegrityAC.doCheck()
Constructor Summary | |
GenericConditions()
|
Method Summary | |
static boolean |
authorizedValues(Object substance,
FieldItem field,
Object value,
Object[] values)
Check if field's value is equal to one of the authorized values. |
static boolean |
forbiddenValues(Object substance,
FieldItem field,
Object value,
Object[] values)
Check if field's value is not equal to the forbidden values. |
static boolean |
isBeginingWithLetter(Object substance,
FieldItem field,
Object value,
Object[] values)
Tells if the value is a letter begining string. |
static boolean |
isBeginingWithUpperCaseChar(Object substance,
FieldItem field,
Object value,
Object[] values)
Tells if the value is an upper-case char begining string. |
static boolean |
isGreaterThan(Object substance,
FieldItem field,
Object value,
Object[] values)
Tells if the value is greater than a given number. |
static boolean |
isJavaIdentifier(Object substance,
FieldItem field,
Object value,
Object[] values)
Tells if the value is a valid java identifier. |
static boolean |
isLowerThan(Object substance,
FieldItem field,
Object value,
Object[] values)
Tells if the value is lower than a given number. |
static boolean |
isNotNull(Object substance,
FieldItem field,
Object value,
Object[] values)
|
static boolean |
isNull(Object substance,
FieldItem field,
Object value,
Object[] values)
|
static boolean |
isUniqueValue(Object substance,
FieldItem field,
Object value,
Object[] values)
Check if this field already has the same value in another object of the same type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GenericConditions()
Method Detail |
public static boolean forbiddenValues(Object substance, FieldItem field, Object value, Object[] values)
false
.
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- the forbidden valuespublic static boolean authorizedValues(Object substance, FieldItem field, Object value, Object[] values)
false
.
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- the authorized valuespublic static boolean isUniqueValue(Object substance, FieldItem field, Object value, Object[] values)
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unusedpublic static boolean isBeginingWithUpperCaseChar(Object substance, FieldItem field, Object value, Object[] values)
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unusedpublic static boolean isNotNull(Object substance, FieldItem field, Object value, Object[] values)
public static boolean isNull(Object substance, FieldItem field, Object value, Object[] values)
public static boolean isBeginingWithLetter(Object substance, FieldItem field, Object value, Object[] values)
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unusedpublic static boolean isJavaIdentifier(Object substance, FieldItem field, Object value, Object[] values)
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unusedpublic static boolean isGreaterThan(Object substance, FieldItem field, Object value, Object[] values) throws Exception
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unused
Exception
public static boolean isLowerThan(Object substance, FieldItem field, Object value, Object[] values) throws Exception
substance
- the object that owns the fieldfield
- the tested fieldvalue
- the value that is about to be setvalues
- unused
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |