org.drools.ide.common.client.modeldriven.brl
Class BaseSingleFieldConstraint

java.lang.Object
  extended by org.drools.ide.common.client.modeldriven.brl.BaseSingleFieldConstraint
All Implemented Interfaces:
Serializable, HasExpressionConstraint, HasOperator, HasParameterizedOperator, PortableObject
Direct Known Subclasses:
ConnectiveConstraint, SingleFieldConstraint

public class BaseSingleFieldConstraint
extends Object
implements HasParameterizedOperator, HasExpressionConstraint, PortableObject

Represents a constraint, which may be part of a direct field constraint or a connective.

See Also:
Serialized Form

Field Summary
protected  int constraintValueType
           
protected  ExpressionFormLine expression
           
protected  String operator
           
protected  Map<String,String> parameters
           
static int TYPE_ENUM
          This is not used yet.
static int TYPE_EXPR_BUILDER_VALUE
          This is for a "expression builder" that calculates a value.
static int TYPE_LITERAL
          This may be string, or number, anything really.
static int TYPE_PREDICATE
          The fieldName and fieldBinding is not used in the case of a predicate.
static int TYPE_RET_VALUE
          This is for a "formula" that calculates a value.
static int TYPE_TEMPLATE
          This is for a field to be a placeholder for a template
static int TYPE_UNDEFINED
          This is used only when constraint is first created.
static int TYPE_VARIABLE
          This is when it is set to a valid previously bound variable.
protected  String value
           
 
Constructor Summary
BaseSingleFieldConstraint()
           
 
Method Summary
 void clearParameters()
          Clear all parameters
 void deleteParameter(String key)
          Delete a parameter
 int getConstraintValueType()
           
 ExpressionFormLine getExpressionValue()
           
 String getOperator()
          Get operator
 String getParameter(String key)
          Get a parameter
 Map<String,String> getParameters()
          Get all parameters
 String getValue()
           
 void setConstraintValueType(int constraintValueType)
           
 void setExpressionValue(ExpressionFormLine expression)
           
 void setOperator(String operator)
          Set operator
 void setParameter(String key, String parameter)
          Set a parameter
 void setParameters(Map<String,String> parameters)
          Set all parameters
 void setValue(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UNDEFINED

public static final int TYPE_UNDEFINED
This is used only when constraint is first created. This means that there is no value yet for the constraint.

See Also:
Constant Field Values

TYPE_LITERAL

public static final int TYPE_LITERAL
This may be string, or number, anything really.

See Also:
Constant Field Values

TYPE_VARIABLE

public static final int TYPE_VARIABLE
This is when it is set to a valid previously bound variable.

See Also:
Constant Field Values

TYPE_RET_VALUE

public static final int TYPE_RET_VALUE
This is for a "formula" that calculates a value.

See Also:
Constant Field Values

TYPE_ENUM

public static final int TYPE_ENUM
This is not used yet. ENUMs are not suitable for business rules until we can get data driven non code enums.

See Also:
Constant Field Values

TYPE_PREDICATE

public static final int TYPE_PREDICATE
The fieldName and fieldBinding is not used in the case of a predicate.

See Also:
Constant Field Values

TYPE_EXPR_BUILDER_VALUE

public static final int TYPE_EXPR_BUILDER_VALUE
This is for a "expression builder" that calculates a value.

See Also:
Constant Field Values

TYPE_TEMPLATE

public static final int TYPE_TEMPLATE
This is for a field to be a placeholder for a template

See Also:
Constant Field Values

value

protected String value

operator

protected String operator

constraintValueType

protected int constraintValueType

expression

protected ExpressionFormLine expression

parameters

protected Map<String,String> parameters
Constructor Detail

BaseSingleFieldConstraint

public BaseSingleFieldConstraint()
Method Detail

setValue

public void setValue(String value)

getValue

public String getValue()

setConstraintValueType

public void setConstraintValueType(int constraintValueType)

getConstraintValueType

public int getConstraintValueType()

getExpressionValue

public ExpressionFormLine getExpressionValue()
Specified by:
getExpressionValue in interface HasExpressionConstraint

setExpressionValue

public void setExpressionValue(ExpressionFormLine expression)
Specified by:
setExpressionValue in interface HasExpressionConstraint

clearParameters

public void clearParameters()
Description copied from interface: HasParameterizedOperator
Clear all parameters

Specified by:
clearParameters in interface HasParameterizedOperator

getParameter

public String getParameter(String key)
Description copied from interface: HasParameterizedOperator
Get a parameter

Specified by:
getParameter in interface HasParameterizedOperator
Returns:

setParameter

public void setParameter(String key,
                         String parameter)
Description copied from interface: HasParameterizedOperator
Set a parameter

Specified by:
setParameter in interface HasParameterizedOperator

deleteParameter

public void deleteParameter(String key)
Description copied from interface: HasParameterizedOperator
Delete a parameter

Specified by:
deleteParameter in interface HasParameterizedOperator

getParameters

public Map<String,String> getParameters()
Description copied from interface: HasParameterizedOperator
Get all parameters

Specified by:
getParameters in interface HasParameterizedOperator
Returns:

setParameters

public void setParameters(Map<String,String> parameters)
Description copied from interface: HasParameterizedOperator
Set all parameters

Specified by:
setParameters in interface HasParameterizedOperator

setOperator

public void setOperator(String operator)
Description copied from interface: HasOperator
Set operator

Specified by:
setOperator in interface HasOperator

getOperator

public String getOperator()
Description copied from interface: HasOperator
Get operator

Specified by:
getOperator in interface HasOperator


Copyright © 2001-2011 JBoss by Red Hat. All Rights Reserved.