Class TemplateParser

java.lang.Object
com.nomagic.magicreport.parser.TemplateParser

@OpenApiAll public class TemplateParser extends Object
Provides utilities to parse a template.
Since:
Aug 30, 2007
  • Constructor Details

    • TemplateParser

      public TemplateParser()
  • Method Details

    • setCommentString

      public void setCommentString(String commentString)
      Set string for in-line comment.
      Parameters:
      commentString - string for in-line comment
    • lineCount

      public int lineCount(CharSequence input)
      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 template
      offset - starting offset
      directiveName - name of directive. Begin with # e.g. #import
      parameterTypes - directive parameter type
      template - 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.