fr.opensagres.xdocreport.template.formatter
Class AbstractDocumentFormatter

java.lang.Object
  extended by fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter
All Implemented Interfaces:
IDocumentFormatter

public abstract class AbstractDocumentFormatter
extends java.lang.Object
implements IDocumentFormatter


Nested Class Summary
protected static class AbstractDocumentFormatter.DirectiveToParse
           
 
Field Summary
static java.lang.String NO_ESCAPE
           
 
Constructor Summary
AbstractDocumentFormatter()
           
 
Method Summary
 java.lang.String extractItemNameList(java.lang.String content, java.lang.String fieldName, boolean forceAsField)
           
 int extractListDirectiveInfo(java.lang.String content, DirectivesStack directives)
           
 java.lang.String formatAsSimpleField(boolean encloseInDirective, java.lang.String... fields)
           
protected  AbstractDocumentFormatter.DirectiveToParse getDirectiveToParse(int startLoopIndex, int endLoopIndex, int startIfIndex, int endIfIndex)
           
 java.lang.String getEndDocumentDirective()
           
 java.lang.String getFunctionDirective(java.lang.String key, java.lang.String methodName, java.lang.String... parameters)
           
protected abstract  java.lang.String getItemToken()
           
 int getMinIndex(int startLoopIndex, int endLoopIndex, int startIfIndex, int endIfIndex)
           
 java.lang.String getSetDirective(java.lang.String name, java.lang.String value)
           
 java.lang.String getStartDocumentDirective()
           
 java.lang.String getStartIfDirective(java.lang.String fieldName)
           
 java.lang.String getStartLoopDirective(java.lang.String itemNameList)
           
protected  java.lang.String getVariableName(long variableIndex)
           
protected abstract  boolean isModelField(java.lang.String content, java.lang.String fieldName)
           
 void setEndDocumentDirective(java.lang.String endDocumentDirective)
           
 void setStartDocumentDirective(java.lang.String startDocumentDirective)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.opensagres.xdocreport.template.formatter.IDocumentFormatter
containsInterpolation, extractListDirectiveInfo, extractModelTokenPrefix, formatAsCallTextStyling, formatAsFieldItemList, formatAsSimpleField, formatAsTextStylingField, getDefineDirective, getElseDirective, getEndIfDirective, getEndLoopDirective, getEndNoParse, getFunctionDirective, getIndexOfScript, getLoopCountDirective, getSetDirective, getStartIfDirective, getStartLoopDirective, getStartNoParse, hasDirective
 

Field Detail

NO_ESCAPE

public static final java.lang.String NO_ESCAPE
See Also:
Constant Field Values
Constructor Detail

AbstractDocumentFormatter

public AbstractDocumentFormatter()
Method Detail

extractItemNameList

public java.lang.String extractItemNameList(java.lang.String content,
                                            java.lang.String fieldName,
                                            boolean forceAsField)
Specified by:
extractItemNameList in interface IDocumentFormatter

getStartDocumentDirective

public java.lang.String getStartDocumentDirective()
Specified by:
getStartDocumentDirective in interface IDocumentFormatter

setStartDocumentDirective

public void setStartDocumentDirective(java.lang.String startDocumentDirective)

getEndDocumentDirective

public java.lang.String getEndDocumentDirective()
Specified by:
getEndDocumentDirective in interface IDocumentFormatter

setEndDocumentDirective

public void setEndDocumentDirective(java.lang.String endDocumentDirective)

getStartLoopDirective

public java.lang.String getStartLoopDirective(java.lang.String itemNameList)
Specified by:
getStartLoopDirective in interface IDocumentFormatter

extractListDirectiveInfo

public int extractListDirectiveInfo(java.lang.String content,
                                    DirectivesStack directives)
Specified by:
extractListDirectiveInfo in interface IDocumentFormatter

getItemToken

protected abstract java.lang.String getItemToken()

isModelField

protected abstract boolean isModelField(java.lang.String content,
                                        java.lang.String fieldName)

getDirectiveToParse

protected AbstractDocumentFormatter.DirectiveToParse getDirectiveToParse(int startLoopIndex,
                                                                         int endLoopIndex,
                                                                         int startIfIndex,
                                                                         int endIfIndex)

getMinIndex

public int getMinIndex(int startLoopIndex,
                       int endLoopIndex,
                       int startIfIndex,
                       int endIfIndex)

getVariableName

protected java.lang.String getVariableName(long variableIndex)

formatAsSimpleField

public java.lang.String formatAsSimpleField(boolean encloseInDirective,
                                            java.lang.String... fields)
Specified by:
formatAsSimpleField in interface IDocumentFormatter

getFunctionDirective

public java.lang.String getFunctionDirective(java.lang.String key,
                                             java.lang.String methodName,
                                             java.lang.String... parameters)
Specified by:
getFunctionDirective in interface IDocumentFormatter

getSetDirective

public java.lang.String getSetDirective(java.lang.String name,
                                        java.lang.String value)
Specified by:
getSetDirective in interface IDocumentFormatter

getStartIfDirective

public java.lang.String getStartIfDirective(java.lang.String fieldName)
Specified by:
getStartIfDirective in interface IDocumentFormatter


Copyright © 2012. All Rights Reserved.