antsnest.antinfo
Class DefaultAttributeDefinition

java.lang.Object
  extended by antsnest.antinfo.DefaultAttributeDefinition
All Implemented Interfaces:
AttributeDefinition

public class DefaultAttributeDefinition
extends Object
implements AttributeDefinition

Implementation of AttributeDefinition

Author:
Chris Clohosy
See Also:
AttributeDefinition

Field Summary
 String name
          The name of this attribute
 
Constructor Summary
DefaultAttributeDefinition(boolean required, String name)
          Constructs a new definition
 
Method Summary
 void addCondition(String condition)
          Adds a condition to this attribute
 String[] getConditions()
          Gets the conditions that make this attribute required
 String getName()
          Gets the name of this attribute
 boolean hasConditions()
          Whether there are any conditions that make this attribute required
 boolean isRequired()
          Whether this attribute is required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name
The name of this attribute

Constructor Detail

DefaultAttributeDefinition

public DefaultAttributeDefinition(boolean required,
                                  String name)
Constructs a new definition

Parameters:
required - whether the attribute is required
name - the name of this attribute
Method Detail

getName

public String getName()
Gets the name of this attribute

Specified by:
getName in interface AttributeDefinition
Returns:
a String, the name

isRequired

public boolean isRequired()
Whether this attribute is required

Specified by:
isRequired in interface AttributeDefinition
Returns:
a boolean, whether it's required

hasConditions

public boolean hasConditions()
Whether there are any conditions that make this attribute required

Specified by:
hasConditions in interface AttributeDefinition
Returns:
a boolean, if there are any

getConditions

public String[] getConditions()
Gets the conditions that make this attribute required

Specified by:
getConditions in interface AttributeDefinition
Returns:
a String[], the conditions

addCondition

public void addCondition(String condition)
Adds a condition to this attribute

Parameters:
condition - the condition to add