fr.opensagres.xdocreport.template.freemarker
Class FreemarkerDocumentFormatter
java.lang.Object
fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter
fr.opensagres.xdocreport.template.freemarker.FreemarkerDocumentFormatter
- All Implemented Interfaces:
- IDocumentFormatter
public class FreemarkerDocumentFormatter
- extends AbstractDocumentFormatter
Freemarker document formatter used to format fields list with Freemarker syntax + escape XML and another characters.
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()
|
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 |
parseEndLoop(String content,
DirectivesStack directives,
boolean dontRemoveListDirectiveInfo,
int startOfEndListDirectiveIndex)
|
int |
parseStartLoop(String content,
DirectivesStack directives,
int startOfStartListDirectiveIndex)
|
void |
setConfiguration(ITemplateEngineConfiguration configuration)
|
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 |
ITEM_TOKEN
protected static final String ITEM_TOKEN
- See Also:
- Constant Field Values
FreemarkerDocumentFormatter
public FreemarkerDocumentFormatter()
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
setConfiguration
public void setConfiguration(ITemplateEngineConfiguration configuration)
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)
parseStartLoop
public int parseStartLoop(String content,
DirectivesStack directives,
int startOfStartListDirectiveIndex)
parseEndLoop
public int parseEndLoop(String content,
DirectivesStack directives,
boolean dontRemoveListDirectiveInfo,
int startOfEndListDirectiveIndex)
extractModelTokenPrefix
public String extractModelTokenPrefix(String fieldName)
getIndexOfScript
public int getIndexOfScript(String fieldName)
hasDirective
public boolean hasDirective(String characters)
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)
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.