public class FormData extends Object implements Iterable<FormData.FieldData>
Modifier and Type | Class and Description |
---|---|
class |
FormData.FieldData
Inner class to represent the value of a field on a form
|
Modifier and Type | Field and Description |
---|---|
protected Map<String,FormData.FieldData> |
data |
Constructor and Description |
---|
FormData()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addFieldData(org.springframework.extensions.webscripts.servlet.FormData.FormField field)
Adds the given webscript FormField object to the form.
|
void |
addFieldData(String fieldName,
Object fieldValue)
Adds the given data to the form.
|
void |
addFieldData(String fieldName,
Object fieldValue,
boolean overwrite)
Adds the given data to the form.
|
FormData.FieldData |
getFieldData(String fieldName)
Returns the data for the given field.
|
Set<String> |
getFieldNames()
Returns a list of the names of the fields held by this
object.
|
int |
getNumberOfFields()
Returns the number of fields data is being held for.
|
boolean |
hasFieldData(String fieldName)
Determines whether field data for the given item exists.
|
Iterator<FormData.FieldData> |
iterator()
Returns an Iterator over the FieldData objects
held by this object.
|
void |
removeFieldData(String fieldName)
Removes the data associated with the given field
if it exists.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected Map<String,FormData.FieldData> data
public boolean hasFieldData(String fieldName)
fieldName
- Name of field to look forpublic FormData.FieldData getFieldData(String fieldName)
fieldName
- Name of field to look forpublic void addFieldData(String fieldName, Object fieldValue)
NOTE: Adding the same named data will append the value and thereafter return a List containing all added values.
fieldName
- The name of the fieldfieldValue
- The value of the datapublic void addFieldData(org.springframework.extensions.webscripts.servlet.FormData.FormField field)
field
- A WebScript FormField objectpublic void addFieldData(String fieldName, Object fieldValue, boolean overwrite)
If overwrite is true the provided value replaces the existing value whereas false will force the creation of a List (if necessary) and the provided value will be added to the List.
fieldName
- The name of the fieldfieldValue
- The value of the dataoverwrite
- booleanpublic void removeFieldData(String fieldName)
fieldName
- Name of the field to removepublic Set<String> getFieldNames()
public int getNumberOfFields()
public Iterator<FormData.FieldData> iterator()
iterator
in interface Iterable<FormData.FieldData>
Copyright © 2005–2017 Alfresco Software. All rights reserved.