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

hudson.plugins.pmd.util.model.MavenModule Maven / Gradle / Ivy

Go to download

This plug-in generates the trend report for PMD, an open source static code analysis program.

There is a newer version: 3.12
Show newest version
package hudson.plugins.pmd.util.model;

import java.util.Map;


/**
 * A serializable Java Bean class representing a maven module.
 *
 * @author Ulli Hafner
 */
public class MavenModule extends AnnotationContainer {
    /** Unique identifier of this class. */
    private static final long serialVersionUID = 5467122420572804130L;
    /** Name of this module. */
    private String name; // NOPMD: backward compatibility
    /** All Java packages in this maven module (mapped by their name). */
    @SuppressWarnings("unused")
    @edu.umd.cs.findbugs.annotations.SuppressWarnings("Se")
    private Map packageMapping; // NOPMD: backward compatibility
    /** The error message that denotes that the creation of the module has been failed. */
    private String error;

    /**
     * Creates a new instance of MavenModule. File handling is
     * performed in this class since the files are already mapped in the modules
     * of this project.
     */
    public MavenModule() {
        super(Hierarchy.MODULE);
    }

    /**
     * Creates a new instance of MavenModule.
     *
     * @param moduleName
     *            name of the module
     */
    public MavenModule(final String moduleName) {
        super(moduleName, Hierarchy.MODULE);
    }

    /**
     * Rebuilds the priorities mapping.
     *
     * @return the created object
     */
    private Object readResolve() {
        setHierarchy(Hierarchy.MODULE);
        rebuildMappings();
        if (name != null) {
            setName(name);
        }
        return this;
    }

    /**
     * Sets an error message that denotes that the creation of the module has
     * been failed.
     *
     * @param error
     *            the error message
     */
    public void setError(final String error) {
        this.error = error;
    }

    /**
     * Return whether this module has an error message stored.
     *
     * @return true if this module has an error message stored.
     */
    public boolean hasError() {
        return error != null;
    }

    /**
     * Returns the error message for this module.
     *
     * @return the error message for this module
     */
    public String getError() {
        return error;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy