All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.plugins.tasks.util.model.DefaultAnnotationContainer Maven / Gradle / Ivy

Go to download

This plug-in scans the workspace files for open tasks and generates a trend report.

There is a newer version: 4.13
Show newest version
package hudson.plugins.tasks.util.model;

import java.util.Collection;

/**
 * A simple annotation container that stores a set of annotations.
 *
 * @author Ulli Hafner
 */
public class DefaultAnnotationContainer extends AnnotationContainer {
    /** Dummy name for temporary containers. */
    private static final String TEMPORARY = "temporary";
    /** Unique identifier of this class. */
    private static final long serialVersionUID = -7969178785228510814L;

    /**
     * Creates a new instance of {@link DefaultAnnotationContainer}.
     *
     * @param name
     *            the name of this container
     */
    public DefaultAnnotationContainer(final String name) {
        super(name, Hierarchy.PROJECT);
    }

    /**
     * Creates a new instance of {@link DefaultAnnotationContainer}.
     *
     * @param name
     *            the name of this container
     * @param annotations
     *            the annotations to be stored
     */
    public DefaultAnnotationContainer(final String name, final Collection annotations) {
        super(name, Hierarchy.PROJECT);

        addAnnotations(annotations);
    }

    /**
     * Creates a new instance of {@link DefaultAnnotationContainer}.
     *
     * @param annotations
     *            the annotations to be stored
     */
    public DefaultAnnotationContainer(final Collection annotations) {
        super(TEMPORARY, Hierarchy.PROJECT);

        addAnnotations(annotations);
    }

    /**
     * Rebuilds the priorities mapping.
     *
     * @return the created object
     */
    private Object readResolve() {
        setHierarchy(Hierarchy.PROJECT);
        rebuildMappings();
        return this;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy