Class Document
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.support.Document
-
public class Document extends AbstractResource
Represents a document and its associated (optional) form fields and custom fields. It is also populated based on the API response. This response typically contains the file name and index of the document within the signature request.
-
-
Field Summary
-
Fields inherited from class com.hellosign.sdk.resource.AbstractResource
dataObj, warnings
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFormField(FormField formField)
Adds the form field to this document.java.util.List<CustomField>
getCustomFields()
Returns the custom fields for this document.java.io.File
getFile()
Returns the File associated with this document.java.util.List<FormField>
getFormFields()
Returns the form fields for this document.java.lang.Integer
getIndex()
java.lang.String
getName()
boolean
hasName()
void
setFile(java.io.File file)
Sets the file associated with this document.void
setFormFields(java.util.List<FormField> formFields)
Overwrites the form fields for this document.void
setIndex(java.lang.Integer index)
void
setName(java.lang.String name)
-
Methods inherited from class com.hellosign.sdk.resource.AbstractResource
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getObject, getString, getWarnings, has, hasString, set, toString, toString
-
-
-
-
Constructor Detail
-
Document
public Document()
-
Document
public Document(org.json.JSONObject json) throws HelloSignException
- Throws:
HelloSignException
-
-
Method Detail
-
getFormFields
public java.util.List<FormField> getFormFields()
Returns the form fields for this document.- Returns:
- List
-
setFormFields
public void setFormFields(java.util.List<FormField> formFields) throws HelloSignException
Overwrites the form fields for this document. This is useful when manually migrating form fields from a template.- Parameters:
formFields
- List- Throws:
HelloSignException
- thrown if there is a problem adding the FormFields to this Document.
-
addFormField
public void addFormField(FormField formField) throws HelloSignException
Adds the form field to this document.- Parameters:
formField
- FormField- Throws:
HelloSignException
- thrown if there is a problem adding the FormFields to this Document.
-
getCustomFields
public java.util.List<CustomField> getCustomFields()
Returns the custom fields for this document.- Returns:
- List
-
getFile
public java.io.File getFile()
Returns the File associated with this document.- Returns:
- File, or null if it hasn't been set
-
setFile
public void setFile(java.io.File file)
Sets the file associated with this document.- Parameters:
file
- File
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
hasName
public boolean hasName()
-
getIndex
public java.lang.Integer getIndex()
-
setIndex
public void setIndex(java.lang.Integer index)
-
-