List of usage examples for com.google.common.css.compiler.passes CompactPrinter CompactPrinter
public CompactPrinter(CssTree tree)
From source file:com.log4ic.compressor.utils.Compressor.java
/** * css/* w ww . j a v a 2s . co m*/ * * @param job * @return * @throws GssParserException */ public static String compressGss(JobDescription job) throws GssParserException { logger.debug("CSS..."); try { GssParser parser = new GssParser(job.inputs); CssTree cssTree = parser.parse(); if (job.outputFormat != JobDescription.OutputFormat.DEBUG) { CompilerErrorManager errorManager = new CompilerErrorManager(); PassRunner passRunner = new ExtendedPassRunner(job, errorManager); passRunner.runPasses(cssTree); } if (job.outputFormat == JobDescription.OutputFormat.COMPRESSED) { CompactPrinter compactPrinterPass = new CompactPrinter(cssTree); compactPrinterPass.runPass(); return compactPrinterPass.getCompactPrintedString(); } else { PrettyPrinter prettyPrinterPass = new PrettyPrinter(cssTree.getVisitController()); prettyPrinterPass.runPass(); return prettyPrinterPass.getPrettyPrintedString(); } } finally { logger.debug("CSS..."); } }