Package org.w3c.css.sac

Examples of org.w3c.css.sac.InputSource


    if(cssStream == null) {
      // Shouldn't get this - should be getting an IOException???
      throw new IOException("Failed to read CSS resource: " + cssURI);
    }

    InputSource cssSrc = new InputSource();
   
    cssSrc.setByteStream(cssStream);

    return parse(cssSrc, cssURI, media, styleSheet);
  }
View Full Code Here


    }
    if(baseURI == null) {
      throw new IllegalArgumentException("null 'baseURI' arg in method call.");
    }
   
    InputSource cssSrc = new InputSource();
   
    cssSrc.setByteStream(new ByteArrayInputStream(cssString.getBytes()));

    return parse(cssSrc, baseURI, media, null);
  }
View Full Code Here

    StyleSheet ss = null;
    CSSEngine engine = ((SVGOMDocument) doc).getCSSEngine();
    try {
      if (inlineCss != null) {
        InputSource source = new InputSource(new StringReader(inlineCss));
        ss = engine.parseStyleSheet(source, new URL("http://www.timepedia.org"),
            "screen");
        engine.setUserAgentStyleSheet(ss);
      } else if (altCss != null) {
        ss = engine.parseStyleSheet(new InputSource(altCss),
            new URL("http://www.timepedia.org"), "screen");
        engine.setUserAgentStyleSheet(ss);
      } else {
        InputStream asStream = getClass().getClassLoader().getResourceAsStream(
            "org/timepedia/chronoscope/public/Chronoscope.css");
        InputSource source = new InputSource(new InputStreamReader(asStream));
        ss = engine.parseStyleSheet(source, new URL("http://www.timepedia.org"),
            "screen");
        engine.setUserAgentStyleSheet(ss);
      }
    } catch (MalformedURLException e) {
View Full Code Here

    /**
     * <b>SAC</b>: Implements {@link
     * org.w3c.css.sac.Parser#parseStyleSheet(String)}.
     */
    public void parseStyleSheet(String uri) throws CSSException, IOException {
        parseStyleSheet(new InputSource(uri));
    }
View Full Code Here

     *            supplied by the application.
     */
    public void parseStyleDeclaration(String source)
  throws CSSException, IOException {
  parser.parseStyleDeclaration
      (new InputSource(new StringReader(source)));
    }
View Full Code Here

     * @exception java.io.IOException An IO exception from the parser,
     *            possibly from a byte stream or character stream
     *            supplied by the application.
     */
    public void parseRule(String source) throws CSSException, IOException {
  parser.parseRule(new InputSource(new StringReader(source)));
    }
View Full Code Here

     *            supplied by the application.
     */   
    public SelectorList parseSelectors(String source)
        throws CSSException, IOException {
  return parser.parseSelectors
      (new InputSource(new StringReader(source)));
    }
View Full Code Here

     *            supplied by the application.
     */   
    public LexicalUnit parsePropertyValue(String source)
        throws CSSException, IOException {
  return parser.parsePropertyValue
      (new InputSource(new StringReader(source)));
    }
View Full Code Here

     *            possibly from a byte stream or character stream
     *            supplied by the application.
     */   
    public boolean parsePriority(String source)
        throws CSSException, IOException {
  return parser.parsePriority(new InputSource(new StringReader(source)));
    }
View Full Code Here

             }
             ParsedURL pURL = null;
                 pURL = new ParsedURL(uri);
             cssContext.checkLoadExternalResource(pURL, pDocURL);
            
             parseStyleSheet(ss, new InputSource(uri.toString()), uri);
  } catch (SecurityException e) {
            throw e;
        } catch (Exception e) {
            String m = e.getMessage();
            String s =
View Full Code Here

TOP

Related Classes of org.w3c.css.sac.InputSource

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.