public static final class DataForm.Field extends Object implements Comparable<DataForm.Field>
| Modifier and Type | Class and Description |
|---|---|
static class |
DataForm.Field.Builder
A builder class to build a data form field.
|
static class |
DataForm.Field.Type
Defines field types.
|
| Constructor and Description |
|---|
Field(DataForm.Field.Type type)
Deprecated.
|
Field(DataForm.Field.Type type,
String var,
String... values)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static DataForm.Field.Builder |
builder()
Creates the builder to build a data form field.
|
int |
compareTo(DataForm.Field o) |
String |
getDescription()
Gets a natural-language description of the field, intended for presentation in a user-agent (e.g., as a "tool-tip", help button, or explanatory text provided near the field).
|
String |
getLabel()
Gets the field label.
|
Media |
getMedia()
Gets the media element.
|
List<DataForm.Option> |
getOptions()
Gets the options if the field type is
DataForm.Field.Type.LIST_SINGLE or DataForm.Field.Type.LIST_MULTI. |
DataForm.Field.Type |
getType()
Gets the field type.
|
Validation |
getValidation()
Gets the validation for this field.
|
boolean |
getValueAsBoolean()
Gets the value as boolean.
|
Date |
getValueAsDate()
Returns the first value as date.
|
Integer |
getValueAsInteger()
Returns the first value as integer.
|
Jid |
getValueAsJid()
Returns the first value as JID, e.g. for the
DataForm.Field.Type.JID_SINGLE field type. |
List<String> |
getValues()
Gets the values of the field.
|
List<Jid> |
getValuesAsJid()
Returns a JID list for the
DataForm.Field.Type.JID_MULTI field type. |
String |
getVar()
Gets a unique identifier for the field in the context of the form.
|
boolean |
isRequired()
If the field as required in order for the form to be considered valid.
|
void |
setDescription(String description)
Deprecated.
|
void |
setLabel(String label)
Deprecated.
|
void |
setMedia(Media media)
Deprecated.
|
void |
setRequired(boolean required)
Deprecated.
|
void |
setType(DataForm.Field.Type type)
Deprecated.
|
void |
setValidation(Validation validation)
Deprecated.
|
void |
setVar(String var)
Deprecated.
|
@Deprecated public Field(DataForm.Field.Type type)
DataForm.Field.Builder.type - The field type.public Field(DataForm.Field.Type type, String var, String... values)
DataForm.Field.Builder.type - The field type.var - The unique identifier for the field.values - The values.public static DataForm.Field.Builder builder()
public DataForm.Field.Type getType()
@Deprecated public void setType(DataForm.Field.Type type)
DataForm.Field.Builder.type - The type.public String getVar()
setVar(String)@Deprecated public void setVar(String var)
DataForm.Field.Builder.var - The var attribute.getVar()public String getLabel()
setLabel(String)@Deprecated public void setLabel(String label)
DataForm.Field.Builder.label - The label.getLabel()public List<DataForm.Option> getOptions()
DataForm.Field.Type.LIST_SINGLE or DataForm.Field.Type.LIST_MULTI.public List<String> getValues()
DataForm.Field.Type.LIST_MULTI, DataForm.Field.Type.JID_MULTI or DataForm.Field.Type.TEXT_MULTI may contain multiple values.public boolean getValueAsBoolean()
public Integer getValueAsInteger()
public Date getValueAsDate()
public List<Jid> getValuesAsJid()
DataForm.Field.Type.JID_MULTI field type.public Jid getValueAsJid()
DataForm.Field.Type.JID_SINGLE field type.public Media getMedia()
@Deprecated public void setMedia(Media media)
DataForm.Field.Builder.media - The media element.getMedia()public String getDescription()
@Deprecated public void setDescription(String description)
DataForm.Field.Builder.description - The description.getDescription()public Validation getValidation()
@Deprecated public void setValidation(Validation validation)
DataForm.Field.Builder.validation - The validation.public boolean isRequired()
@Deprecated public void setRequired(boolean required)
DataForm.Field.Builder.required - If the field is required.isRequired()public int compareTo(DataForm.Field o)
compareTo in interface Comparable<DataForm.Field>Copyright © 2014–2015 XMPP.rocks. All rights reserved.