hudson.plugins.serenitec.util.model
Class EntriesContainer

java.lang.Object
  extended by hudson.plugins.serenitec.util.model.EntriesContainer
All Implemented Interfaces:
EntriesProvider, java.io.Serializable
Direct Known Subclasses:
MavenModule, Package, Project

public abstract class EntriesContainer
extends java.lang.Object
implements EntriesProvider, java.io.Serializable

A container for annotations.

Author:
Ulli Hafner
See Also:
Serialized Form

Nested Class Summary
static class EntriesContainer.Hierarchy
          The hierarchy of a container.
 
Constructor Summary
  EntriesContainer(EntriesContainer.Hierarchy hierarchy)
          Creates a new instance of AnnotationContainer.
protected EntriesContainer(java.lang.String name, EntriesContainer.Hierarchy hierarchy)
          Creates a new instance of AnnotationContainer.
 
Method Summary
 void addEntries(java.util.Collection<? extends ReportEntry> newentry)
          Adds the specified annotations to this container.
 void addEntries(java.util.Collection<? extends ReportEntry> detectedEntries, hudson.model.AbstractBuild<?,?> build)
           
 void addEntries(ReportEntry[] newAnnotations)
          Adds the specified annotations to this container.
 void addEntry(ReportEntry entry)
          Adds the specified annotation to this container.
 boolean containsModule(java.lang.String moduleName)
          Returns whether the maven module with the given name exists.
 boolean containsPackage(java.lang.String packageName)
          Returns whether the package with the given name exists.
 int getAnnotationBound()
          Gets the maximum number of annotations within the elements of the child hierarchy.
 java.util.Collection<ReportEntry> getAnnotations()
          
protected abstract  java.util.Collection<? extends EntriesContainer> getChildren()
          Returns the children containers of this container.
 EntriesContainer getContainer()
          Returns this container.
 java.util.List<ReportEntry> getEntries()
          return entries
 java.util.Map<java.lang.String,java.util.ArrayList<ReportEntry>> getEntriesByName()
           
 java.util.Map<java.lang.Integer,java.util.ArrayList<ReportEntry>> getEntriesBySeverity()
           
 java.util.List<ReportEntry> getEntriesFixed()
           
 java.util.List<ReportEntry> getEntriesNotFixed()
           
 int getMaxSeverityDiscovered()
           
 java.util.List<java.lang.String> getModifiedFiles()
           
 MavenModule getModule(java.lang.String moduleName)
          Gets the module with the given name.
 java.util.Collection<MavenModule> getModules()
          Gets the modules of this container that have annotations.
 java.util.Map<java.lang.String,MavenModule> getModulesByName()
           
 java.lang.String getName()
          Returns the name of this container.
 int getNumberOfEntry()
           
 int getNumberOfFixedEntry()
           
 int getNumberOfNewEntry()
           
 int getNumberOfNotFixedEntry()
           
 int getNumberOfPointeurs()
           
 int getNumberOfRules()
           
 int getNumberOfSeverityDesign()
           
 int getNumberOfSeverityDesignPatterns()
           
 int getNumberOfSeverityFormatage()
           
 int getNumberOfSeverityFormatagePatterns()
           
 int getNumberOfSeverityHighSecurity()
           
 int getNumberOfSeverityHighSecurityPatterns()
           
 int getNumberOfSeverityLowSecurity()
           
 int getNumberOfSeverityLowSecurityPatterns()
           
 int getNumberOfSeverityPerformance()
           
 int getNumberOfSeverityPerformancePatterns()
           
 Package getPackage(java.lang.String packageName)
          Gets the package with the given name.
 java.lang.String getPackageCategoryName()
          Returns the package category name for the scanned files.
 java.util.Collection<Package> getPackages()
          Gets the packages of this container that have annotations.
 ReportPointeur getPointeur(int key)
          Returns the pointeur identified by its key number
 java.util.List<ReportPointeur> getPointeurs()
           
 java.util.List<ReportEntry> getRules()
           
 java.lang.String getToolTip()
          Returns a tooltip showing the distribution of priorities for this container.
 java.util.List<ReportEntry> getTopFiveEntries()
           
 boolean hasAnnotations()
          
 boolean IsFixed()
          Return true if all the patterns have been fixed
protected  void rebuildMappings()
          Rebuilds the priorities and files after deserialization.
protected  void setHierarchy(EntriesContainer.Hierarchy hierarchy)
          Sets the hierarchy to the specified value.
 void setName(java.lang.String name)
          Sets the name of this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntriesContainer

