public class Attributes2Impl extends AttributesImpl implements Attributes2
Attributes2
接口。
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
这是不是一部分核心SAX2分布。
对于每个属性指定的标志将永远是真实的,除非它被设置为false,在复制构造函数或使用setSpecified(int, boolean)
。同样,每个属性声明的旗帜永远是虚假的,除了默认的属性(指定是假的),非CDATA属性,或当它被设置为true以setDeclared(int, boolean)
。如果您手动更改属性的类型,您可能需要修改其已声明的标志匹配。
Constructor and Description |
---|
Attributes2Impl()
构建一个新的、空的attributes2impl对象。
|
Attributes2Impl(Attributes atts)
复制现有的属性或attributes2对象。
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String uri, String localName, String qName, String type, String value)
将属性添加到列表的末端,将其“指定”标志设置为真。
|
boolean |
isDeclared(int index)
返回属性的“声明”标志的当前值。
|
boolean |
isDeclared(String qName)
返回属性的“声明”标志的当前值。
|
boolean |
isDeclared(String uri, String localName)
返回属性的“声明”标志的当前值。
|
boolean |
isSpecified(int index)
返回属性的“指定”标志的当前值。
|
boolean |
isSpecified(String qName)
返回属性的“指定”标志的当前值。
|
boolean |
isSpecified(String uri, String localName)
返回属性的“指定”标志的当前值。
|
void |
removeAttribute(int index)
从列表中删除一个属性。
|
void |
setAttributes(Attributes atts)
复制一个完整的属性对象。
|
void |
setDeclared(int index, boolean value)
将一个值赋给特定属性的“声明”标志。
|
void |
setSpecified(int index, boolean value)
将一个值赋给特定属性的“指定”标志。
|
clear, getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue, setAttribute, setLocalName, setQName, setType, setURI, setValue
public Attributes2Impl()
public Attributes2Impl(Attributes atts)
这个构造函数是特别有用的在startElement
事件。
atts
-现有属性的对象。
public boolean isDeclared(int index)
isDeclared
接口
Attributes2
index
-属性索引(从零开始)。
public boolean isDeclared(String uri, String localName)
isDeclared
接口
Attributes2
uri
的命名空间URI或空字符串,如果名字没有命名空间URI。
localName
-属性的本地名称。
public boolean isDeclared(String qName)
isDeclared
接口
Attributes2
qName
合格的XML(前缀)的名字。
public boolean isSpecified(int index)
isSpecified
接口
Attributes2
index
-属性索引(从零开始)。
ArrayIndexOutOfBoundsException
-当供电指标不确定属性。
public boolean isSpecified(String uri, String localName)
isSpecified
接口
Attributes2
uri
的命名空间URI或空字符串,如果名字没有命名空间URI。
localName
-属性的本地名称。
IllegalArgumentException
时提供的名称不确定属性。
public boolean isSpecified(String qName)
isSpecified
接口
Attributes2
qName
合格的XML(前缀)的名字。
IllegalArgumentException
时提供的名称不能识别属性。
public void setAttributes(Attributes atts)
setAttributes
方法重写,继承类
AttributesImpl
atts
-复制属性。
AttributesImpl.setAttributes(org.xml.sax.Attributes)
public void addAttribute(String uri, String localName, String qName, String type, String value)
setSpecified(int, boolean)
除非属性类型是,这个属性被标记为在DTD中声明。设置该标志的值为true,CDATA属性,使用setDeclared(int, boolean)
。
addAttribute
方法重写,继承类
AttributesImpl
uri
的命名空间URI或空字符串,如果没有可用的或命名空间处理不执行。
localName
的本地名称、命名空间或空字符串,如果不进行处理。
qName
-合格(前缀)的名字,或空字符串,如果名称不可用。
type
的属性类型为字符串。
value
-属性值。
AttributesImpl.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void removeAttribute(int index)
AttributesImpl
removeAttribute
方法重写,继承类
AttributesImpl
index
-属性的索引(从零开始)。
public void setDeclared(int index, boolean value)
index
-属性的索引(从零开始)。
value
-所需的标志值。
ArrayIndexOutOfBoundsException
-当供电指标不确定属性。
AttributesImpl.setType(int, java.lang.String)
public void setSpecified(int index, boolean value)
index
-属性的索引(从零开始)。
value
-所需的标志值。
ArrayIndexOutOfBoundsException
-当供电指标不确定属性。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.