org.sonar.api.workflow.condition
Class Condition

java.lang.Object
  extended by org.sonar.api.workflow.condition.Condition
Direct Known Subclasses:
AdminRoleCondition, HasReviewPropertyCondition, NotCondition, ProjectPropertyCondition, ResolutionCondition, StatusCondition

@Beta
public abstract class Condition
extends Object

Conditions control who can perform a command (i.e. who can see the screen associated to the command).

Since:
3.1

Constructor Summary
protected Condition(boolean onContext)
           
 
Method Summary
abstract  boolean doVerify(Review review, WorkflowContext context)
           
 boolean isOnContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Condition

protected Condition(boolean onContext)
Method Detail

isOnContext

public final boolean isOnContext()
Returns:
true if the condition relates to a review, false if it relates to the resource context (selected file, end-user, ...)

doVerify

public abstract boolean doVerify(@Nullable
                                 Review review,
                                 WorkflowContext context)
Parameters:
review - the review on "review conditions" like StatusCondition, null on "context conditions" like AdminRoleCondition or ProjectPropertyCondition
context -
Returns:
is the condition verified ?


Copyright © 2009-2012 SonarSource. All Rights Reserved.