Enum Class InputPurpose
- All Implemented Interfaces:
Enumeration
,Serializable
,Comparable<InputPurpose>
,Constable
This information is useful for on-screen keyboards and similar input methods to decide which keys should be presented to the user.
Note that the purpose is not meant to impose a totally strict rule about allowed characters, and does not replace input validation. It is fine for an on-screen keyboard to let the user override the character set restriction that is expressed by the purpose. The application is expected to validate the entry contents, even if it specified a purpose.
The difference between DIGITS
and
NUMBER
is that the former accepts only digits
while the latter also some punctuation (like commas or points, plus,
minus) and “e” or “E” as in 3.14E+000.
This enumeration may be extended in the future; input methods should interpret unknown values as “free form”.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAllow only alphabetic charactersAllow only digitsEdited field expects email addressAllow any characterEdited field expects the name of a personEdited field expects numbersLikeFREE_FORM
, but characters are hiddenEdited field expects phone numberLikeDIGITS
, but characters are hiddenAllow any character, in addition to control codesEdited field expects URL -
Method Summary
Modifier and TypeMethodDescriptionstatic Type
getType()
Get the GType of the InputPurpose classint
getValue()
Get the numeric value of this enumstatic InputPurpose
of
(int value) Create a new InputPurpose for the provided valuestatic InputPurpose
Returns the enum constant of this class with the specified name.static InputPurpose[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FREE_FORM
Allow any character -
ALPHA
Allow only alphabetic characters -
DIGITS
Allow only digits -
NUMBER
Edited field expects numbers -
PHONE
Edited field expects phone number -
URL
Edited field expects URL -
EMAIL
Edited field expects email address -
NAME
Edited field expects the name of a person -
PASSWORD
LikeFREE_FORM
, but characters are hidden -
PIN
LikeDIGITS
, but characters are hidden -
TERMINAL
Allow any character, in addition to control codes
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
of
Create a new InputPurpose for the provided value- Parameters:
value
- the enum value- Returns:
- the enum for the provided value
-
getValue
public int getValue()Get the numeric value of this enum- Specified by:
getValue
in interfaceEnumeration
- Returns:
- the enum value
-
getType
-