Examples of CssSource


Examples of org.idpf.epubcheck.util.css.CssSource

        }

        try
        {
          InputStream inputStream = getInputStream(fileToParse);
          CssSource source = new CssSource(fileToParse, inputStream);
          CssParser parser = new CssParser();
          handler.setPath(fileToParse);

          parser.parse(source, handler, handler);
        }
View Full Code Here

Examples of org.idpf.epubcheck.util.css.CssSource

    EpubCSSCheckCSSHandler handler = new EpubCSSCheckCSSHandler(report, currentStyleTag.getLine(), currentStyleTag.getColumn(), isGlobalFixedFormat, documentIsFixedFormat);
    try
    {
      String s = currentStyleTag.getValue();
      InputStream inputStream = new ByteArrayInputStream(s.getBytes("UTF-8"));
      CssSource source = new CssSource(this.getFileName(), inputStream);
      CssParser parser = new CssParser();
      handler.setPath(this.getFileName());

      HashMap<String, EpubCSSCheckCSSHandler.ClassUsage> localStyleMap = localStyles.peek();
      parser.parse(source, handler, handler);
View Full Code Here

Examples of org.idpf.epubcheck.util.css.CssSource

    this.mode = Mode.STRING;
  }

  public void runChecks()
  {
    CssSource source = null;

    try
    {
      if (this.mode == Mode.FILE && !ocf.hasEntry(path))
      {
        report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
        return;
      }

      CSSHandler handler = new CSSHandler(path, xrefChecker, report, version);
      if (this.mode == Mode.STRING && this.line > -1)
      {
        handler.setStartingLineNumber(this.line);
      }

      source = getCssSource();
      parseItem(source, handler);
      handler.setStartingLineNumber(-1);
      this.line = -1;
    }
    catch (Exception e)
    {
      report.message(MessageId.PKG_008, new MessageLocation(path, -1, -1), e.getMessage());
    }
    finally
    {
      if (source != null)
      {
        try
        {
          InputStream iStream = source.getInputStream();
          if (iStream != null)
          {
            iStream.close();
          }
        }
View Full Code Here

Examples of org.idpf.epubcheck.util.css.CssSource

  }

  CssSource getCssSource() throws
      IOException
  {
    CssSource source = null;
    if (this.mode == Mode.FILE)
    {
      source = new CssSource(this.path, ocf.getInputStream(this.path));
      String charset;
      if (source.getInputStream().getBomCharset().isPresent())
      {
        charset = source.getInputStream().getBomCharset().get().toLowerCase();
        if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
        {
          report.message(MessageId.CSS_004, new MessageLocation(path, -1, -1, ""), charset);
        }
      }
      if (source.getInputStream().getCssCharset().isPresent())
      {
        charset = source.getInputStream().getCssCharset().get().toLowerCase();
        if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
        {
          report.message(MessageId.CSS_003, new MessageLocation(path, 0, 0, ""), charset);
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.