Class LispJessopScriptBuilder

java.lang.Object
com.randomnoun.common.jessop.AbstractJessopScriptBuilder
com.randomnoun.common.jessop.lang.LispJessopScriptBuilder
All Implemented Interfaces:
JessopScriptBuilder

  • Constructor Details

  • Method Details

    • emitText

      public void emitText(int line, String s)
      Description copied from interface: JessopScriptBuilder
      Called by the tokeniser and requests that this JessopScriptBuilder generate code to generate some text output.

      This method should escape the output and generate code that outputs this text in the implementation language.

      Specified by:
      emitText in interface JessopScriptBuilder
      Specified by:
      emitText in class AbstractJessopScriptBuilder
      Parameters:
      line - jessop source line number that begins this text output
      s - the text to output; may include newlines.
    • emitExpression

      public void emitExpression(int line, String s)
      Description copied from interface: JessopScriptBuilder
      Called by the tokeniser and requests that this JessopScriptBuilder generate code to generate some evaluated output. i.e. process a <%= ... %> expression.

      This method should generate the code to evaluate and output the contents of the <%= ... %> expression.

      This method should attempt to preserve line numbers between the jessop source file and the generated code file.

      Specified by:
      emitExpression in interface JessopScriptBuilder
      Specified by:
      emitExpression in class AbstractJessopScriptBuilder
      Parameters:
      line - jessop source line number that begins this text output.
      s - the contents of the <%= ... %> expression.
    • emitScriptlet

      public void emitScriptlet(int line, String s)
      Description copied from interface: JessopScriptBuilder
      Called by the tokeniser and requests that this JessopScriptBuilder copy the included code into the generated script. i.e. process a <% ... %> scriptlet. (The 'scriptlet' term is the term used in the JSP specification)

      This method should generate the same code that is contained within the <% ... %> scriptlet.

      This method should attempt to preserve line numbers between the jessop source file and the generated code file.

      This scriptlet may not be syntactically correct by itself and may require further scriptlets to function, e.g.

       <% if (a > b) { %>
       something
       <% } %>
       
      Specified by:
      emitScriptlet in interface JessopScriptBuilder
      Specified by:
      emitScriptlet in class AbstractJessopScriptBuilder
      Parameters:
      line - jessop source line number that begins this scriptlet.
      s - the contents of the <%= ... %> expression.
    • getLanguage

      public String getLanguage()
      Description copied from interface: JessopScriptBuilder
      Returns the name of the language that this scriptBuilder can parse; e.g. "javascript" or "python2".

      This is used to register this JessopScriptBuilder in the registry and is used to lookup the JessopScriptBuilder from the language defined in the jessop script declaration.

      Specified by:
      getLanguage in interface JessopScriptBuilder
      Returns:
      the name of the language that this scriptBuilder can parse; e.g. "javascript" or "python2".
    • getDefaultScriptEngineName

      Description copied from interface: JessopScriptBuilder
      Returns the name of the script engine that is used to evaluate this script; e.g. "rhino" or "jython"
      Specified by:
      getDefaultScriptEngineName in interface JessopScriptBuilder
      Returns:
      the name of the script engine that is used to evaluate this script; e.g. "rhino" or "jython"
    • getDefaultExceptionConverterClassName

      Description copied from interface: JessopScriptBuilder
      Returns the name of the default exceptionConverter class that should be used for the default script engine, or null if no converter is required.

      Changing the engine in the jessop declaration will reset the the converter to null.

      Specified by:
      getDefaultExceptionConverterClassName in interface JessopScriptBuilder
      Overrides:
      getDefaultExceptionConverterClassName in class AbstractJessopScriptBuilder
      Returns:
      the name of the default exceptionConverter class that should be used for the default script engine