org.sonar.ide.shared.violations
Class ViolationUtils

java.lang.Object
  extended by org.sonar.ide.shared.violations.ViolationUtils

public final class ViolationUtils
extends Object


Field Summary
static String PRIORITY_BLOCKER
           
static String PRIORITY_CRITICAL
           
static String PRIORITY_INFO
           
static String PRIORITY_MAJOR
           
static String PRIORITY_MINOR
           
 
Method Summary
static List<org.sonar.wsclient.services.Violation> convertLines(Collection<org.sonar.wsclient.services.Violation> violations, SourceCodeDiff diff)
           
static int convertPriority(String priority)
          Converts priority from string to integer.
static String getDescription(org.sonar.wsclient.services.Violation violation)
           
static List<org.sonar.wsclient.services.Violation> sortByPriority(List<org.sonar.wsclient.services.Violation> violations)
          Sorts violations by priority in descending order.
static Map<Integer,List<org.sonar.wsclient.services.Violation>> splitByLines(Collection<org.sonar.wsclient.services.Violation> violations)
           
static String toString(Collection<org.sonar.wsclient.services.Violation> violations)
           
static String toString(org.sonar.wsclient.services.Violation violation)
          TODO Godin: can we include this method into sonar-ws-client for debug purposes ?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIORITY_BLOCKER

public static final String PRIORITY_BLOCKER
See Also:
Constant Field Values

PRIORITY_CRITICAL

public static final String PRIORITY_CRITICAL
See Also:
Constant Field Values

PRIORITY_MAJOR

public static final String PRIORITY_MAJOR
See Also:
Constant Field Values

PRIORITY_MINOR

public static final String PRIORITY_MINOR
See Also:
Constant Field Values

PRIORITY_INFO

public static final String PRIORITY_INFO
See Also:
Constant Field Values
Method Detail

sortByPriority

public static List<org.sonar.wsclient.services.Violation> sortByPriority(List<org.sonar.wsclient.services.Violation> violations)
Sorts violations by priority in descending order.

Parameters:
violations - list of violations to sort
Returns:
sorted list of violations

splitByLines

public static Map<Integer,List<org.sonar.wsclient.services.Violation>> splitByLines(Collection<org.sonar.wsclient.services.Violation> violations)

convertPriority

public static int convertPriority(String priority)
Converts priority from string to integer.

Parameters:
priority - priority to convert
Returns:
converted priority

getDescription

public static String getDescription(org.sonar.wsclient.services.Violation violation)

convertLines

public static List<org.sonar.wsclient.services.Violation> convertLines(Collection<org.sonar.wsclient.services.Violation> violations,
                                                                       SourceCodeDiff diff)

toString

public static String toString(Collection<org.sonar.wsclient.services.Violation> violations)
Parameters:
violations - collection to convert to string
Returns:
string representation of collection
See Also:
toString(org.sonar.wsclient.services.Violation)

toString

public static String toString(org.sonar.wsclient.services.Violation violation)
TODO Godin: can we include this method into sonar-ws-client for debug purposes ?

Parameters:
violation - violation to convert to string
Returns:
string representation of violation
See Also:
toString(java.util.Collection)


Copyright © 2010 Evgeny Mandrikov. All Rights Reserved.