hudson.plugins.violations.model
Class FileModel

java.lang.Object
  extended by hudson.plugins.violations.model.FileModel

public class FileModel
extends java.lang.Object

A class contains the violations for a particular file. The number of violations are limited.


Nested Class Summary
static class FileModel.LimitType
          A overview class for each type.
 
Constructor Summary
FileModel()
           
 
Method Summary
 void addLimitType(java.lang.String type, int number, int suppressed)
          Add summary object for a type of violation.
 void addViolation(Violation v)
          Add a violation to the file model.
 java.lang.String getDisplayName()
          Get the display name of this file.
 long getLastModified()
          Get the last modified time of the file.
 java.util.SortedMap<java.lang.String,FileModel.LimitType> getLimitTypeMap()
          Get a map of type to limit type.
 java.util.SortedMap<java.lang.Integer,java.lang.String> getLines()
          Get a sorted map of lines.
 java.util.Map<java.lang.Integer,java.util.Set<Violation>> getLineViolationMap()
          Get a map of line number to a set of violations.
 java.io.File getSourceFile()
          Get the source file.
 java.util.TreeMap<java.lang.String,java.util.TreeSet<Violation>> getTypeMap()
          Get the map of types to violations.
 void setDisplayName(java.lang.String name)
          Set thr name to use to display this file.
 void setLastModified(long lastModified)
          Set the last modified time of the file.
 void setSourceFile(java.io.File sourceFile)
          Set the source file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileModel

public FileModel()
Method Detail

getLimitTypeMap

public java.util.SortedMap<java.lang.String,FileModel.LimitType> getLimitTypeMap()
Get a map of type to limit type.

Returns:
the map.

addLimitType

public void addLimitType(java.lang.String type,
                         int number,
                         int suppressed)
Add summary object for a type of violation.

Parameters:
type - the type of violation.
number - the number of violations of that type in this file.
suppressed - the number of violations not shown for this file.

addViolation

public void addViolation(Violation v)
Add a violation to the file model.

Parameters:
v - the violation to add.

getDisplayName

public java.lang.String getDisplayName()
Get the display name of this file.

Returns:
the name to use whrn displaying the file violations.

setDisplayName

public void setDisplayName(java.lang.String name)
Set thr name to use to display this file.

Parameters:
name - the name to use.

getSourceFile

public java.io.File getSourceFile()
Get the source file.

Returns:
the source file.

setSourceFile

public void setSourceFile(java.io.File sourceFile)
Set the source file.

Parameters:
sourceFile - the value to use.

setLastModified

public void setLastModified(long lastModified)
Set the last modified time of the file.

Parameters:
lastModified - the time to use.

getLastModified

public long getLastModified()
Get the last modified time of the file.

Returns:
the lastModified time.

getLineViolationMap

public java.util.Map<java.lang.Integer,java.util.Set<Violation>> getLineViolationMap()
Get a map of line number to a set of violations.

Returns:
the map.

getLines

public java.util.SortedMap<java.lang.Integer,java.lang.String> getLines()
Get a sorted map of lines.

Returns:
a line number to line content map.

getTypeMap

public java.util.TreeMap<java.lang.String,java.util.TreeSet<Violation>> getTypeMap()
Get the map of types to violations.

Returns:
the type to violation map.


Copyright © 2004-2012. All Rights Reserved.