public EntriesContainer(EntriesContainer.Hierarchy hierarchy)
Creates a new instance of AnnotationContainer.

Parameters:
hierarchy - the hierarchy of this container

EntriesContainer

protected EntriesContainer(java.lang.String name,
                           EntriesContainer.Hierarchy hierarchy)
Creates a new instance of AnnotationContainer.

Parameters:
name - the name of this container
hierarchy - the hierarchy of this container
Method Detail

addEntries

public final void addEntries(java.util.Collection<? extends ReportEntry> newentry)
Adds the specified annotations to this container.

Parameters:
newAnnotations - the annotations to add

addEntries

public final void addEntries(java.util.Collection<? extends ReportEntry> detectedEntries,
                             hudson.model.AbstractBuild<?,?> build)

addEntries

public final void addEntries(ReportEntry[] newAnnotations)
Adds the specified annotations to this container.

Parameters:
newAnnotations - the annotations to add

addEntry

public final void addEntry(ReportEntry entry)
Adds the specified annotation to this container.

Parameters:
annotation - the annotation to add

containsModule

public boolean containsModule(java.lang.String moduleName)
Returns whether the maven module with the given name exists.

Parameters:
moduleName - the module to check for
Returns:
true if the maven module with the given name exists, false otherwise

containsPackage

public boolean containsPackage(java.lang.String packageName)
Returns whether the package with the given name exists.

Parameters:
packageName - the package to check for
Returns:
true if the package with the given name exists, false otherwise

getAnnotationBound

public final int getAnnotationBound()
Gets the maximum number of annotations within the elements of the child hierarchy.

Returns:
the maximum number of annotations

getAnnotations

public final java.util.Collection<ReportEntry> getAnnotations()


getChildren

protected abstract java.util.Collection<? extends EntriesContainer> getChildren()
Returns the children containers of this container. If we are already at the leaf level, then an empty collection is returned.

Returns:
the children containers of this container.

getContainer

public EntriesContainer getContainer()
Returns this container.

Returns:
this container

getPointeur

public ReportPointeur getPointeur(int key)
Returns the pointeur identified by its key number

Parameters:
key -
Returns:
ReportPointeur

getModifiedFiles

public java.util.List<java.lang.String> getModifiedFiles()

getRules

public final java.util.List<ReportEntry> getRules()
Specified by:
getRules in interface EntriesProvider
Returns:
rules

getEntries

public final java.util.List<ReportEntry> getEntries()
Description copied from interface: EntriesProvider
return entries

Specified by:
getEntries in interface EntriesProvider

getEntriesByName

public final java.util.Map<java.lang.String,java.util.ArrayList<ReportEntry>> getEntriesByName()

getEntriesBySeverity

public final java.util.Map<java.lang.Integer,java.util.ArrayList<ReportEntry>> getEntriesBySeverity()

getEntriesFixed

public final java.util.List<ReportEntry> getEntriesFixed()
Specified by:
getEntriesFixed in interface EntriesProvider
Returns:
the entriesfixed

getEntriesNotFixed

public java.util.List<ReportEntry> getEntriesNotFixed()
Specified by:
getEntriesNotFixed in interface EntriesProvider
Returns:
the entriesnotfixed

getMaxSeverityDiscovered

public int getMaxSeverityDiscovered()
Specified by:
getMaxSeverityDiscovered in interface EntriesProvider
Returns:
the hightest severity entry discovered

getModule

public MavenModule getModule(java.lang.String moduleName)
Gets the module with the given name.

Parameters:
moduleName - the name of the module
Returns:
the module with the given name

getModules

public java.util.Collection<MavenModule> getModules()
Gets the modules of this container that have annotations.

Returns:
the modules with annotations

getModulesByName

public final java.util.Map<java.lang.String,MavenModule> getModulesByName()

getName

public final java.lang.String getName()
Returns the name of this container.

Returns:
the name of this container

getNumberOfRules

public int getNumberOfRules()
Specified by:
getNumberOfRules in interface EntriesProvider
Returns:
the numberOfRules

getNumberOfEntry

public int getNumberOfEntry()
Specified by:
getNumberOfEntry in interface EntriesProvider
Returns:
the numberOfEntry

getNumberOfNewEntry

public int getNumberOfNewEntry()
Specified by:
getNumberOfNewEntry in interface EntriesProvider
Returns:
the number of NewEntry;

