Class RubyTemplatePrinter

  • All Implemented Interfaces:
    TemplatePrinter

    public final class RubyTemplatePrinter
    extends java.lang.Object
    implements TemplatePrinter
    The RubyTemplatePrinter class prints data of template into a ruby file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] RUBY_KEYWORDS  
      static java.lang.String RUBY_TAB  
    • Constructor Summary

      Constructors 
      Constructor Description
      RubyTemplatePrinter​(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath)
      Constructs a ruby printer with the specified template name.
      RubyTemplatePrinter​(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath, java.lang.String outputDirectory)
      Constructs a ruby printer with the specified template name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAlignedText​(java.lang.String addText)
      Adds the aligned (in accordance of the text structure) text to template file.
      void addComment​(java.lang.String addText)
      Adds the comment to template file.
      void addDataRegion()
      Adds the data region to template file.
      void addHeader()
      Adds a header to template file.
      void addOperation​(java.lang.String operation)
      Adds the operation to template file.
      void addOperation​(java.lang.String opName, java.lang.String opArguments)
      Adds the operation to template file.
      void addString​(java.lang.String addString)
      Adds the string to template file.
      void addText​(java.lang.String addText)
      Adds the text to template file.
      void closeBlock()
      Closes the block in template file.
      void closeSequence​(java.lang.String addText)
      Closes the sequence in template file.
      java.lang.String formattingOperation​(java.lang.String operationName)
      Checks for a match with the keywords and returns not a keyword for the printer with the same value.
      java.lang.String getDataLabel()
      Returns the data region label of the template file.
      void startBlock()
      Opens the block in template file.
      void startSequence​(java.lang.String addText)
      Opens the sequence in template file.
      void templateBegin()
      Adds a title to template file.
      void templateClose()
      Closes the template file.
      void templateEnd()
      Adds end title for template.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RUBY_KEYWORDS

        public static final java.lang.String[] RUBY_KEYWORDS
    • Constructor Detail

      • RubyTemplatePrinter

        public RubyTemplatePrinter​(java.lang.String templateName,
                                   java.lang.String modelName,
                                   java.lang.String baseTemplateName,
                                   java.lang.String baseTemplatePath,
                                   java.lang.String outputDirectory)
        Constructs a ruby printer with the specified template name.
        Parameters:
        templateName - the template name.
        modelName - the model name.
        baseTemplateName - the base template name.
        baseTemplatePath - the base template path.
        outputDirectory - the output directory for template file.
      • RubyTemplatePrinter

        public RubyTemplatePrinter​(java.lang.String templateName,
                                   java.lang.String modelName,
                                   java.lang.String baseTemplateName,
                                   java.lang.String baseTemplatePath)
        Constructs a ruby printer with the specified template name.
        Parameters:
        templateName - the template name.
        modelName - the model name.
        baseTemplateName - the base template name.
        baseTemplatePath - the base template path.
    • Method Detail

      • formattingOperation

        public java.lang.String formattingOperation​(java.lang.String operationName)
        Description copied from interface: TemplatePrinter
        Checks for a match with the keywords and returns not a keyword for the printer with the same value. Example: add - keyword, ADD - not keyword for some languages.
        Specified by:
        formattingOperation in interface TemplatePrinter
        Parameters:
        operationName - name of the operation.
        Returns:
        not keyword name of the operation for the printer.
      • getDataLabel

        public java.lang.String getDataLabel()
        Description copied from interface: TemplatePrinter
        Returns the data region label of the template file.
        Specified by:
        getDataLabel in interface TemplatePrinter
        Returns:
        label of the data region.
      • addOperation

        public void addOperation​(java.lang.String operation)
        Adds the operation to template file.
        Parameters:
        operation - Operation syntax.
      • addOperation

        public void addOperation​(java.lang.String opName,
                                 java.lang.String opArguments)
        Description copied from interface: TemplatePrinter
        Adds the operation to template file.
        Specified by:
        addOperation in interface TemplatePrinter
        Parameters:
        opName - Operation name.
        opArguments - Operation arguments.
      • addString

        public void addString​(java.lang.String addString)
        Description copied from interface: TemplatePrinter
        Adds the string to template file.
        Specified by:
        addString in interface TemplatePrinter
        Parameters:
        addString - string.
      • addText

        public void addText​(java.lang.String addText)
        Description copied from interface: TemplatePrinter
        Adds the text to template file.
        Specified by:
        addText in interface TemplatePrinter
        Parameters:
        addText - text.
      • addAlignedText

        public void addAlignedText​(java.lang.String addText)
        Description copied from interface: TemplatePrinter
        Adds the aligned (in accordance of the text structure) text to template file.
        Specified by:
        addAlignedText in interface TemplatePrinter
        Parameters:
        addText - text.
      • addComment

        public void addComment​(java.lang.String addText)
        Description copied from interface: TemplatePrinter
        Adds the comment to template file.
        Specified by:
        addComment in interface TemplatePrinter
        Parameters:
        addText - text.
      • startSequence

        public void startSequence​(java.lang.String addText)
        Description copied from interface: TemplatePrinter
        Opens the sequence in template file.
        Specified by:
        startSequence in interface TemplatePrinter
        Parameters:
        addText - sequence title.
      • closeSequence

        public void closeSequence​(java.lang.String addText)
        Description copied from interface: TemplatePrinter
        Closes the sequence in template file.
        Specified by:
        closeSequence in interface TemplatePrinter
        Parameters:
        addText - sequence end title.