Class CharSet
java.lang.Object
org.apache.tools.ant.types.EnumeratedAttribute
org.apache.tools.ant.types.CharSet
EnumeratedAttribute implementation for Charset to use with encoding/charset attributes.
- Since:
- Ant 1.10.6
-
Field Summary
Fields inherited from class EnumeratedAttribute
value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequivalent(CharSet cs) Tell if CharSet values are aliases.static CharSetgetAscii()Convenience methood: get US-ASCII CharSet.Convert this enumerated type to aCharset.static CharSetGet the default value as provided by Charset.static CharSetgetUtf8()Convenience method: get UTF-8 CharSet.String[]Return the possible values.final voidAccept additional values for backwards compatibility (some java.io encoding names not available in java.nio)Methods inherited from class EnumeratedAttribute
containsValue, getIndex, getInstance, getValue, indexOfValue, toStringModifier and TypeMethodDescriptionfinal booleancontainsValue(String value) Is this value included in the enumeration?final intgetIndex()static EnumeratedAttributegetInstance(Class<? extends EnumeratedAttribute> clazz, String value) Factory method for instantiating EAs via API in a more developer friendly way.final StringgetValue()final intindexOfValue(String value) get the index of a value in this enumeration.toString()Convert the value to its string form.
-
Constructor Details
-
CharSet
public CharSet()Default constructor. -
CharSet
Construct a new CharSet with the specified value.- Parameters:
value- the EnumeratedAttribute value.
-
-
Method Details
-
getDefault
Get the default value as provided by Charset.- Returns:
- the default value.
-
getAscii
Convenience methood: get US-ASCII CharSet.- Returns:
- the default value.
-
getUtf8
-
equivalent
Tell if CharSet values are aliases.- Parameters:
cs- CharSet to compare the value to.- Returns:
- true if CharSet values are aliases.
-
getCharset
-
getValues
Return the possible values.- Specified by:
getValuesin classEnumeratedAttribute- Returns:
- String[] of Charset names.
-
setValue
Accept additional values for backwards compatibility (some java.io encoding names not available in java.nio)- Overrides:
setValuein classEnumeratedAttribute- Parameters:
value- theStringvalue of the attribute
-