Package com.nomagic.magicreport.parser
Class TemplateParser
java.lang.Object
com.nomagic.magicreport.parser.TemplateParser
Provides utilities to parse a template.
- Since:
- Aug 30, 2007
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractDirective(StringBuilder buffer, int offset, String directiveName, Class<?>[] parameterTypes, Template template) Extract a directive from buffer string.intlineCount(CharSequence input) Count number of line from given input.voidsetCommentString(String commentString) Set string for in-line comment.
-
Constructor Details
-
TemplateParser
public TemplateParser()
-
-
Method Details
-
setCommentString
Set string for in-line comment.- Parameters:
commentString- string for in-line comment
-
lineCount
Count number of line from given input.- Parameters:
input- the input string- Returns:
- number of line
-
extractDirective
public Directive extractDirective(StringBuilder buffer, int offset, String directiveName, Class<?>[] parameterTypes, Template template) throws ParseErrorException Extract a directive from buffer string.- Parameters:
buffer- a buffer string contains templateoffset- starting offsetdirectiveName- name of directive. Begin with # e.g. #importparameterTypes- directive parameter typetemplate- a template- Returns:
- directive of null if no directive matches with directive name and parameter type
- Throws:
ParseErrorException- if directive structure is not recognize by parser.
-