de.innovationgate.wgaservices.types
public class Form extends Object
Constructor and Description |
---|
Form()
Creates a form without id
|
Form(String id)
Creates a form with the given id.
|
Modifier and Type | Method and Description |
---|---|
void |
addFileAsAttachment(File file)
Adds a file from file system to the form as attachment.
|
void |
addFileAsAttachment(File file,
String name)
Adds a file from file system to the form as attachment, leaving you the choice to specify the attachment file name.
|
DataSource |
attachmentData(String name)
Returns the data of an attachment file as DataSource
|
Set<String> |
attachmentNames()
Returns the names of all attachments stored to the form
|
Set<String> |
fieldNames()
Returns the names of all stored fields
|
List<Object> |
fieldValues(String name)
Returns the values stored for a field
|
Map<String,Object> |
getAttachments()
Returns a map containing all attachments at the form.
|
FormField |
getField(String name) |
Set<FormField> |
getFields()
Returns the set that contains the stored fields.
|
String |
getId()
Returns the id of the form
|
boolean |
hasField(String name)
Returns if a field is stored at the form
|
boolean |
isTrim()
Returns if this form is to be trimmed
|
void |
removeField(String name)
Removes a field from the form
|
void |
setAttachments(Map<String,Object> attachments)
JavaBean setter for attachments table.
|
void |
setField(String name,
Date value)
Sets a field with a date value
|
void |
setField(String name,
List<Object> values)
Sets a field with multiple values
|
void |
setField(String name,
Number value)
Sets a field with a number value
|
void |
setField(String name,
String value)
Sets a field with a string value
|
void |
setFields(Set<FormField> fields)
JavaBean setter for fields table.
|
void |
setId(String id)
Sets the id of the form, just like attribute "id" at <tml:form>
|
void |
setTrim(boolean trim)
Sets if this form is to be trimmed, like attribute "trim" for <tml:form>
|
public Form(String id)
id
- The form id, just like the id-attribute on <tml:form>public Form()
public void setFields(Set<FormField> fields)
setField(String, List)
and variants.fields
- public void setField(String name, String value)
name
- Name of the fieldvalue
- Value of the fieldpublic void setField(String name, List<Object> values)
name
- Name of the fieldvalues
- The values as Listpublic void setField(String name, Number value)
name
- The name of the fieldvalue
- The number valuepublic void setField(String name, Date value)
name
- The name of the fieldvalue
- The date valuepublic void removeField(String name)
name
- The name of the fieldpublic void addFileAsAttachment(File file, String name)
file
- The file to attachname
- The file name of the attachment at the formpublic void addFileAsAttachment(File file)
file
- The file to attachpublic Set<String> attachmentNames()
public Map<String,Object> getAttachments()
public void setAttachments(Map<String,Object> attachments)
addFileAsAttachment(File)
.attachments
- public DataSource attachmentData(String name)
name
- The name of the attachment filepublic String getId()
public void setId(String id)
public boolean isTrim()
public void setTrim(boolean trim)
public List<Object> fieldValues(String name)
name
- The field namepublic boolean hasField(String name)
name
- The name of the field