Class DefaultCommandLineCompiler

    • Field Detail

      • MAXIMUM_ERRORS_TO_OUTPUT

        protected static final int MAXIMUM_ERRORS_TO_OUTPUT
        The compiler will limit the number of error messages it outputs to this number.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultCommandLineCompiler

        protected DefaultCommandLineCompiler​(JobDescription job,
                                             ExitCodeHandler exitCodeHandler,
                                             ErrorManager errorManager)
        Constructs a DefaultCommandLineCompiler.
        Parameters:
        job - The inputs the compiler should process and the options to use.
        errorManager - The error manager to use for error reporting.
    • Method Detail

      • compile

        public java.lang.String compile()
                                 throws GssParserException
        Parses all the inputs, reports error messages and combines the parsed inputs into one stylesheet.
        Returns:
        the resulting stylesheet in string format
        Throws:
        GssParserException
      • execute

        protected java.lang.String execute​(@Nullable
                                           java.io.File renameFile,
                                           @Nullable
                                           java.io.File sourcemapFile)
        Executes the job associated with this compiler and returns the compiled CSS as a string. If renameFile is specified along with a RecordingSubstitutionMap, then the renaming file will be written, as well.
      • writeRenamingMap

        protected void writeRenamingMap​(java.util.Map<java.lang.String,​java.lang.String> renamingMap,
                                        java.io.PrintWriter renamingMapWriter)
        Writes the mappings to the specified writer. By default, mappings are written (one per line) as:
         key:value
         

        Subclasses may override this method to provide alternate output formats. Subclasses must not close the writer.