org.sonar.api.violations
Class ViolationQuery

java.lang.Object
  extended by org.sonar.api.violations.ViolationQuery

public final class ViolationQuery
extends Object

Class that allows to query the Sonar index about violations.

Since:
2.8

Nested Class Summary
static class ViolationQuery.SwitchMode
           
 
Method Summary
static ViolationQuery create()
          Creates a new ViolationQuery object.
 ViolationQuery forResource(Resource resource)
          Specifies the resource which violations are search from.
 Resource getResource()
          Returns the resource which violations are search from.
 ViolationQuery.SwitchMode getSwitchMode()
           
 boolean isSwitchedOff()
          Tells if the query should return only switched-off violations.
 ViolationQuery setSwitchedOff(boolean b)
          Specifies if the query should return only switched-off violations.
 ViolationQuery setSwitchMode(ViolationQuery.SwitchMode s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ViolationQuery create()
Creates a new ViolationQuery object.

Returns:
the new query

setSwitchedOff

public ViolationQuery setSwitchedOff(boolean b)
Specifies if the query should return only switched-off violations.

Parameters:
b - if true, the query will return only switched-off violations. if false, it will return only active violations.
Returns:
the current violation query

isSwitchedOff

public boolean isSwitchedOff()
Tells if the query should return only switched-off violations.

Returns:

getSwitchMode

public ViolationQuery.SwitchMode getSwitchMode()

setSwitchMode

public ViolationQuery setSwitchMode(ViolationQuery.SwitchMode s)

forResource

public ViolationQuery forResource(Resource resource)
Specifies the resource which violations are search from.

Parameters:
resource - the resource

getResource

public Resource getResource()
Returns the resource which violations are search from.

Returns:
the resource


Copyright © 2009-2012 SonarSource. All Rights Reserved.