Docmosis API 4.5.0

com.docmosis.template.analysis.structure
Interface TemplateStructureProcessor

All Known Implementing Classes:
JSONDummyDataTemplateStructureProcessor, SimpleJSONTemplateStructureProcessor

public interface TemplateStructureProcessor

This interface defines a processor that can be used by the TemplateStructureExtractor to analyse a template. The TemplateStructureExtractor will call the start() method, a sequence of the other methods based on what is found in the template, then the finish() method.


Method Summary
 void conditionalBegin(TemplateStructureElement section)
          Process the start of a conditional section
 void conditionalEnd(TemplateStructureElement section)
          Process the end of a conditional section
 void field(TemplateStructureElement field)
          Process a template field.
 void finish()
          Perform processing for the end of the template structure.
 void image(TemplateStructureElement image)
          Process a template image
 boolean repeatBegin(TemplateStructureElement section, int iterationIdx)
          Process the start of a repeating section.
 boolean repeatEnd(TemplateStructureElement section, int iterationIdx)
          Process the end of a repeating section
 void start()
          Perform processing for the beginning of the template structure.
 void templateReference(TemplateStructureElement ref)
          Process a reference to another template
 

Method Detail

start

public void start()
Perform processing for the beginning of the template structure.


finish

public void finish()
Perform processing for the end of the template structure.


field

public void field(TemplateStructureElement field)
Process a template field.

Parameters:
field - the field details

image

public void image(TemplateStructureElement image)
Process a template image

Parameters:
image - the image details

templateReference

public void templateReference(TemplateStructureElement ref)
Process a reference to another template

Parameters:
ref - the template reference details

repeatBegin

public boolean repeatBegin(TemplateStructureElement section,
                           int iterationIdx)
Process the start of a repeating section. This method will be called again if the call to repeatEnd for this section returns true (and the iterationIdx will be incremented). This allows the content of the repeating section to be repeated if the TemplateStructureProcessor wishes to repeatedly process this section. This is useful when building data for a template.

Parameters:
section - the section details
iterationIdx - the index of the iteration of this repeating section starting at zero
Returns:
true if this repeat is to be processed. Return false to ignore this section (which stops calls for all content and the call to repeatEnd()).

repeatEnd

public boolean repeatEnd(TemplateStructureElement section,
                         int iterationIdx)
Process the end of a repeating section

Parameters:
section - the section details
iterationIdx - the index of the iteration of this repeating section starting at zero
Returns:
true to iterate this repeating section again

conditionalBegin

public void conditionalBegin(TemplateStructureElement section)
Process the start of a conditional section

Parameters:
section - the section details

conditionalEnd

public void conditionalEnd(TemplateStructureElement section)
Process the end of a conditional section

Parameters:
section - the section details

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.