• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CSSException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.w3c.css.sac.CSSException的典型用法代码示例。如果您正苦于以下问题:Java CSSException类的具体用法?Java CSSException怎么用?Java CSSException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CSSException类属于org.w3c.css.sac包,在下文中一共展示了CSSException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: property

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * DocumentHandler#property(String,LexicalUnit,boolean)}.
 */
public void property(String name, LexicalUnit value, boolean important)
    throws CSSException {
    int i = getPropertyIndex(name);
    if (i == -1) {
        i = getShorthandIndex(name);
        if (i == -1) {
            // Unknown property
            return;
        }
        shorthandManagers[i].setValues(CSSEngine.this,
                                       this,
                                       value,
                                       important);
    } else {
        Value v = valueManagers[i].createValue(value, CSSEngine.this);
        styleDeclaration.append(v, i, important);
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:CSSEngine.java


示例2: property

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
@Override
public void property(String name, LexicalUnit value, boolean arg2) throws CSSException {
	if (currentStyle != null) {
		if ("color".equals(name)) {
			currentStyle.setColor(createRGB(value));
		} else if ("background-color".equals(name)) {
			currentStyle.setBackgroundColor(createRGB(value));
		} else if ("font-weight".equals(name)) {
			currentStyle.setBold(value.getStringValue().toUpperCase().contains("BOLD"));
		} else if ("font-style".equals(name)) {
			currentStyle.setItalic(value.getStringValue().toUpperCase().contains("ITALIC"));
		}
		if ("text-decoration".equals(name)) {
			String decoration = value.getStringValue().toUpperCase();
			if (decoration.contains("UNDERLINE")) {
				currentStyle.setUnderline(true);
			}
			if (decoration.contains("LINE-THROUGH")) {
				currentStyle.setStrikeThrough(true);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:24,代码来源:CSSDocumentHandler.java


示例3: endFontFace

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * org.w3c.css.sac.DocumentHandler#endFontFace()}.
 */
public void endFontFace() throws CSSException {
    StyleMap sm = new StyleMap(getNumberOfProperties());
    int len = styleDeclaration.size();
    for (int i=0; i<len; i++) {
        int idx = styleDeclaration.getIndex(i);
        sm.putValue(idx, styleDeclaration.getValue(i));
        sm.putImportant(idx, styleDeclaration.getPriority(i));
        // Not sure on this..
        sm.putOrigin(idx, StyleMap.AUTHOR_ORIGIN);
    }
    styleDeclaration = null;

    int pidx = getPropertyIndex(CSSConstants.CSS_FONT_FAMILY_PROPERTY);
    Value fontFamily = sm.getValue(pidx);
    if (fontFamily == null) return;

    ParsedURL base = getCSSBaseURI();
    fontFaces.add(new FontFaceRule(sm, base));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:CSSEngine.java


示例4: createAttributeCondition

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 *ConditionFactory#createAttributeCondition(String,String,boolean,String)}.
 */    
public AttributeCondition createAttributeCondition(String localName,
                                                   String namespaceURI,
                                                   boolean specified,
                                                   String value)
    throws CSSException {
    return new CSSAttributeCondition(localName, namespaceURI, specified,
                                       value);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:CSSConditionFactory.java


示例5: startSelector

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * org.w3c.css.sac.DocumentHandler#startSelector(SelectorList)}.
 */
public void startSelector(SelectorList selectors) throws CSSException {
    styleRule = new StyleRule();
    styleRule.setSelectorList(selectors);
    styleDeclaration = new StyleDeclaration();
    styleRule.setStyleDeclaration(styleDeclaration);
    styleSheet.append(styleRule);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:CSSEngine.java


示例6: DefaultDirectAdjacentSelector

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * SelectorFactory#createDirectAdjacentSelector(short,Selector,SimpleSelector)}.
 */
public SiblingSelector createDirectAdjacentSelector
    (short          nodeType,
     Selector       child,
     SimpleSelector directAdjacent)
    throws CSSException {
    return new DefaultDirectAdjacentSelector(nodeType, child,
                                             directAdjacent);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:DefaultSelectorFactory.java


示例7:

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * ConditionFactory#createBeginHyphenAttributeCondition(String,String,boolean,String)}.
 */    
public AttributeCondition createBeginHyphenAttributeCondition
    (String localName,
     String namespaceURI,
     boolean specified,
     String value)
    throws CSSException {
    return new CSSBeginHyphenAttributeCondition
        (localName, namespaceURI, specified, value);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:14,代码来源:CSSConditionFactory.java


示例8: CSSParser

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
public CSSParser(InputSource source, Parser parser) throws CSSException, IOException {
	this.handler = new CSSDocumentHandler();
	parser.setDocumentHandler(handler);
	parser.setConditionFactory(CSSConditionFactory.INSTANCE);
	parser.setSelectorFactory(CSSSelectorFactory.INSTANCE);
	parser.parseStyleSheet(source);
}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:8,代码来源:CSSParser.java


示例9: DefaultDescendantSelector

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}.
 */
public DescendantSelector createDescendantSelector
    (Selector parent,
     SimpleSelector descendant)
    throws CSSException {
    return new DefaultDescendantSelector(parent, descendant);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:DefaultSelectorFactory.java


示例10: testParser

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
@Test
public void testParser() throws CSSException, URISyntaxException,
        IOException {
    Parser parser = new Parser();
    SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl();
    parser.setDocumentHandler(handler);
    parser.parseStyleSheet(getClass().getResource(scss).getPath());
    ScssStylesheet root = handler.getStyleSheet();

    Assert.assertTrue(root.getChildren().get(2).getChildren().get(0) instanceof ExtendNode);
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:12,代码来源:Extends.java


示例11: DefaultConditionalSelector

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * SelectorFactory#createConditionalSelector(SimpleSelector,Condition)}.
 */
public ConditionalSelector createConditionalSelector
    (SimpleSelector selector,
     Condition condition)
    throws CSSException {
    return new DefaultConditionalSelector(selector, condition);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:DefaultSelectorFactory.java


示例12: fatalError

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
@Override
public void fatalError(CSSParseException e) throws CSSException {
    log("FATAL Error when parsing file \n" + e.getURI() + " on line "
            + e.getLineNumber() + ", column " + e.getColumnNumber());
    log(e);
    errorsDetected = true;
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:8,代码来源:SCSSErrorHandler.java


示例13: testParser

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
public ScssStylesheet testParser(String file) throws CSSException,
        IOException, URISyntaxException {
    originalScss = getFileContent(file);
    originalScss = originalScss.replaceAll(CR, "");
    ScssStylesheet sheet = getStyleSheet(file);
    parsedScss = sheet.printState();
    parsedScss = parsedScss.replace(CR, "");
    Assert.assertEquals("Original CSS and parsed CSS do not match",
            originalScss, parsedScss);
    return sheet;
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:12,代码来源:AbstractTestBase.java


示例14: parseMedia

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * Implements {@link ExtendedParser#parseMedia(String)}.
 */
public SACMediaList parseMedia(String mediaText)
    throws CSSException, IOException {
    CSSSACMediaList result = new CSSSACMediaList();
    if (!"all".equalsIgnoreCase(mediaText)) {
        StringTokenizer st = new StringTokenizer(mediaText, " ,");
        while (st.hasMoreTokens()) {
            result.append(st.nextToken());
        }
    }
    return result;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:15,代码来源:ExtendedParserWrapper.java


示例15: error

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
@Override
public void error(CSSParseException e) throws CSSException {
    log("Error when parsing file \n" + e.getURI() + " on line "
            + e.getLineNumber() + ", column " + e.getColumnNumber());
    log(e);
    errorsDetected = true;
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:8,代码来源:SCSSErrorHandler.java


示例16: createPositionalCondition

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * ConditionFactory#createPositionalCondition(int,boolean,boolean)}.
 */
public PositionalCondition createPositionalCondition(int position,
                                                     boolean typeNode,
                                                     boolean type)
    throws CSSException {
    throw new CSSException("Not implemented in CSS2");
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:DefaultConditionFactory.java


示例17: parseRuleInternal

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * Parses a rule using the current scanner.
 */
protected void parseRuleInternal() throws CSSException, IOException {
    nextIgnoreSpaces();
    parseRule();
    scanner.close();
    scanner = null;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:10,代码来源:Parser.java


示例18: parseSelectorsInternal

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * Parses selectors using the current scanner.
 */
protected SelectorList parseSelectorsInternal()
    throws CSSException, IOException {
    nextIgnoreSpaces();
    SelectorList ret = parseSelectorList();
    scanner.close();
    scanner = null;
    return ret;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:Parser.java


示例19: parsePropertyValueInternal

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
 * Parses property value using the current scanner.
 */
protected LexicalUnit parsePropertyValueInternal()
    throws CSSException, IOException {
    nextIgnoreSpaces();

    LexicalUnit exp = null;

    try {
        exp = parseExpression(false);
    } catch (CSSParseException e) {
        reportError(e);
        throw e;
    }

    CSSParseException exception = null;
    if (current != LexicalUnits.EOF)
        exception = createCSSParseException("eof.expected");

    scanner.close();
    scanner = null;

    if (exception != null) {
        errorHandler.fatalError(exception);
    }
    return exp;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:29,代码来源:Parser.java


示例20: createOneOfAttributeCondition

import org.w3c.css.sac.CSSException; //导入依赖的package包/类
/**
    * <b>SAC</b>: Implements {@link
ConditionFactory#createOneOfAttributeCondition(String,String,boolean,String)}.
    */
   public AttributeCondition createOneOfAttributeCondition(String localName,
                                                           String nsURI,
                                                           boolean specified,
                                                           String value)
       throws CSSException {
       return new DefaultOneOfAttributeCondition(localName, nsURI, specified,
                                               value);
   }
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:DefaultConditionFactory.java



注:本文中的org.w3c.css.sac.CSSException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Functions类代码示例发布时间:2022-05-22
下一篇:
Java ServerTransaction类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap