Package com.google.common.css
Class AbstractCommandLineCompiler<T extends JobDescription>
java.lang.Object
com.google.common.css.AbstractCommandLineCompiler<T>
- Direct Known Subclasses:
DefaultCommandLineCompiler
An abstract class that is designed to be extended by classes that provide a
command line interface to the CSS parser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether the compiler was called.static final intExit code for compilation errors.protected final ExitCodeHandlerUsed to manage calls to System.exit().static final intExit code for abnormal compiler behavior, such as violated invariants, infinite loops and the likes.protected final TThe job to process: the inputs and the options.static final intExit code for success (normal operation of the compiler, possibly with warnings and informational messages, but with no errors whatsoever).static final intExit code for unhandled exceptions (such as IOException). -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCommandLineCompiler(T job, ExitCodeHandler exitCodeHandler) Constructs anAbstractCommandLineCompiler. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidexitOnUnhandledException(Exception e, ExitCodeHandler exitCodeHandler) Prints a message announcing an unhandled exception and exits.
-
Field Details
-
SUCCESS_EXIT_CODE
public static final int SUCCESS_EXIT_CODEExit code for success (normal operation of the compiler, possibly with warnings and informational messages, but with no errors whatsoever).- See Also:
-
ERROR_MESSAGE_EXIT_CODE
public static final int ERROR_MESSAGE_EXIT_CODEExit code for compilation errors. The compiler processed the input normally, but the input was wrong in some way.- See Also:
-
UNHANDLED_EXCEPTION_EXIT_CODE
public static final int UNHANDLED_EXCEPTION_EXIT_CODEExit code for unhandled exceptions (such as IOException).- See Also:
-
INTERNAL_ERROR_EXIT_CODE
public static final int INTERNAL_ERROR_EXIT_CODEExit code for abnormal compiler behavior, such as violated invariants, infinite loops and the likes.- See Also:
-
job
The job to process: the inputs and the options. -
compilerWasUsed
protected boolean compilerWasUsedWhether the compiler was called. We don't allow calling it twice. -
exitCodeHandler
Used to manage calls to System.exit().
-
-
Constructor Details
-
AbstractCommandLineCompiler
Constructs anAbstractCommandLineCompiler.- Parameters:
job- the inputs the compiler should process and the options to use
-
-
Method Details
-
exitOnUnhandledException
Prints a message announcing an unhandled exception and exits.
-