/*
 * Copyright  2001-2002,2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package org.apache.tools.ant.taskdefs.optional.ide;

import org.apache.tools.ant.BuildException;

/**
 * Type class. Holds information about a project edition.
 */
public class VAJProjectDescription {
    private String name;
    private String version;
    private boolean projectFound;

    public VAJProjectDescription() {
    }

    public VAJProjectDescription(String n, String v) {
        name = n;
        version = v;
    }

    public String getName() {
        return name;
    }

    public String getVersion() {
        return version;
    }

    public boolean projectFound() {
        return projectFound;
    }

    /**
     * name of the VAJ project to load into
     * the workspace; required
     */
    public void setName(String newName) {
        if (newName == null || newName.equals("")) {
            throw new BuildException("name attribute must be set");
        }
        name = newName;
    }

    /**
     * name of the requested version; required.
     */
    public void setVersion(String newVersion) {
        if (newVersion == null || newVersion.equals("")) {
            throw new BuildException("version attribute must be set");
        }
        version = newVersion;
    }

    /**
     * this may be a helper method, and is being ignored for now

     * @ant.attribute ignore="true"
     */
    public void setProjectFound() {
        projectFound = true;
    }
}
