Package play.data
Class Form.Field
java.lang.Object
play.data.Form.Field
A form field.
-
Constructor Summary
ConstructorsConstructorDescriptionField(Form<?> form, String name, List<F.Tuple<String, List<Object>>> constraints, F.Tuple<String, List<Object>> format, List<ValidationError> errors, String value) Creates a form field.Field(Form<?> form, String name, List<F.Tuple<String, List<Object>>> constraints, F.Tuple<String, List<Object>> format, List<ValidationError> errors, String value, Http.MultipartFormData.FilePart<?> file) Field(Form<?> form, String name, List<F.Tuple<String, List<Object>>> constraints, F.Tuple<String, List<Object>> format, List<ValidationError> errors, Http.MultipartFormData.FilePart<?> file) -
Method Summary
Modifier and TypeMethodDescriptionReturns all the constraints associated with this field.errors()Returns all the errors associated with this field.file()format()Returns the expected format for this field.indexes()name()Get a sub-field, with a key relative to the current field.Get a sub-field, with a key relative to the current field.toString()value()
-
Constructor Details
-
Field
public Field(Form<?> form, String name, List<F.Tuple<String, List<Object>>> constraints, F.Tuple<String, List<Object>> format, List<ValidationError> errors, String value) Creates a form field.- Parameters:
form- the form.name- the field nameconstraints- the constraints associated with the fieldformat- the format expected for this fielderrors- the errors associated with this fieldvalue- the field value, if any
-
Field
-
Field
-
-
Method Details
-
name
- Returns:
- The field name.
-
value
- Returns:
- The field value, if defined.
-
file
- Returns:
- The file, if defined.
-
errors
Returns all the errors associated with this field.- Returns:
- The errors associated with this field.
-
constraints
Returns all the constraints associated with this field.- Returns:
- The constraints associated with this field.
-
format
Returns the expected format for this field.- Returns:
- The expected format for this field.
-
indexes
- Returns:
- the indexes available for this field (for repeated fields and List)
-
sub
Get a sub-field, with a key relative to the current field.- Parameters:
key- the key- Returns:
- the subfield corresponding to the key.
-
sub
Get a sub-field, with a key relative to the current field.- Parameters:
key- the keylang- used for formatting- Returns:
- the subfield corresponding to the key.
-
toString
-