Docmosis API 4.5.0

com.docmosis.template.analysis.structure
Class JSONDummyDataTemplateStructureProcessor

java.lang.Object
  extended bycom.docmosis.template.analysis.structure.JSONDummyDataTemplateStructureProcessor
All Implemented Interfaces:
TemplateStructureProcessor

public class JSONDummyDataTemplateStructureProcessor
extends Object
implements TemplateStructureProcessor

This class creates dummy data based on the content found in a template. It is not aware of some elements available in templates:

   variables (eg $top)
   expressions {abc=def}
 


Field Summary
protected  JSONObject jsonRoot
           
 
Constructor Summary
JSONDummyDataTemplateStructureProcessor()
           
 
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.
 int getnRepeats()
           
 void image(TemplateStructureElement image)
          Process a template image
 boolean isIncludeImages()
           
 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 setIncludeImages(boolean includeImages)
           
 void setnRepeats(int nRepeats)
           
 void start()
          Perform processing for the beginning of the template structure.
 void templateReference(TemplateStructureElement ref)
          Process a reference to another template
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jsonRoot

protected final JSONObject jsonRoot
Constructor Detail

JSONDummyDataTemplateStructureProcessor

public JSONDummyDataTemplateStructureProcessor()
Method Detail

isIncludeImages

public boolean isIncludeImages()

setIncludeImages

public void setIncludeImages(boolean includeImages)

getnRepeats

public int getnRepeats()

setnRepeats

public void setnRepeats(int nRepeats)

start

public void start()
Description copied from interface: TemplateStructureProcessor
Perform processing for the beginning of the template structure.

Specified by:
start in interface TemplateStructureProcessor

finish

public void finish()
Description copied from interface: TemplateStructureProcessor
Perform processing for the end of the template structure.

Specified by:
finish in interface TemplateStructureProcessor

field

public void field(TemplateStructureElement field)
Description copied from interface: TemplateStructureProcessor
Process a template field.

Specified by:
field in interface TemplateStructureProcessor
Parameters:
field - the field details

image

public void image(TemplateStructureElement image)
Description copied from interface: TemplateStructureProcessor
Process a template image

Specified by:
image in interface TemplateStructureProcessor
Parameters:
image - the image details

templateReference

public void templateReference(TemplateStructureElement ref)
Description copied from interface: TemplateStructureProcessor
Process a reference to another template

Specified by:
templateReference in interface TemplateStructureProcessor
Parameters:
ref - the template reference details

repeatBegin

public boolean repeatBegin(TemplateStructureElement section,
                           int iterationIdx)
Description copied from interface: TemplateStructureProcessor
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.

Specified by:
repeatBegin in interface TemplateStructureProcessor
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)
Description copied from interface: TemplateStructureProcessor
Process the end of a repeating section

Specified by:
repeatEnd in interface TemplateStructureProcessor
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)
Description copied from interface: TemplateStructureProcessor
Process the start of a conditional section

Specified by:
conditionalBegin in interface TemplateStructureProcessor
Parameters:
section - the section details

conditionalEnd

public void conditionalEnd(TemplateStructureElement section)
Description copied from interface: TemplateStructureProcessor
Process the end of a conditional section

Specified by:
conditionalEnd in interface TemplateStructureProcessor
Parameters:
section - the section details

toString

public String toString()

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.