001package org.andromda.core.namespace;
002
003/**
004 * Represents a property definition.
005 *
006 * @author Chad Brandon
007 */
008public class PropertyDefinition
009{
010    private String name;
011
012    /**
013     * Gets the name of this property definition.
014     *
015     * @return Returns the name.
016     */
017    public String getName()
018    {
019        return name;
020    }
021
022    /**
023     * Sets the name of this property definition.
024     *
025     * @param name The name to set.
026     */
027    public void setName(final String name)
028    {
029        this.name = name;
030    }
031
032    /**
033     * Stores the default value.
034     */
035    private String defaultValue;
036
037    /**
038     * Gets the default for this property definition.
039     *
040     * @return Returns the defaultValue.
041     */
042    public String getDefaultValue()
043    {
044        return this.defaultValue;
045    }
046
047    /**
048     * Sets the default for the property definition.
049     *
050     * @param defaultValue The defaultValue to set.
051     */
052    public void setDefaultValue(final String defaultValue)
053    {
054        this.defaultValue = defaultValue;
055    }
056
057    /**
058     * The flag indicating whether or not this property is required.
059     */
060    private boolean required = true;
061
062    /**
063     * Sets this property is required, by default
064     * this flag is <code>true</code>.
065     *
066     * @param required true/false
067     */
068    public void setRequired(final boolean required)
069    {
070        this.required = required;
071    }
072
073    /**
074     * Indicates of this property is required, by default
075     * this flag is <code>true</code>.
076     *
077     * @return true/false
078     */
079    public boolean isRequired()
080    {
081        return this.required;
082    }
083}