com.silanis.esl.sdk.builder
Class DocumentBuilder

java.lang.Object
  extended by com.silanis.esl.sdk.builder.DocumentBuilder

public class DocumentBuilder
extends Object

DocumentBuilder class is used to facilitate the creation and customization of a document.


Field Summary
static String DEFAULT_NAME
           
 
Constructor Summary
DocumentBuilder()
           
DocumentBuilder(String name)
          The constructor of this class.
 
Method Summary
 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 withData(DocumentAttributesBuilder builder)
          Set this document's data
 DocumentBuilder withData(Map<String,Object> data)
          Set this document's data
 DocumentBuilder withDescription(String description)
          Set this document's description
 DocumentBuilder withExternal(External external)
           
 DocumentBuilder withExtractionType(ExtractionType extractionType)
          Set this document's extraction type
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

DocumentBuilder

public DocumentBuilder()

DocumentBuilder

public DocumentBuilder(String name)

The constructor of this class.

Parameters:
name - the name of the document produced by the document builder. @size(max="64")
Method Detail

newDocumentWithName

public static DocumentBuilder newDocumentWithName(String name)

Creates the document.

Parameters:
name - the name of the document. @size(max="64")
Returns:
a document builder

enableExtraction

public DocumentBuilder enableExtraction()
Enables the extraction operation against the document. Enabling this setting indicate to the eSignLive document engine that signature positions on the document will be extracted from form fields on the document as opposed to being explicitly defined using x-y coordinates, for example.

Returns:
the document builder itself

fromFile

public DocumentBuilder fromFile(String fileName)
Creates a signing ceremony document from a file on the file system. The extension of the file is used to determine the document type @see DocumentType.

Parameters:
fileName - a valid file path
Returns:
the document builder itself

fromStream

public DocumentBuilder fromStream(InputStream input,
                                  DocumentType type)

Creates a signing ceremony document from a stream.

Parameters:
input - the document content input stream
type - the document type
Returns:
the document builder itself

withSignature

public DocumentBuilder withSignature(SignatureBuilder builder)

Adds a signature to the document.

The builder parameter is a convenient method to create and customize a signature.

Parameters:
builder - the signature builder
Returns:
the document builder itself

withSignature

public DocumentBuilder withSignature(Signature signature)

Adds a signature to the document.

Parameters:
signature - the signature
Returns:
the document builder itself

withExternal

public DocumentBuilder withExternal(External external)

build

public Document build()

Builds the actual document

Returns:
the document

atIndex

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.

Parameters:
index - the order of the document in the document workflow. @min="1"
Returns:
the document builder itself

withId

public DocumentBuilder withId(String id)
Sets the ID value of the document

Parameters:
id - @size(min="1" max="255")
Returns:
the document builder itself

withInjectedField

public DocumentBuilder withInjectedField(FieldBuilder builder)
Set form fields (text, checkbox, etc...) that are stamped on the document. Those fields become part of the document and are not editable.

Parameters:
builder -
Returns:
the document builder itself

withInjectedField

public DocumentBuilder withInjectedField(Field field)

withQRCode

public DocumentBuilder withQRCode(FieldBuilder builder)
Add QR code to the document.

Parameters:
builder -
Returns:
the document builder itself

withQRCode

public DocumentBuilder withQRCode(Field field)
Add QR code to the document.

Parameters:
field - the QR code field
Returns:
the document builder itself

withDescription

public DocumentBuilder withDescription(String description)
Set this document's description

Parameters:
description - @size(max="255")
Returns:
the document builder itself

withData

public DocumentBuilder withData(Map<String,Object> data)
Set this document's data

Parameters:
data -
Returns:
the document builder itself

withData

public DocumentBuilder withData(DocumentAttributesBuilder builder)
Set this document's data

Parameters:
builder -
Returns:
the document attributes builder itselfDocumentConverterTest

withExtractionType

public DocumentBuilder withExtractionType(ExtractionType extractionType)
Set this document's extraction type

Parameters:
extractionType -
Returns:
the document builder itself


Copyright 2014, Silanis Technology, Inc. All rights reserved.