public interface EDoc2 extends Validatable
EDoc2Builder to create new or open existing documents.| Modifier and Type | Method and Description |
|---|---|
DataObject |
addDataObject(File file)
Adds data object to the document from
File |
DataObject |
addDataObject(InputStream inputStream,
String name,
String mimeType)
Adds data object to the document from
InputStream |
EDoc2BasicSignature |
addSignature()
Adds a new signature to the document with default properties
|
EDoc2BasicSignature |
addSignature(Map<String,String> properties)
Adds a new signature to the document with specified properties.
|
void |
close()
Cleans all temporary files and frees resources
|
DataObject |
getDataObject(int index)
Returns a data object by index of data object list of the document
|
int |
getDataObjectCount()
Returns count of data objects of the document
|
EDoc2Signature |
getSignature(int index)
Returns signature by index from the signature list of the document
|
EDoc2Signature |
getSignature(String signatureId)
Returns signature by id from the signature list of the document
|
int |
getSignatureCount()
Returns count of signatures of the document
|
String |
getVersion()
Returns the document format version number
|
void |
removeDataObject(int index)
Removes a data object from the document by index of the document's data object list
|
void |
removeSignature(int index)
Removes signature from the document by index of the signature list
|
void |
removeSignature(String signatureId)
Removes signature from the document by id of the signature list
|
void |
writeTo(File file)
Validates all signature states and writes the document content to file.
|
void |
writeTo(OutputStream outputStream)
Validates all signature states and writes the document content to output stream.
|
validate, validateDataObject addDataObject(File file) throws EDoc2Exception
Filefile - data fileEDoc2Exception - if an error occurs.DataObject addDataObject(InputStream inputStream, String name, String mimeType) throws EDoc2Exception
InputStreaminputStream - Input stream of the data objectname - name of the data objectmimeType - mime type of the data objectEDoc2Exception - if an error occurs.int getDataObjectCount()
DataObject getDataObject(int index)
index - index of the data object of the document's data object listIndexOutOfBoundsException - if index is out of bounds.void removeDataObject(int index)
throws EDoc2Exception
index - index of the data object of the document's data object listEDoc2Exception - if an error occurs.EDoc2BasicSignature addSignature() throws EDoc2Exception
EDoc2Exception - if an error occurs.SignatureProfileEDoc2BasicSignature addSignature(Map<String,String> properties) throws EDoc2Exception
properties - EDoc2Exception - if an error occurs.SignatureProfile,
EDoc2Signature.KEY_SIGNATURE_METHOD_URIint getSignatureCount()
EDoc2Signature getSignature(int index)
index - index from signature list of the documentnull if index is out of boundsEDoc2Signature getSignature(String signatureId)
signatureId - id from signature list of the documentnull if id is unknownvoid removeSignature(int index)
throws EDoc2Exception
index - index from signature list of the documentEDoc2Exception - if could not remove the signature.void removeSignature(String signatureId) throws EDoc2Exception
signatureId - id from signature list of the documentEDoc2Exception - if could not remove the signature.String getVersion()
void writeTo(File file) throws EDoc2Exception
file - output file.EDoc2Exception - if any of signature is not completed.void writeTo(OutputStream outputStream) throws EDoc2Exception
outputStream - write destination.EDoc2Exception - if any of signature is not completed.EDoc2Signature.complete()void close()
throws EDoc2Exception
EDoc2Exception - if an error occurs.