Docmosis API 4.5.0

com.docmosis.template.analysis
Interface TemplateAnalysis

All Superinterfaces:
Serializable

public interface TemplateAnalysis
extends Serializable

A template anaylsis provides details about a (populable) template that may help in processing the template (performance hints). It also may provide hints that can be used when constructing a DataProvider as to what forms of data might be required. This allows data providers to pre-fetch data based on specifics of the template it is populating.


Method Summary
 TemplateField[] getFields()
          Return only the fields in the template in the order they appear in the template.
 long getLength()
          Obtain the total size of the analysis stream.
 ListTree getListTree()
          Get the ListTree describing relationships between numbered lists in the template
 String getOriginalMD5()
          The the MD5 hash string that the template had at the time of storing.
 boolean getProcessedAllowingPaddedFields()
          Determine if this template was processed allowing fields to be padded (eg << abc >>)
 boolean getProcessedWithExternalConverter()
          Determine if this template was processed with the external converter
 TemplateSection[] getSections()
          Get the breakdown of a template as a set of sections.
 char[] getStaticNewStyles()
          Get any new styles derived during analysis
 TemplateAnalysis getStyleAnalysis()
          Get the analysis of the styles of the template.
 MessageAndSuggestions[] getTemplateErrorMessages()
          Get the error messages from the template (if any).
 ImageAnalysis getTemplateImages()
          Get information about the images in the template.
 TextWritableSafeAreas getWritableSafeAreas()
          Get the writable safe areas for validation
 boolean hasDynamicTableStyling()
          Determine if this template has tables with dynamic styling.
 boolean hasTableWithMergedNonBreakingRows()
          Determine if tables are present with merged rows and the "don't-break row" property set.
 boolean hasTemplateErrors()
          Determine if the template has errors in it.
 boolean hasTOC()
          Determine if the template has a Table of Contents (TOC)
 

Method Detail

getSections

public TemplateSection[] getSections()
Get the breakdown of a template as a set of sections.

Returns:
the sections contained in this analysis or null.

getFields

public TemplateField[] getFields()
Return only the fields in the template in the order they appear in the template.

Returns:
null if there are no fields

getLength

public long getLength()
Obtain the total size of the analysis stream.

Returns:
the size of the analysis stream.

getOriginalMD5

public String getOriginalMD5()
The the MD5 hash string that the template had at the time of storing.

Returns:
an MD5 hash string.

hasDynamicTableStyling

public boolean hasDynamicTableStyling()
Determine if this template has tables with dynamic styling.

Returns:
true if table dynamic styling been detected.

hasTemplateErrors

public boolean hasTemplateErrors()
Determine if the template has errors in it. Errors in the template mean it should NOT be used for merging with data, but the template can be used to produce a document showing where the template errors exist (by rendering it to PDF for example).

Returns:
true if the template has errors ("compile" errors).

getTemplateErrorMessages

public MessageAndSuggestions[] getTemplateErrorMessages()
Get the error messages from the template (if any). Messages may also be accompanied by zero or more suggestions.

Returns:
null if there are no errors

getStaticNewStyles

public char[] getStaticNewStyles()
Get any new styles derived during analysis

Returns:
null if there are none.

getTemplateImages

public ImageAnalysis getTemplateImages()
Get information about the images in the template.

Returns:
null if there are no images.

hasTOC

public boolean hasTOC()
Determine if the template has a Table of Contents (TOC)

Returns:

getStyleAnalysis

public TemplateAnalysis getStyleAnalysis()
Get the analysis of the styles of the template. This includes populable fields in headers and footers.

Returns:
null if non exists

hasTableWithMergedNonBreakingRows

public boolean hasTableWithMergedNonBreakingRows()
Determine if tables are present with merged rows and the "don't-break row" property set.

Returns:
true if so

getProcessedWithExternalConverter

public boolean getProcessedWithExternalConverter()
Determine if this template was processed with the external converter

Returns:
true if so

getProcessedAllowingPaddedFields

public boolean getProcessedAllowingPaddedFields()
Determine if this template was processed allowing fields to be padded (eg << abc >>)

Returns:
true if so

getWritableSafeAreas

public TextWritableSafeAreas getWritableSafeAreas()
Get the writable safe areas for validation

Returns:

getListTree

public ListTree getListTree()
Get the ListTree describing relationships between numbered lists in the template

Returns:
an empty list if no lists are present.

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.