Package com.google.common.css

Examples of com.google.common.css.SourceCode


      String concatenatedCss = concatCssFiles(resources, logger);

      ConversionResult result = convertToGss(concatenatedCss, logger);

      String gss = result.gss;
      sourceCodes.add(new SourceCode("[auto-converted gss files]", gss));

      constantNameMappingBuilder.putAll(result.defNameMapping);
    } else {
      for (URL stylesheet : resources) {
        TreeLogger branchLogger = logger.branch(TreeLogger.DEBUG,
            "Parsing GSS stylesheet " + stylesheet.toExternalForm());
        try {
          // TODO : always use UTF-8 to read the file ?
          String fileContent =
              Resources.asByteSource(stylesheet).asCharSource(Charsets.UTF_8).read();
          sourceCodes.add(new SourceCode(stylesheet.getFile(), fileContent));
          continue;

        } catch (IOException e) {
          branchLogger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
        }
View Full Code Here


    if (lenient) {
      // lenient mode: Try to parse the css rule and if an error occurs,
      // print a warning message and don't print the rule.
      try {
        new GssParser(new SourceCode(null, "body{" + cssProperty + "}")).parse();
      } catch (GssParserException e) {
        treeLogger.log(Type.WARN, "The following property is not valid and will be skipped: " +
            cssProperty);
        return false;
      }
View Full Code Here

TOP

Related Classes of com.google.common.css.SourceCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.