com.atlassian.jira.web.action.util.workflow
Class WorkflowEditorTransitionConditionUtil

java.lang.Object
  extended by com.atlassian.jira.web.action.util.workflow.WorkflowEditorTransitionConditionUtil

public class WorkflowEditorTransitionConditionUtil
extends Object


Field Summary
static String OPERATOR_AND
           
static String OPERATOR_OR
           
static String SEPARATOR
          Separator for the 'count' variables that is used to represent a position in a hierarchy.
 
Constructor Summary
WorkflowEditorTransitionConditionUtil()
           
 
Method Summary
 String addCondition(com.opensymphony.workflow.loader.ActionDescriptor transition, String count, com.opensymphony.workflow.loader.ConditionDescriptor condition)
           
 String addNestedCondition(com.opensymphony.workflow.loader.ActionDescriptor transition, String count, com.opensymphony.workflow.loader.ConditionDescriptor condition)
           
 void changeLogicOperator(com.opensymphony.workflow.loader.ActionDescriptor transition, String count)
           
 void deleteCondition(com.opensymphony.workflow.loader.ActionDescriptor transition, String count)
           
 com.opensymphony.workflow.loader.ConditionsDescriptor getConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor, String count)
          Same as getParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor, String) only all the indexes specified by the passed in count are used for lookups.
 void getGrandParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restriction, String count)
           
 int getLastCount(String count)
           
 com.opensymphony.workflow.loader.ConditionsDescriptor getParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor, String count)
          Returns a ConditionsDescriptor in the given RestrictionDescriptor in the 'place' specified by the count.
 String increaseCountLevel(String c)
           
 boolean isEmpty(com.opensymphony.workflow.loader.ConditionsDescriptor conditionsDescriptor)
          Checks if restrictionDescriptor has no ConditionsDescriptors left.
 boolean isEmpty(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor)
          Checks if restrictionDescriptor has no ConditionDescriptors or ConditionsDescriptors left.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final String SEPARATOR
Separator for the 'count' variables that is used to represent a position in a hierarchy.

See Also:
Constant Field Values

OPERATOR_AND

public static final String OPERATOR_AND
See Also:
Constant Field Values

OPERATOR_OR

public static final String OPERATOR_OR
See Also:
Constant Field Values
Constructor Detail

WorkflowEditorTransitionConditionUtil

public WorkflowEditorTransitionConditionUtil()
Method Detail

getParentConditionsDescriptor

public com.opensymphony.workflow.loader.ConditionsDescriptor getParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor,
                                                                                           String count)
Returns a ConditionsDescriptor in the given RestrictionDescriptor in the 'place' specified by the count. The count is a SEPARATOR separated integers that represents the place of the ConditionsDescriptor in the hierarchy of nested ConditionsDescriptors.

This method assumes that the last integer in count will be used to find a ConditionDescriptor in the returned ConditionsDescriptor, so is not used while looking through the hierarchy.

For example, if this method is called with count "1.2.4", this method will take the root ConditionsDescriptor of the passed RestrictionDescriptor, look up a nested ConditionsDescriptor at index 0. Them another lookup will be done for another nested ConditionsDescriptor at index 1. This ConditionsDescriptor will be returned, as "4" is ignored.

Throws:
IllegalArgumentException - if the object at any index specified by the count is not an instance of ConditionsDescriptor

getConditionsDescriptor

public com.opensymphony.workflow.loader.ConditionsDescriptor getConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor,
                                                                                     String count)
Same as getParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor, String) only all the indexes specified by the passed in count are used for lookups. That is, the last integer in count is NOT ignored.


getGrandParentConditionsDescriptor

public void getGrandParentConditionsDescriptor(com.opensymphony.workflow.loader.RestrictionDescriptor restriction,
                                               String count)

isEmpty

public boolean isEmpty(com.opensymphony.workflow.loader.RestrictionDescriptor restrictionDescriptor)
Checks if restrictionDescriptor has no ConditionDescriptors or ConditionsDescriptors left.


isEmpty

public boolean isEmpty(com.opensymphony.workflow.loader.ConditionsDescriptor conditionsDescriptor)
Checks if restrictionDescriptor has no ConditionsDescriptors left.


increaseCountLevel

public String increaseCountLevel(String c)

getLastCount

public int getLastCount(String count)

addCondition

public String addCondition(com.opensymphony.workflow.loader.ActionDescriptor transition,
                           String count,
                           com.opensymphony.workflow.loader.ConditionDescriptor condition)

addNestedCondition

public String addNestedCondition(com.opensymphony.workflow.loader.ActionDescriptor transition,
                                 String count,
                                 com.opensymphony.workflow.loader.ConditionDescriptor condition)

deleteCondition

public void deleteCondition(com.opensymphony.workflow.loader.ActionDescriptor transition,
                            String count)

changeLogicOperator

public void changeLogicOperator(com.opensymphony.workflow.loader.ActionDescriptor transition,
                                String count)


Copyright © 2002-2009 Atlassian. All Rights Reserved.