com.novell.nds.dirxml.driver.xds
Class Constraint

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.xds.Constraint
Direct Known Subclasses:
ConstraintGroup, DynamicEnumConstraint, EnumConstraint, MultiRequiredConstraint, MultiUniqueConstraint, MultiValueConstraint, RangeConstraint, RegExConstraint, RequiredConstraint, SingleValueConstraint, TypedEnumConstraint, UniqueConstraint

public abstract class Constraint
extends Object

Defines the set of legal values for a Parameter.


Method Summary
abstract  boolean canBeAppliedToMultipleParams()
          Can this constraint be applied to multiple Parameters?
abstract  boolean forScalar()
          Can this constrait be applied to a scalar Parameter?
abstract  boolean forStructured()
          Can this constraint be applied to a structured Parameter?
 boolean getNOT()
          Indicates whether this constraint is negated.
 LogicalOp getOperator()
          Returns the LogicalOp of this constraint.
 DataType getType()
          Returns the first DataType supported by this constraint.
 List getTypes()
          Returns the list of DataTypes this constraint can be applied to.
 String toString()
          Returns a string representation of this contraint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getTypes

public List getTypes()
Returns the list of DataTypes this constraint can be applied to.

Returns:
a List of DataTypes; will not return null

getType

public DataType getType()
Returns the first DataType supported by this constraint.

Returns:
will not return null

getNOT

public boolean getNOT()
Indicates whether this constraint is negated. For example, !(true).

Returns:
true if it is; false if it isn't

toString

public String toString()
Returns a string representation of this contraint.

Returns:
a set representation of this constraints legal values (e.g. ['one', 'two', 'three']).

getOperator

public LogicalOp getOperator()
Returns the LogicalOp of this constraint. If this constraint represents multiple constraints, then they may be joined by a logical operator such as AND or OR.

Returns:
will not return null

forStructured

public abstract boolean forStructured()
Can this constraint be applied to a structured Parameter?

A structured Parameter consists of multiple primitives or other structured Parameters.

Returns:
true if it can; false if it can't

forScalar

public abstract boolean forScalar()
Can this constrait be applied to a scalar Parameter?

A scalar Parmeter is a primitive (e.g., long, int, boolean) that has a single value.

Returns:
true if it can; false if it can't

canBeAppliedToMultipleParams

public abstract boolean canBeAppliedToMultipleParams()
Can this constraint be applied to multiple Parameters?

Returns:
true if it can; false if it can't