public class DocumentBuilder extends Object
DocumentBuilder class is used to facilitate the creation and customization of a document.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME |
Constructor and Description |
---|
DocumentBuilder() |
DocumentBuilder(String name)
The constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
DocumentBuilder |
atIndex(int index)
Defines the order that documents must be signed in.
|
Document |
build()
Builds the actual document
|
DocumentBuilder |
enableExtraction()
Enables the extraction operation against the document.
|
DocumentBuilder |
fromFile(String fileName)
Creates a signing ceremony document from a file on the file system.
|
DocumentBuilder |
fromStream(InputStream input,
DocumentType type)
Creates a signing ceremony document from a stream.
|
static DocumentBuilder |
newDocumentWithName(String name)
Creates the document.
|
DocumentBuilder |
withDescription(String description)
Set this document's description
|
DocumentBuilder |
withExternal(External external) |
DocumentBuilder |
withId(String id)
Sets the ID value of the document
|
DocumentBuilder |
withInjectedField(Field field) |
DocumentBuilder |
withInjectedField(FieldBuilder builder)
Set form fields (text, checkbox, etc...) that are stamped on the
document.
|
DocumentBuilder |
withQRCode(Field field)
Add QR code to the document.
|
DocumentBuilder |
withQRCode(FieldBuilder builder)
Add QR code to the document.
|
DocumentBuilder |
withSignature(Signature signature)
Adds a signature to the document.
|
DocumentBuilder |
withSignature(SignatureBuilder builder)
Adds a signature to the document.
|
public static final String DEFAULT_NAME
public DocumentBuilder()
public DocumentBuilder(String name)
The constructor of this class.
name
- the name of the document produced by the document builder. @size(max="64")public static DocumentBuilder newDocumentWithName(String name)
Creates the document.
name
- the name of the document. @size(max="64")public DocumentBuilder enableExtraction()
public DocumentBuilder fromFile(String fileName)
fileName
- a valid file pathpublic DocumentBuilder fromStream(InputStream input, DocumentType type)
Creates a signing ceremony document from a stream.
input
- the document content input streamtype
- the document typepublic DocumentBuilder withSignature(SignatureBuilder builder)
Adds a signature to the document.
The builder parameter is a convenient method to create and customize a signature.
builder
- the signature builderpublic DocumentBuilder withSignature(Signature signature)
Adds a signature to the document.
signature
- the signaturepublic DocumentBuilder withExternal(External external)
public Document build()
Builds the actual document
public DocumentBuilder atIndex(int index)
Defines the order that documents must be signed in.
Thus, the documents with smaller values of their index will be shown first to the signer in the overall document workflow.
index
- the order of the document in the document workflow. @min="1"public DocumentBuilder withId(String id)
id
- @size(min="1" max="255")public DocumentBuilder withInjectedField(FieldBuilder builder)
builder
- public DocumentBuilder withInjectedField(Field field)
public DocumentBuilder withQRCode(FieldBuilder builder)
builder
- public DocumentBuilder withQRCode(Field field)
field
- the QR code fieldpublic DocumentBuilder withDescription(String description)
description
- @size(max="255")Copyright 2014, Silanis Technology, Inc. All rights reserved.