Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

/**
 * AntShield - A project release tool for ant.
 */
package com.erggroup.mass.ant;

import org.apache.tools.ant.BuildException;

/**
 * Implements the AntShield task's nested field tag's nested option tag.
 */
public class OptionElement
{
    private FieldElement parent = null;
    private String value = null;

    /**
     * Constructor.
     * @param f
     */
    public OptionElement(FieldElement f)
    {
        parent = f;
    }

    /**
     * Set the value property.
     * @param s
     */
    public void setValue(String s)
    {
        value = s;
    }

    /**
     * Returns this option's value.
     * @return
     */
    public String getValue()
    {
        return value;
    }

    /**
     * Check this options's parameters.
     */
    public void check()
    {
        if ((value == null) || (value.length() == 0))
        {
            throw new BuildException("<" + parent.getTaskName() + "> Invalid option specification for field [" + parent.getName() + "]");
        }
    }
}