本文整理汇总了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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例5: setDelegate
import org.xml.sax.ext.Attributes2; //导入依赖的package包/类
public void setDelegate(Attributes2 delegate){
super.setDelegate(delegate);
this.delegate = delegate;
}