org.olat.course.condition
Class ExtendedCondition

java.lang.Object
  extended by org.olat.course.condition.ExtendedCondition
All Implemented Interfaces:
java.io.Serializable

public class ExtendedCondition
extends java.lang.Object
implements java.io.Serializable

Description:
This class represents conditions for the extended easy mode in course editor. Each condition consists of an attribute, an operator and a value to be tested.

Initial Date: 23.10.2006

Author:
Lars Eberle (BPS Bildungsportal Sachsen GmbH)
See Also:
Serialized Form

Field Summary
static java.lang.String CONDITION_CONNECTOR_AND
           
static java.lang.String CONDITION_CONNECTOR_OR
           
 
Constructor Summary
ExtendedCondition(java.lang.String attribute, Operator operator, java.lang.String value)
          Defines a new extended condition.
ExtendedCondition(java.lang.String attribute, java.lang.String operator, java.lang.String value)
          Defines a new extended condition and tries to determine the operator class from this given String.
 
Method Summary
 java.lang.String buildExpression()
           
 java.lang.String getAttribute()
           
 Operator getOperator()
           
 java.lang.String getValue()
           
 void setAttribute(java.lang.String attribute)
           
 void setOperator(Operator operator)
           
 void setValue(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONDITION_CONNECTOR_AND

public static final transient java.lang.String CONDITION_CONNECTOR_AND
See Also:
Constant Field Values

CONDITION_CONNECTOR_OR

public static final transient java.lang.String CONDITION_CONNECTOR_OR
See Also:
Constant Field Values
Constructor Detail

ExtendedCondition

public ExtendedCondition(java.lang.String attribute,
                         Operator operator,
                         java.lang.String value)
Defines a new extended condition.


ExtendedCondition

public ExtendedCondition(java.lang.String attribute,
                         java.lang.String operator,
                         java.lang.String value)
Defines a new extended condition and tries to determine the operator class from this given String. If the operator isn't recognized, an Exception will be thrown, so be careful using this method!

Throws:
java.lang.IllegalArgumentException - if the given operator string doesn't match an registered operator.
Method Detail

getAttribute

public java.lang.String getAttribute()
Returns:
Returns the attribute.

setAttribute

public void setAttribute(java.lang.String attribute)
Parameters:
attribute - The attribute to set.

getOperator

public Operator getOperator()
Returns:
Returns the operator.

setOperator

public void setOperator(Operator operator)
Parameters:
operator - The operator to set.

getValue

public java.lang.String getValue()
Returns:
Returns the value.

setValue

public void setValue(java.lang.String value)
Parameters:
value - The value to set.

buildExpression

public java.lang.String buildExpression()
Returns:
The expression of this condition, e.g. hasAttribute("attributName", "valueToBeTested")