AttributeList
;接口已被Attributes
,这是在AttributesImpl
辅助类实现。
public class AttributeListImpl extends Object implements AttributeList
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
实现了不AttributeList
AttributeList SAX1接口,已被新的取代AttributesImpl
SAX2接口。
这个类提供了一个萨克斯AttributeList
接口方便的实现。这个实现是对SAX解析器作家有用,他们可以用它来提供属性的应用,并对SAX应用程序的作家,谁可以使用它来创建一个元素的属性规范的持久性拷贝:
私人AttributeList myatts;public void startElement(String name,AttributeList ATTS){创建一个属性列表的持久副本用于此方法的外部使用myatts =新attributelistimpl(瓦);[…]}
请注意,SAX解析器不需要使用这个类来提供一个实现是AttributeList;只提供作为一个可选的便利。特别是,解析器的作者,鼓励发明更有效的实现。
AttributeList
,
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
Constructor and Description |
---|
AttributeListImpl()
过时的。
创建一个空属性列表。
|
AttributeListImpl(AttributeList atts)
过时的。
构造一个现有属性列表的持久副本。
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name, String type, String value)
过时的。
向属性列表中添加一个属性。
|
void |
clear()
过时的。
清除属性列表。
|
int |
getLength()
过时的。
返回列表中的属性的数目。
|
String |
getName(int i)
过时的。
获取属性的名称(按位置)。
|
String |
getType(int i)
过时的。
获取属性的类型(按位置)。
|
String |
getType(String name)
过时的。
获取属性的类型(按名称)。
|
String |
getValue(int i)
过时的。
获取属性的值(按位置)。
|
String |
getValue(String name)
过时的。
获取属性的值(按名称)。
|
void |
removeAttribute(String name)
过时的。
从列表中删除一个属性。
|
void |
setAttributeList(AttributeList atts)
过时的。
设置属性列表,丢弃以前的内容。
|
public AttributeListImpl()
此构造函数是最有用的解析器的作者,谁将使用它来创建一个单一的,可重复使用的属性列表,可以重置元素之间的清除方法。
public AttributeListImpl(AttributeList atts)
此构造函数是最有用的应用程序的编写者,谁将使用它来创建一个现有的属性列表的持久性副本。
atts
-属性列表复制
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void setAttributeList(AttributeList atts)
此方法允许应用程序编写者可以轻松地重用属性列表。
atts
-属性列表复制。
public void addAttribute(String name, String type, String value)
这种方法提供了SAX解析器的作家,让他们建立一个属性列表增量前提供给应用程序。
name
-属性名称。
type
的属性类型(“象征”枚举)。
value
-属性值(不能为空)。
removeAttribute(java.lang.String)
,
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void removeAttribute(String name)
SAX应用程序的作家可以用这种方法来过滤属性的AttributeList。请注意,调用此方法将更改属性列表的长度和一些属性的索引。
如果请求的属性不在列表中,这是一个空操作。
name
-属性名称。
addAttribute(java.lang.String, java.lang.String, java.lang.String)
public void clear()
SAX解析器的作家可以使用此方法复位之间documenthandler.startelement事件的属性列表。通常情况下,它会重复使用相同的attributelistimpl对象而不是分配一个新的一个时间意义。
public int getLength()
getLength
接口
AttributeList
AttributeList.getLength()
public String getName(int i)
getName
接口
AttributeList
i
-列表中的属性的位置。
AttributeList.getName(int)
public String getType(int i)
getType
接口
AttributeList
i
-列表中的属性的位置。
AttributeList.getType(int)
public String getValue(int i)
getValue
接口
AttributeList
i
-列表中的属性的位置。
AttributeList.getValue(int)
public String getType(String name)
getType
接口
AttributeList
name
-属性名称。
AttributeList.getType(java.lang.String)
public String getValue(String name)
getValue
接口
AttributeList
name
-属性名称。
AttributeList.getValue(java.lang.String)
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.