org.apache.tools.ant.types
Class EnumeratedAttribute
java.lang.Object
org.apache.tools.ant.types.EnumeratedAttribute
public abstract class EnumeratedAttribute
extends java.lang.Object
Helper class for attributes that can only take one of a fixed list
of values.
See
FixCRLF
for an
example.
protected String | value - The selected value in this enumeration.
|
value
protected String value
The selected value in this enumeration.
EnumeratedAttribute
protected EnumeratedAttribute()
bean constructor
containsValue
public final boolean containsValue(String value)
Is this value included in the enumeration?
getIndex
public final int getIndex()
- the index of the selected value in the array.
getValue
public final String getValue()
getValues
public abstract String[] getValues()
This is the only method a subclass needs to implement.
- an array holding all possible values of the enumeration.
The order of elements must be fixed so that indexOfValue(String)
always return the same index for the same value.
indexOfValue
public final int indexOfValue(String value)
get the index of a value in this enumeration.
value
- the string value to look for.
- the index of the value in the array of strings
or -1 if it cannot be found.
setValue
public final void setValue(String value)
throws BuildException
toString
public String toString()
Convert the value to its string form.
- the string form of the value.
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.