getNumberOfFixedEntry

public int getNumberOfFixedEntry()
Specified by:
getNumberOfFixedEntry in interface EntriesProvider
Returns:
the numberOfFixedEntry

getNumberOfNotFixedEntry

public int getNumberOfNotFixedEntry()
Specified by:
getNumberOfNotFixedEntry in interface EntriesProvider
Returns:
the numberOfNotFixedEntry

getNumberOfPointeurs

public int getNumberOfPointeurs()
Specified by:
getNumberOfPointeurs in interface EntriesProvider
Returns:
the numberOfPointeurs

getNumberOfSeverityDesignPatterns

public int getNumberOfSeverityDesignPatterns()
Specified by:
getNumberOfSeverityDesignPatterns in interface EntriesProvider
Returns:
the numberOfSeverityDesignPatterns

getNumberOfSeverityFormatagePatterns

public int getNumberOfSeverityFormatagePatterns()
Specified by:
getNumberOfSeverityFormatagePatterns in interface EntriesProvider
Returns:
the numberOfSeverityFormatagePatterns

getNumberOfSeverityHighSecurityPatterns

public int getNumberOfSeverityHighSecurityPatterns()
Specified by:
getNumberOfSeverityHighSecurityPatterns in interface EntriesProvider
Returns:
the numberOfSeverityHighSecurityPatterns

getNumberOfSeverityLowSecurityPatterns

public int getNumberOfSeverityLowSecurityPatterns()
Specified by:
getNumberOfSeverityLowSecurityPatterns in interface EntriesProvider
Returns:
the numberOfSeverityLowSecurityPatterns

getNumberOfSeverityPerformancePatterns

public int getNumberOfSeverityPerformancePatterns()
Specified by:
getNumberOfSeverityPerformancePatterns in interface EntriesProvider
Returns:
the numberOfSeverityPerformancePatterns

getNumberOfSeverityDesign

public int getNumberOfSeverityDesign()
Specified by:
getNumberOfSeverityDesign in interface EntriesProvider
Returns:
the numberOfSeverityDesign

getNumberOfSeverityFormatage

public int getNumberOfSeverityFormatage()
Specified by:
getNumberOfSeverityFormatage in interface EntriesProvider
Returns:
the numberOfSeverityFormatage

getNumberOfSeverityHighSecurity

public int getNumberOfSeverityHighSecurity()
Specified by:
getNumberOfSeverityHighSecurity in interface EntriesProvider
Returns:
the numberOfSeverityHighSecurity

getNumberOfSeverityLowSecurity

public int getNumberOfSeverityLowSecurity()
Specified by:
getNumberOfSeverityLowSecurity in interface EntriesProvider
Returns:
the numberOfSeverityLowSecurity

getNumberOfSeverityPerformance

public int getNumberOfSeverityPerformance()
Specified by:
getNumberOfSeverityPerformance in interface EntriesProvider
Returns:
the numberOfSeverityPerformance

getPackage

public Package getPackage(java.lang.String packageName)
Gets the package with the given name.

Parameters:
packageName - the name of the package
Returns:
the file with the given name

getPackageCategoryName

public final java.lang.String getPackageCategoryName()
Returns the package category name for the scanned files. Currently, only java and c# files are supported.

Returns:
the package category name for the scanned files

getPackages

public java.util.Collection<Package> getPackages()
Gets the packages of this container that have annotations.

Returns:
the packages with annotations

getPointeurs

public final java.util.List<ReportPointeur> getPointeurs()

getToolTip

public java.lang.String getToolTip()
Returns a tooltip showing the distribution of priorities for this container.

Returns:
a tooltip showing the distribution of priorities

getTopFiveEntries

public final java.util.List<ReportEntry> getTopFiveEntries()
Specified by:
getTopFiveEntries in interface EntriesProvider
Returns:
the topFiveEntries

hasAnnotations

public final boolean hasAnnotations()


IsFixed

public final boolean IsFixed()
Return true if all the patterns have been fixed


rebuildMappings

protected void rebuildMappings()
Rebuilds the priorities and files after deserialization.


setHierarchy

protected void setHierarchy(EntriesContainer.Hierarchy hierarchy)
Sets the hierarchy to the specified value.

Parameters:
hierarchy - the value to set

setName

public final void setName(java.lang.String name)
Sets the name of this container.

Parameters:
name - the name of this container


Copyright © 2008. All Rights Reserved.