fr.opensagres.xdocreport.template.velocity
Class VelocityDocumentFormatter

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

public class VelocityDocumentFormatter
extends AbstractDocumentFormatter

Velocity document formatter used to format fields list with Velocity syntax.


Nested Class Summary
 
Nested classes/interfaces inherited from class fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter
AbstractDocumentFormatter.DirectiveToParse
 
Field Summary
protected static String ITEM_TOKEN
           
protected static String ITEM_TOKEN_OPEN_BRACKET
           
 
Fields inherited from class fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter
NO_ESCAPE
 
Constructor Summary
VelocityDocumentFormatter()
           
 
Method Summary
 boolean containsInterpolation(String content)
           
 int extractListDirectiveInfo(String content, DirectivesStack directives, boolean dontRemoveListDirectiveInfo)
           
 String extractModelTokenPrefix(String fieldName)
           
 String formatAsCallTextStyling(long variableIndex, String fieldName, String documentKind, String syntaxKind, boolean syntaxWithDirective, String elementId, String entryName)
           
 String formatAsFieldItemList(String content, String fieldName, boolean forceAsField)
           
 String formatAsSimpleField(boolean noescape, boolean encloseInDirective, String... fields)
           
 String formatAsTextStylingField(long variableIndex, String property)
           
 String getDefineDirective(String name, String value)
           
 String getElseDirective()
           
 String getEndIfDirective(String fieldName)
           
 String getEndLoopDirective(String itemNameList)
           
 String getEndNoParse()
           
 String getFunctionDirective(boolean noescape, boolean encloseInDirective, String key, String methodName, String... parameters)
           
 int getIndexOfScript(String fieldName)
           
protected  String getItemToken()
           
protected  String getItemTokenOpenBracket()
           
 String getLoopCountDirective(String fieldName)
           
 String getSetDirective(String name, String value, boolean valueIsField)
           
 String getStartIfDirective(String fieldName, boolean exists)
           
 String getStartLoopDirective(String itemNameList, String listName)
           
 String getStartNoParse()
           
 boolean hasDirective(String characters)
           
protected  boolean isModelField(String content, String fieldName)
           
 int parseEndDirective(String content, DirectivesStack directives, boolean dontRemoveListDirectiveInfo, int startOfEndListDirectiveIndex)
           
 int parseStartIf(String content, DirectivesStack directives, int startOfStartIfDirectiveIndex)
           
 int parseStartLoop(String content, DirectivesStack directives, int startOfStartListDirectiveIndex)
           
 
Methods inherited from class fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter
extractItemNameList, extractListDirectiveInfo, formatAsSimpleField, getDirectiveToParse, getEndDocumentDirective, getFunctionDirective, getFunctionDirective, getMinIndex, getSetDirective, getStartDocumentDirective, getStartIfDirective, getStartLoopDirective, getVariableName, setEndDocumentDirective, setStartDocumentDirective
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEM_TOKEN

protected static final String ITEM_TOKEN
See Also:
Constant Field Values

ITEM_TOKEN_OPEN_BRACKET

protected static final String ITEM_TOKEN_OPEN_BRACKET
See Also:
Constant Field Values
Constructor Detail

VelocityDocumentFormatter

public VelocityDocumentFormatter()
Method Detail

formatAsFieldItemList

public String formatAsFieldItemList(String content,
                                    String fieldName,
                                    boolean forceAsField)

getStartLoopDirective

public String getStartLoopDirective(String itemNameList,
                                    String listName)

getEndLoopDirective

public String getEndLoopDirective(String itemNameList)

getElseDirective

public String getElseDirective()

isModelField

protected boolean isModelField(String content,
                               String fieldName)
Specified by:
isModelField in class AbstractDocumentFormatter

getItemToken

protected String getItemToken()
Specified by:
getItemToken in class AbstractDocumentFormatter

getItemTokenOpenBracket

protected String getItemTokenOpenBracket()

getFunctionDirective

public String getFunctionDirective(boolean noescape,
                                   boolean encloseInDirective,
                                   String key,
                                   String methodName,
                                   String... parameters)

formatAsSimpleField

public String formatAsSimpleField(boolean noescape,
                                  boolean encloseInDirective,
                                  String... fields)

getStartIfDirective

public String getStartIfDirective(String fieldName,
                                  boolean exists)

getEndIfDirective

public String getEndIfDirective(String fieldName)

getLoopCountDirective

public String getLoopCountDirective(String fieldName)

containsInterpolation

public boolean containsInterpolation(String content)

extractListDirectiveInfo

public int extractListDirectiveInfo(String content,
                                    DirectivesStack directives,
                                    boolean dontRemoveListDirectiveInfo)

parseEndDirective

public int parseEndDirective(String content,
                             DirectivesStack directives,
                             boolean dontRemoveListDirectiveInfo,
                             int startOfEndListDirectiveIndex)

parseStartIf

public int parseStartIf(String content,
                        DirectivesStack directives,
                        int startOfStartIfDirectiveIndex)

parseStartLoop

public int parseStartLoop(String content,
                          DirectivesStack directives,
                          int startOfStartListDirectiveIndex)

extractModelTokenPrefix

public String extractModelTokenPrefix(String fieldName)

getIndexOfScript

public int getIndexOfScript(String fieldName)

formatAsCallTextStyling

public String formatAsCallTextStyling(long variableIndex,
                                      String fieldName,
                                      String documentKind,
                                      String syntaxKind,
                                      boolean syntaxWithDirective,
                                      String elementId,
                                      String entryName)

formatAsTextStylingField

public String formatAsTextStylingField(long variableIndex,
                                       String property)

hasDirective

public boolean hasDirective(String characters)

getSetDirective

public String getSetDirective(String name,
                              String value,
                              boolean valueIsField)

getStartNoParse

public String getStartNoParse()

getEndNoParse

public String getEndNoParse()

getDefineDirective

public String getDefineDirective(String name,
                                 String value)


Copyright © 2013. All rights reserved.