public class Constraint
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
Constraint.Impact
Constraint impact
|
class |
Constraint.ImpactField
Field impact
|
class |
Constraint.ImpactObject
Object impact
|
class |
Constraint.ImpactTarget
Target impact
|
Modifier and Type | Field and Description |
---|---|
static char |
FIELD_COPY |
static char |
FIELD_DEFAULT |
static char |
FIELD_FILTER |
static char |
FIELD_LOV |
static char |
FIELD_MANDATORY |
static char |
FIELD_NONE |
static char |
FIELD_SEARCH |
static char |
FIELD_UPDATE |
static char |
FIELD_VALUE |
static char |
FIELD_VISIBLE |
static char |
OBJECT_ACTION |
static char |
OBJECT_COPY |
static char |
OBJECT_CREATE |
static char |
OBJECT_DELETE |
static char |
OBJECT_EXPORT |
static char |
OBJECT_NONE |
static char |
OBJECT_PAGINE |
static char |
OBJECT_RESEARCH |
static char |
OBJECT_UPDALL |
static char |
OBJECT_UPDATE |
static char |
OBJECT_USEFORM |
static char |
TYPE_EXPR |
static char |
TYPE_FIELD |
static char |
TYPE_METHOD |
Constructor and Description |
---|
Constraint(ObjectDB obj,
char type,
ObjectField field,
java.lang.String expr,
java.lang.String method,
java.lang.String[] group)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addImpact(java.lang.String expr,
char objProp,
char fieldProp,
ObjectField f,
java.lang.String target,
java.lang.String targetName)
Add an impact, must be called in sequence to sort impacts
|
void |
apply(int context,
java.lang.String[] row)
Apply all impacts (object, fields...)
only if it's apply to the groups and the object
|
void |
applyToField(int context,
java.lang.String[] row)
Apply the constraint to the fields
only if it's apply to the groups and the object
|
java.lang.Object |
applyToObject(int context,
char objectProp,
java.lang.String[] row)
Apply the constraint to the object
only if it's apply to the groups and the object
|
void |
applyToObject(int context,
java.lang.String[] row)
Apply the constraint to the object
only if it's apply to the groups and the object
|
void |
applyToTarget(int context,
java.lang.String[] row)
Apply the constraint to the targets
only if it's apply to the groups and the object
|
boolean |
checkCondition(int context,
java.lang.String[] row)
Test if the constraint condition is valid for the object
|
boolean |
checkGroups()
Test if the constraint applies to the user profile associated with the object
|
void |
clearImpacts() |
static java.lang.String |
getTargetName(java.lang.String target) |
boolean |
hasFieldImpact()
Check if constraint has at least one field impact
|
boolean |
hasFieldImpact(char fieldProp)
Check if constraint has at least one field impact of specied type
|
boolean |
hasObjectImpact()
Check if constraint has at least one object impact
|
boolean |
hasObjectImpact(char objectProp)
Check if constraint has at least one object impact of specified type
|
boolean |
hasTargetImpact()
Check if constraint has at least one target impact
|
public static final char TYPE_FIELD
public static final char TYPE_METHOD
public static final char TYPE_EXPR
public static final char FIELD_NONE
public static final char FIELD_COPY
public static final char FIELD_UPDATE
public static final char FIELD_VISIBLE
public static final char FIELD_SEARCH
public static final char FIELD_MANDATORY
public static final char FIELD_FILTER
public static final char FIELD_DEFAULT
public static final char FIELD_VALUE
public static final char FIELD_LOV
public static final char OBJECT_NONE
public static final char OBJECT_CREATE
public static final char OBJECT_COPY
public static final char OBJECT_UPDATE
public static final char OBJECT_DELETE
public static final char OBJECT_EXPORT
public static final char OBJECT_UPDALL
public static final char OBJECT_PAGINE
public static final char OBJECT_RESEARCH
public static final char OBJECT_USEFORM
public static final char OBJECT_ACTION
public Constraint(ObjectDB obj, char type, ObjectField field, java.lang.String expr, java.lang.String method, java.lang.String[] group)
type
- Type TYPE_FIELD, TYPE_EXPR or TYPE_METHODfield
- Field for the type TYPE_FIELDexpr
- Expression for the type TYPE_EXPRmethod
- Method for the type TYPE_METHODgroup
- Groups on witch constraint applies (all if null)public void addImpact(java.lang.String expr, char objProp, char fieldProp, ObjectField f, java.lang.String target, java.lang.String targetName)
expr
- property expressionobjProp
- optional Object propertyfieldProp
- optional Field propertyf
- optional field related to propertytarget
- optional targeted object (Action:id, Link:id or View:id)targetName
- optional target name (action name, reference;fk or view name)public void clearImpacts()
public boolean checkGroups()
public boolean checkCondition(int context, java.lang.String[] row)
context
- Contextrow
- Row (or null to use current item)public boolean hasFieldImpact()
public boolean hasFieldImpact(char fieldProp)
fieldProp
- One of Constraint.FIELD_*public void applyToField(int context, java.lang.String[] row)
context
- Contextrow
- Row (or null to use current item)public boolean hasTargetImpact()
public void applyToTarget(int context, java.lang.String[] row)
context
- Contextrow
- Row (or null to use current item)public boolean hasObjectImpact()
public boolean hasObjectImpact(char objectProp)
objectProp
- One of Constraint.OBJECT_*public void applyToObject(int context, java.lang.String[] row)
context
- Contextrow
- Row (or null to use current item)public java.lang.Object applyToObject(int context, char objectProp, java.lang.String[] row)
context
- ContextobjectProp
- Object property to check (Constraint.OBJECT_NONE means all constraints, then null is returned)row
- Row (or null to use current item)public void apply(int context, java.lang.String[] row)
context
- Contextrow
- Row (or null to use current item)public static java.lang.String getTargetName(java.lang.String target)
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.