Class DefaultCommandLineCompiler
- java.lang.Object
-
- com.google.common.css.AbstractCommandLineCompiler<JobDescription>
-
- com.google.common.css.compiler.commandline.DefaultCommandLineCompiler
-
- Direct Known Subclasses:
ClosureCommandLineCompiler,ClosureStylesheetCompiler
public class DefaultCommandLineCompiler extends AbstractCommandLineCompiler<JobDescription>
DefaultCommandLineCompilerprovides the CSS parser from command line interface to users.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultCommandLineCompiler.CompilerErrorManagerAn error message handler.
-
Field Summary
Fields Modifier and Type Field Description protected static intMAXIMUM_ERRORS_TO_OUTPUTThe compiler will limit the number of error messages it outputs to this number.-
Fields inherited from class com.google.common.css.AbstractCommandLineCompiler
compilerWasUsed, ERROR_MESSAGE_EXIT_CODE, exitCodeHandler, INTERNAL_ERROR_EXIT_CODE, job, SUCCESS_EXIT_CODE, UNHANDLED_EXCEPTION_EXIT_CODE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultCommandLineCompiler(JobDescription job, ExitCodeHandler exitCodeHandler, ErrorManager errorManager)Constructs aDefaultCommandLineCompiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcompile()Parses all the inputs, reports error messages and combines the parsed inputs into one stylesheet.protected java.lang.Stringexecute(java.io.File renameFile, java.io.File sourcemapFile)Executes the job associated with this compiler and returns the compiled CSS as a string.protected voidwriteRenamingMap(java.util.Map<java.lang.String,java.lang.String> renamingMap, java.io.PrintWriter renamingMapWriter)Writes the mappings to the specified writer.-
Methods inherited from class com.google.common.css.AbstractCommandLineCompiler
exitOnUnhandledException
-
-
-
-
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 aDefaultCommandLineCompiler.- 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 GssParserExceptionParses 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. IfrenameFileis specified along with aRecordingSubstitutionMap, 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.
-
-