public static final class DataForm.Field extends Object implements Comparable<DataForm.Field>
| Modifier and Type | Class and Description |
|---|---|
static class |
DataForm.Field.Type
Defines field types.
|
| Constructor and Description |
|---|
Field(DataForm.Field.Type type)
Creates a field.
|
Field(DataForm.Field.Type type,
String var,
String... values)
Creates a field.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
List<String> |
getValues()
Gets the values of the field.
|
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)
Sets a description of the field.
|
void |
setLabel(String label)
Sets the field label.
|
void |
setMedia(Media media)
Sets a media element.
|
void |
setRequired(boolean required)
Sets the field as required.
|
void |
setType(DataForm.Field.Type type)
Sets the field type.
|
void |
setValidation(Validation validation)
Sets the validation for this field.
|
void |
setVar(String var)
Sets a unique identifier for the field in the context of the form.
|
public Field(DataForm.Field.Type type)
type - The field type.public Field(DataForm.Field.Type type, String var, String... values)
type - The field type.var - The unique identifier for the field.values - The values.public DataForm.Field.Type getType()
public void setType(DataForm.Field.Type type)
type - The type.public String getVar()
setVar(String)public void setVar(String var)
var - The var attribute.getVar()public String getLabel()
setLabel(String)public void setLabel(String label)
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 Media getMedia()
setMedia(rocks.xmpp.extensions.data.mediaelement.model.Media)public void setMedia(Media media)
media - The media element.getMedia()public String getDescription()
setDescription(String)public void setDescription(String description)
description - The description.getDescription()public Validation getValidation()
public void setValidation(Validation validation)
validation - The validation.public boolean isRequired()
setRequired(boolean)public void setRequired(boolean required)
required - If the field is required.isRequired()public int compareTo(DataForm.Field o)
compareTo in interface Comparable<DataForm.Field>Copyright © 2014 XMPP.rocks. All rights reserved.