Package org.w3c.css.sac

Examples of org.w3c.css.sac.InputSource


    }

    void parseDef(String atRule) {
      String value = atRule.substring(4, atRule.length()).trim();

      InputSource s = new InputSource();
      s.setCharacterStream(new StringReader(value));
      Parser parser = new Parser();
      parser.setErrorHandler(errors);

      final List<Value> values = new ArrayList<Value>();
      parser.setDocumentHandler(new PropertyExtractor(values));

      try {
        String dummy = "* { prop : " + value + "}";
        parser.parseStyleSheet(new InputSource(new StringReader(dummy)));
      } catch (IOException e) {
        assert false : "Should never happen";
      }

      if (values.size() < 2) {
View Full Code Here


      // Flag to tell startSelector() to use the CssSprite instead of creating
      // its own CssRule.
      nextSelectorCreatesRule = false;

      // parse the inner text
      InputSource s = new InputSource();
      s.setCharacterStream(new StringReader(atRule.substring(7)));
      Parser parser = new Parser();
      parser.setDocumentHandler(this);
      parser.setErrorHandler(errors);

      try {
View Full Code Here

    private <T extends CssNode & HasNodes> void parseInnerStylesheet(
        String tagName, T parent, String blockContents) {
      pushParent(parent);

      // parse the inner text
      InputSource s = new InputSource();
      s.setCharacterStream(new StringReader(blockContents));
      Parser parser = new Parser();
      parser.setDocumentHandler(this);
      parser.setErrorHandler(errors);

      try {
View Full Code Here

    public void setCssText(String cssText) throws DOMException {
  try {
      parser.setSelectorFactory(SELECTOR_FACTORY);
      parser.setConditionFactory(CONDITION_FACTORY);
      parser.setDocumentHandler(ruleHandler);
      parser.parseRule(new InputSource(new StringReader(cssText)));
  } catch (DOMException e) {
      throw e;
  } catch (Exception e) {
      throw CSSDOMExceptionFactory.createDOMException
    (DOMException.SYNTAX_ERR,
View Full Code Here

     * <b>DOM</b>: Implements
     * {@link org.w3c.dom.css.CSSStyleRule#setSelectorText(String)}.
     */
    public void setSelectorText(String selectorText) throws DOMException {
  try {
      InputSource is = new InputSource(new StringReader(selectorText));
      parser.setSelectorFactory(SELECTOR_FACTORY);
      parser.setConditionFactory(CONDITION_FACTORY);
      SelectorList sl = selectors;
      selectors = parser.parseSelectors(is);
      if (styleRuleChangeSupport != null) {
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

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.