Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jharks.workflow;

The RuleCondition class is an abstract class with a factory method that allows for the instantiation of various RuleCondition implementations. RuleConditions can be used as conditional evaluators on Rule implementations This ultimately allows for new RuleCondition implementations to be written and then plugged into the architecture by simply modifying the workflow XML configuration file.

Author(s):
Michael J. Rizzo
Version:
1.0
public abstract class RuleCondition {

    
Flag indicating whether condition should be applied using context.
 
    private boolean useContext = false;
    
    
Check to see if condition applies according to provided input.

Parameters:
param the submitted input.
Returns:
boolean indicating whether condition applied or not.
    public abstract boolean checkCondition(Object param);
    
    
Factory method for creation of RuleCondition implementations.

Parameters:
rcImplName the class name of RuleCondition implementation to be instantiated.
Returns:
an instance of a Rule object.
Throws:
java.lang.ClassNotFoundException if can not find classname specified.
java.lang.IllegalAccessException if the protection on object constructor is violated.
java.lang.InstantiationException if error occurs while instantiating the object.
    public static RuleCondition getRuleConditionInstance(String rcImplName
                                        throws ClassNotFoundException
                                               IllegalAccessException
                                               InstantiationException {
        
        return (RuleCondition) Class.forName(rcImplName).newInstance();     
    }
    
    
Returns true if condition should only look for responses within the current answer context. Setting is false by default.

Returns:
Returns true if context should be used to restrict condition.
    public boolean isUseContext() {
        return ;
    }
    
    
Set whether to restrict to current context or not.

Parameters:
useContext The useContext to set.
    public void setUseContext(boolean useContext) {
        this. = useContext;
    }
New to GrepCode? Check out our FAQ X