当前位置: 首页>>代码示例>>Java>>正文


Java Attributes2类代码示例

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


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

示例1: fillXMLAttributes2

import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
/** Fills in the XMLAttributes object. */
private void fillXMLAttributes2(Attributes2 att) {
    fAttributes.removeAllAttributes();
    final int len = att.getLength();
    for (int i = 0; i < len; ++i) {
        fillXMLAttribute(att, i);
        fAttributes.setSpecified(i, att.isSpecified(i));
        if (att.isDeclared(i)) {
            fAttributes.getAugmentations(i).putItem(Constants.ATTRIBUTE_DECLARED, Boolean.TRUE);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:ValidatorHandlerImpl.java

示例2: startElement

import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
public void startElement (
    String uri,
    String localName,
    String qName,
    Attributes atts
) throws SAXException
{
    Node                top;

    super.startElement (uri, localName, qName, atts);

    // might there be more work?
    top = getTop ();
    if (!top.hasAttributes () || !(atts instanceof Attributes2))
        return;

    // remember any attributes that got defaulted
    DomNamedNodeMap     map = (DomNamedNodeMap) top.getAttributes ();
    Attributes2         attrs = (Attributes2) atts;
    int                 length = atts.getLength ();

    //map.compact ();
    for (int i = 0; i < length; i++) {
        if (attrs.isSpecified (i))
            continue;

        // value was defaulted.
        String          temp = attrs.getQName (i);
        DomAttr         attr;

        if ("".equals (temp))
            attr = (DomAttr) map.getNamedItemNS (attrs.getURI (i),
                    atts.getLocalName (i));
        else
            attr = (DomAttr) map.getNamedItem (temp);

        // DOM L2 can't write this flag, only read it
        attr.setSpecified (false);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:41,代码来源:Consumer.java

示例3: startElement

import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
public void startElement (
    String uri,
    String localName,
    String qName,
    Attributes atts
) throws SAXException
{
    Node		top;

    super.startElement (uri, localName, qName, atts);

    // might there be more work?
    top = getTop ();
    if (!top.hasAttributes () || !(atts instanceof Attributes2))
	return;

    // remember any attributes that got defaulted
    DomNamedNodeMap	map = (DomNamedNodeMap) top.getAttributes ();
    Attributes2		attrs = (Attributes2) atts;
    int			length = atts.getLength ();

    //map.compact ();
    for (int i = 0; i < length; i++) {
	if (attrs.isSpecified (i))
	    continue;

	// value was defaulted.
	String		temp = attrs.getQName (i);
	DomAttr		attr;

	if ("".equals (temp))
	    attr = (DomAttr) map.getNamedItemNS (attrs.getURI (i),
		    atts.getLocalName (i));
	else
	    attr = (DomAttr) map.getNamedItem (temp);

	// DOM L2 can't write this flag, only read it
	attr.setSpecified (false);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:41,代码来源:Consumer.java

示例4: replace

import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
private Attributes replace(Attributes attrs){
    if(attrs instanceof Attributes2){
        attribute2Replacer.setDelegate((Attributes2)attrs);
        return attribute2Replacer;
    }else{
        attributeReplacer.setDelegate(attrs);
        return attributeReplacer;
    }
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:10,代码来源:NamespaceReplacer.java

示例5: setDelegate

import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
public void setDelegate(Attributes2 delegate){
    super.setDelegate(delegate);
    this.delegate = delegate;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:5,代码来源:NamespaceReplacer.java


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