Interface ScriptCompiler


  • @ConsumerType
    public interface ScriptCompiler
    Compiler defines a generic compiler.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void compile​(java.util.Collection<ScriptResource> src, java.io.Writer dst, CompilerContext ctx)
      Compiles a given collection of resources.
      java.lang.String getMimeType()
      Returns the mime type of the output file.
      java.lang.String getName()
      Name of this compiler.
      java.lang.String getOutputExtension()
      Returns the extension of the output file
      boolean handles​(java.lang.String extension)
      Checks if this compiler handles the file with the given extension
    • Method Detail

      • getName

        java.lang.String getName()
        Name of this compiler.
        Returns:
        the name
      • handles

        boolean handles​(java.lang.String extension)
        Checks if this compiler handles the file with the given extension
        Parameters:
        extension - extension, eg 'less'
        Returns:
        true if this compiler handles the extension
      • getMimeType

        java.lang.String getMimeType()
        Returns the mime type of the output file.
        Returns:
        the mime type.
      • getOutputExtension

        java.lang.String getOutputExtension()
        Returns the extension of the output file
        Returns:
        the extension of the output file. eg. 'css'
      • compile

        void compile​(java.util.Collection<ScriptResource> src,
                     java.io.Writer dst,
                     CompilerContext ctx)
              throws java.io.IOException
        Compiles a given collection of resources.
        Parameters:
        src - resource to compile
        dst - writer to write the compiled output
        ctx - the compiler context
        Throws:
        java.io.IOException - of an I/O error occurs