|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.pmd.util.model.AnnotationContainer
public abstract class AnnotationContainer
A container for annotations.
| Nested Class Summary | |
|---|---|
static class |
AnnotationContainer.Hierarchy
The hierarchy of a container. |
| Constructor Summary | |
|---|---|
|
AnnotationContainer(AnnotationContainer.Hierarchy hierarchy)
Creates a new instance of AnnotationContainer. |
protected |
AnnotationContainer(java.lang.String name,
AnnotationContainer.Hierarchy hierarchy)
Creates a new instance of AnnotationContainer. |
| Method Summary | |
|---|---|
void |
addAnnotation(FileAnnotation annotation)
Adds the specified annotation to this container. |
void |
addAnnotations(java.util.Collection<? extends FileAnnotation> newAnnotations)
Adds the specified annotations to this container. |
void |
addAnnotations(FileAnnotation[] newAnnotations)
Adds the specified annotations to this container. |
boolean |
containsCategory(java.lang.String category)
Returns whether the category with the given name exists. |
boolean |
containsFile(java.lang.String fileName)
Returns whether the file with the given name exists. |
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. |
boolean |
containsType(java.lang.String type)
Returns whether the type with the given name exists. |
FileAnnotation |
getAnnotation(long key)
Returns the annotation with the specified key. |
FileAnnotation |
getAnnotation(java.lang.String key)
Returns the annotation with the specified key. |
int |
getAnnotationBound()
Gets the maximum number of annotations within the elements of the child hierarchy. |
java.util.Collection<FileAnnotation> |
getAnnotations()
Returns the annotations for this object. |
java.util.Collection<FileAnnotation> |
getAnnotations(Priority priority)
Returns the annotations of the specified priority for this object. |
java.util.Collection<FileAnnotation> |
getAnnotations(java.lang.String priority)
Returns the annotations of the specified priority for this object. |
java.util.Collection<java.lang.String> |
getCategories()
Gets the categories of this container that have annotations. |
java.util.Set<FileAnnotation> |
getCategory(java.lang.String category)
Gets the category with the given name. |
protected abstract java.util.Collection<? extends AnnotationContainer> |
getChildren()
Returns the children containers of this container. |
AnnotationContainer |
getContainer()
Returns this container. |
WorkspaceFile |
getFile(int hashCode)
Gets the file with the given hash code. |
WorkspaceFile |
getFile(java.lang.String fileName)
Gets the file with the given name. |
java.util.Collection<WorkspaceFile> |
getFiles()
Gets the files of this container that have annotations. |
java.util.Collection<FileAnnotation> |
getHighAnnotations()
Returns the annotations with Priority.HIGH. |
Priority |
getHighPriority()
Returns Priority.HIGH. |
java.util.Collection<FileAnnotation> |
getLowAnnotations()
Returns the annotations with Priority.LOW. |
Priority |
getLowPriority()
Returns Priority.LOW. |
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.lang.String |
getName()
Returns the name of this container. |
java.util.Collection<FileAnnotation> |
getNormalAnnotations()
Returns the annotations with Priority.NORMAL. |
Priority |
getNormalPriority()
Returns Priority.NORMAL. |
int |
getNumberOfAnnotations()
Returns the total number of annotations for this object. |
int |
getNumberOfAnnotations(Priority priority)
Returns the total number of annotations of the specified priority for this object. |
int |
getNumberOfAnnotations(java.lang.String priority)
Returns the annotations of the specified priority for this object. |
JavaPackage |
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<JavaPackage> |
getPackages()
Gets the packages of this container that have annotations. |
java.lang.String |
getToolTip()
Returns a tooltip showing the distribution of priorities for this container. |
java.util.Set<FileAnnotation> |
getType(java.lang.String type)
Gets the type with the given name. |
java.util.Collection<java.lang.String> |
getTypes()
Gets the types of this container that have annotations. |
boolean |
hasAnnotations()
Returns whether this objects has annotations. |
boolean |
hasAnnotations(Priority priority)
Returns whether this objects has annotations with the specified priority. |
boolean |
hasAnnotations(java.lang.String priority)
Returns whether this objects has annotations with the specified priority. |
boolean |
hasNoAnnotations()
Returns whether this objects has no annotations. |
boolean |
hasNoAnnotations(Priority priority)
Returns whether this objects has no annotations with the specified priority. |
boolean |
hasNoAnnotations(java.lang.String priority)
Returns whether this objects has no annotations with the specified priority. |
protected void |
rebuildMappings()
Rebuilds the priorities and files after deserialization. |
protected void |
setHierarchy(AnnotationContainer.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 |
|---|
public AnnotationContainer(AnnotationContainer.Hierarchy hierarchy)
AnnotationContainer.
hierarchy - the hierarchy of this container
protected AnnotationContainer(java.lang.String name,
AnnotationContainer.Hierarchy hierarchy)
AnnotationContainer.
name - the name of this containerhierarchy - the hierarchy of this container| Method Detail |
|---|
public AnnotationContainer getContainer()
protected void setHierarchy(AnnotationContainer.Hierarchy hierarchy)
hierarchy - the value to setpublic final java.lang.String getName()
public final void setName(java.lang.String name)
name - the name of this containerprotected void rebuildMappings()
public final void addAnnotation(FileAnnotation annotation)
annotation - the annotation to addpublic final void addAnnotations(java.util.Collection<? extends FileAnnotation> newAnnotations)
newAnnotations - the annotations to addpublic final void addAnnotations(FileAnnotation[] newAnnotations)
newAnnotations - the annotations to addpublic final java.util.Collection<FileAnnotation> getAnnotations()
getAnnotations in interface AnnotationProviderpublic final java.util.Collection<FileAnnotation> getAnnotations(Priority priority)
getAnnotations in interface AnnotationProviderpriority - the priority
public final java.util.Collection<FileAnnotation> getHighAnnotations()
Priority.HIGH.
Priority.HIGHpublic final java.util.Collection<FileAnnotation> getNormalAnnotations()
Priority.NORMAL.
Priority.NORMALpublic final java.util.Collection<FileAnnotation> getLowAnnotations()
Priority.LOW.
Priority.LOWpublic final java.util.Collection<FileAnnotation> getAnnotations(java.lang.String priority)
getAnnotations in interface AnnotationProviderpriority - the priority as a string object
public int getNumberOfAnnotations()
getNumberOfAnnotations in interface AnnotationProviderpublic int getNumberOfAnnotations(Priority priority)
getNumberOfAnnotations in interface AnnotationProviderpriority - the priority
public final int getNumberOfAnnotations(java.lang.String priority)
getNumberOfAnnotations in interface AnnotationProviderpriority - the priority as a string object
public final boolean hasAnnotations()
hasAnnotations in interface AnnotationProvidertrue if this objects has annotations.public final boolean hasAnnotations(Priority priority)
hasAnnotations in interface AnnotationProviderpriority - the priority
true if this objects has annotations.public final boolean hasAnnotations(java.lang.String priority)
hasAnnotations in interface AnnotationProviderpriority - the priority as a string object
true if this objects has annotations.public final boolean hasNoAnnotations()
hasNoAnnotations in interface AnnotationProvidertrue if this objects has no annotations.public final boolean hasNoAnnotations(Priority priority)
hasNoAnnotations in interface AnnotationProviderpriority - the priority
true if this objects has no annotations.public final boolean hasNoAnnotations(java.lang.String priority)
hasNoAnnotations in interface AnnotationProviderpriority - the priority as a string object
true if this objects has no annotations.public final FileAnnotation getAnnotation(long key)
getAnnotation in interface AnnotationProviderkey - the key of the annotation
public final FileAnnotation getAnnotation(java.lang.String key)
getAnnotation in interface AnnotationProviderkey - the key of the annotation as a long value in string representation
public java.lang.String getToolTip()
public final java.lang.String getPackageCategoryName()
public java.util.Collection<MavenModule> getModules()
public boolean containsModule(java.lang.String moduleName)
moduleName - the module to check for
true if the maven module with the given name
exists, false otherwisepublic MavenModule getModule(java.lang.String moduleName)
moduleName - the name of the module
public java.util.Collection<JavaPackage> getPackages()
public boolean containsPackage(java.lang.String packageName)
packageName - the package to check for
true if the package with the given name
exists, false otherwisepublic JavaPackage getPackage(java.lang.String packageName)
packageName - the name of the package
public java.util.Collection<WorkspaceFile> getFiles()
public boolean containsFile(java.lang.String fileName)
fileName - the file to check for
true if the file with the given name
exists, false otherwisepublic WorkspaceFile getFile(java.lang.String fileName)
fileName - the short name of the file
public WorkspaceFile getFile(int hashCode)
hashCode - the hash code of the file
public java.util.Collection<java.lang.String> getCategories()
public boolean containsCategory(java.lang.String category)
category - the file to check for
true if the category with the given name
exists, false otherwisepublic java.util.Set<FileAnnotation> getCategory(java.lang.String category)
category - the category name
public java.util.Collection<java.lang.String> getTypes()
public boolean containsType(java.lang.String type)
type - the type to check for
true if the type with the given name
exists, false otherwisepublic java.util.Set<FileAnnotation> getType(java.lang.String type)
type - the type name
public final int getAnnotationBound()
protected abstract java.util.Collection<? extends AnnotationContainer> getChildren()
public Priority getHighPriority()
Priority.HIGH.
Priority.HIGHpublic Priority getNormalPriority()
Priority.NORMAL.
Priority.NORMALpublic Priority getLowPriority()
Priority.LOW.
Priority.LOW
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||