Package play.data
Class Form.Field
- Object
-
- play.data.Form.Field
-
-
Constructor Summary
Constructors Constructor Description 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.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<F.Tuple<String,List<Object>>>
constraints()
Returns all the constraints associated with this field.List<ValidationError>
errors()
Returns all the errors associated with this field.<A> Optional<Http.MultipartFormData.FilePart<A>>
file()
F.Tuple<String,List<Object>>
format()
Returns the expected format for this field.List<Integer>
indexes()
Optional<String>
name()
Form.Field
sub(String key)
Get a sub-field, with a key relative to the current field.Form.Field
sub(String key, Lang lang)
Get a sub-field, with a key relative to the current field.String
toString()
Optional<String>
value()
-
-
-
Constructor Detail
-
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
public 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 Detail
-
file
public <A> Optional<Http.MultipartFormData.FilePart<A>> file()
- Returns:
- The file, if defined.
-
errors
public List<ValidationError> errors()
Returns all the errors associated with this field.- Returns:
- The errors associated with this field.
-
constraints
public List<F.Tuple<String,List<Object>>> constraints()
Returns all the constraints associated with this field.- Returns:
- The constraints associated with this field.
-
format
public F.Tuple<String,List<Object>> format()
Returns the expected format for this field.- Returns:
- The expected format for this field.
-
indexes
public List<Integer> indexes()
- Returns:
- the indexes available for this field (for repeated fields and List)
-
sub
public Form.Field sub(String key)
Get a sub-field, with a key relative to the current field.- Parameters:
key
- the key- Returns:
- the subfield corresponding to the key.
-
sub
public Form.Field sub(String key, Lang lang)
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.
-
-