public abstract class BaseConstraint extends java.lang.Object implements Constraint
Constraint implementation.| Constructor and Description |
|---|
BaseConstraint(java.lang.String name,
java.lang.String type)
Creates a
Constraint with the
given name and type. |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
evaluate(RowEvent event)
Evaluate the given event under me.
|
java.lang.String |
getName()
Get my name.
|
java.lang.String |
getType()
Get a human-readable descrption of the type of constraint I represent.
|
boolean |
isDeferrable()
Return whether or not I am deferrable.
|
boolean |
isDeferred()
Return whether or not I am deferred.
|
void |
resolve(Database db,
TableIdentifier table)
This base implementation is a no-op.
|
void |
setDeferrable(boolean deferrable)
Set whether or not I am deferrable.
|
void |
setDeferred(boolean deferred)
Set whether or not I am deferred.
|
void |
setName(java.lang.String name)
Sets the name of this constraint.
|
protected TableIdentifier[] |
toArray(TableIdentifier table) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevaluate, evaluatepublic BaseConstraint(java.lang.String name,
java.lang.String type)
Constraint with the
given name and type.name - the name of this constraint (see setName(java.lang.String))
which may be nulltype - the type of this constraint (see getType()),
which should not be nullpublic abstract boolean evaluate(RowEvent event) throws AxionException
Constraintfalse if the
constraint I represent has been violated.evaluate in interface ConstraintAxionExceptionpublic void resolve(Database db, TableIdentifier table) throws AxionException
resolve in interface ConstraintAxionExceptionpublic java.lang.String getName()
ConstraintgetName in interface Constraintpublic void setName(java.lang.String name)
null a unique
name is programatically generated.setName in interface Constraintpublic java.lang.String getType()
ConstraintgetType in interface Constraintpublic boolean isDeferred()
ConstraintisDeferred in interface Constraintpublic void setDeferred(boolean deferred)
throws AxionException
Constraintdeferrableand deferred is true.setDeferred in interface ConstraintAxionExceptionpublic boolean isDeferrable()
ConstraintisDeferrable in interface Constraintpublic void setDeferrable(boolean deferrable)
ConstraintsetDeferrable in interface Constraintprotected TableIdentifier[] toArray(TableIdentifier table)