org.xmpp.forms
Enum FormField.Type

java.lang.Object
  extended by java.lang.Enum<FormField.Type>
      extended by org.xmpp.forms.FormField.Type
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FormField.Type>
Enclosing class:
FormField

public static enum FormField.Type
extends java.lang.Enum<FormField.Type>

Type-safe enumeration to represent the field type of the Data forms.

Implementation note: XMPP error conditions use "-" characters in their names such as "jid-multi". Because "-" characters are not valid identifier parts in Java, they have been converted to "_" characters in the enumeration names, such as jid_multi. The toXMPP() and fromXMPP(String) methods can be used to convert between the enumertation values and Type code strings.


Enum Constant Summary
boolean_type
          The field enables an entity to gather or provide an either-or choice between two options.
fixed
          The field is intended for data description (e.g., human-readable text such as "section" headers) rather than data gathering or provision.
hidden
          The field is not shown to the entity providing information, but instead is returned with the form.
jid_multi
          The field enables an entity to gather or provide multiple Jabber IDs.
jid_single
          The field enables an entity to gather or provide multiple Jabber IDs.
list_multi
          The field enables an entity to gather or provide one or more options from among many.
list_single
          The field enables an entity to gather or provide one option from among many.
text_multi
          The field enables an entity to gather or provide multiple lines of text.
text_private
          The field enables an entity to gather or provide a single line or word of text, which shall be obscured in an interface (e.g., *****).
text_single
          The field enables an entity to gather or provide a single line or word of text, which may be shown in an interface.
 
Method Summary
static FormField.Type fromXMPP(java.lang.String type)
          Converts a String value into its Type representation.
 java.lang.String toXMPP()
          Returns the Field Type as a valid Field Type code string.
static FormField.Type valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FormField.Type[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

boolean_type

public static final FormField.Type boolean_type
The field enables an entity to gather or provide an either-or choice between two options. The allowable values are 1 for yes/true/assent and 0 for no/false/decline. The default value is 0.


fixed

public static final FormField.Type fixed
The field is intended for data description (e.g., human-readable text such as "section" headers) rather than data gathering or provision. The child SHOULD NOT contain newlines (the \n and \r characters); instead an application SHOULD generate multiple fixed fields, each with one child.


hidden

public static final FormField.Type hidden
The field is not shown to the entity providing information, but instead is returned with the form.


jid_multi

public static final FormField.Type jid_multi
The field enables an entity to gather or provide multiple Jabber IDs.


jid_single

public static final FormField.Type jid_single
The field enables an entity to gather or provide multiple Jabber IDs.


list_multi

public static final FormField.Type list_multi
The field enables an entity to gather or provide one or more options from among many.


list_single

public static final FormField.Type list_single
The field enables an entity to gather or provide one option from among many.


text_multi

public static final FormField.Type text_multi
The field enables an entity to gather or provide multiple lines of text.


text_private

public static final FormField.Type text_private
The field enables an entity to gather or provide a single line or word of text, which shall be obscured in an interface (e.g., *****).


text_single

public static final FormField.Type text_single
The field enables an entity to gather or provide a single line or word of text, which may be shown in an interface. This field type is the default and MUST be assumed if an entity receives a field type it does not understand.

Method Detail

values

public static final FormField.Type[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(FormField.Type c : FormField.Type.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static FormField.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

fromXMPP

public static FormField.Type fromXMPP(java.lang.String type)
Converts a String value into its Type representation.

Parameters:
type - the String value.
Returns:
the type corresponding to the String.

toXMPP

public java.lang.String toXMPP()
Returns the Field Type as a valid Field Type code string.

Returns:
the Field Type value.


Copyright © 2009-2010 Ignite Realtime. All Rights Reserved.