|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.types.EnumeratedAttribute
public abstract class EnumeratedAttribute
Helper class for attributes that can only take one of a fixed list of values.
See FixCRLF
for an
example.
Field Summary | |
---|---|
protected java.lang.String |
value
The selected value in this enumeration. |
Constructor Summary | |
---|---|
protected |
EnumeratedAttribute()
bean constructor |
Method Summary | |
---|---|
boolean |
containsValue(java.lang.String value)
Is this value included in the enumeration? |
int |
getIndex()
|
static EnumeratedAttribute |
getInstance(java.lang.Class clazz,
java.lang.String value)
Factory method for instantiating EAs via API in a more developer friendly way. |
java.lang.String |
getValue()
|
abstract java.lang.String[] |
getValues()
This is the only method a subclass needs to implement. |
int |
indexOfValue(java.lang.String value)
get the index of a value in this enumeration. |
void |
setValue(java.lang.String value)
Invoked by IntrospectionHelper . |
java.lang.String |
toString()
Convert the value to its string form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String value
Constructor Detail |
---|
protected EnumeratedAttribute()
Method Detail |
---|
public abstract java.lang.String[] getValues()
public static EnumeratedAttribute getInstance(java.lang.Class clazz, java.lang.String value) throws BuildException
clazz
- Class, extending EA, which to instantiatevalue
- The value to set on that EA
BuildException
- If the class could not be found or the value
is not valid for the given EA-class.public final void setValue(java.lang.String value) throws BuildException
IntrospectionHelper
.
value
- the String
value of the attribute
BuildException
- if the value is not valid for the attributepublic final boolean containsValue(java.lang.String value)
value
- the String
value to look up
public final int indexOfValue(java.lang.String value)
value
- the string value to look for.
getValues()
public final java.lang.String getValue()
public final int getIndex()
getValues()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |