JavaTM 2 Platform
Standard Ed. 6

javax.swing.text.html.parser
类 Element

java.lang.Object
  继承者 javax.swing.text.html.parser.Element
所有已实现的接口:
Serializable, DTDConstants

public final class Element
extends Object
implements DTDConstants, Serializable

使用 ELEMENT 构造在 DTD 中描述的一个元素。这实质上是对标记的描述。它描述了类型、内容模式、属性和属性类型等。它用于由 Parser 正确解析一个文档。

另请参见:
DTD, AttributeList

字段摘要
 AttributeList atts
           
 ContentModel content
           
 Object data
          存储用户数据的字段。
 BitSet exclusions
           
 BitSet inclusions
           
 int index
           
 String name
           
 boolean oEnd
           
 boolean oStart
           
 int type
           
 
从接口 javax.swing.text.html.parser.DTDConstants 继承的字段
ANY, CDATA, CONREF, CURRENT, DEFAULT, EMPTY, ENDTAG, ENTITIES, ENTITY, FIXED, GENERAL, ID, IDREF, IDREFS, IMPLIED, MD, MODEL, MS, NAME, NAMES, NMTOKEN, NMTOKENS, NOTATION, NUMBER, NUMBERS, NUTOKEN, NUTOKENS, PARAMETER, PI, PUBLIC, RCDATA, REQUIRED, SDATA, STARTTAG, SYSTEM
 
方法摘要
 AttributeList getAttribute(String name)
          按名称获取一个元素。
 AttributeList getAttributeByValue(String name)
          按值获取一个属性。
 AttributeList getAttributes()
          获取属性。
 ContentModel getContent()
          获取内容模式
 int getIndex()
          获取索引。
 String getName()
          获取元素的名称。
 int getType()
          获取类型。
 boolean isEmpty()
          检查是否为空
static int name2type(String nm)
           
 boolean omitEnd()
          如果可以忽略结束标记,则返回 true。
 boolean omitStart()
          如果可以忽略开始标记,则返回 true。
 String toString()
          转换为字符串。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

index

public int index

name

public String name

oStart

public boolean oStart

oEnd

public boolean oEnd

inclusions

public BitSet inclusions

exclusions

public BitSet exclusions

type

public int type

content

public ContentModel content

atts

public AttributeList atts

data

public Object data
存储用户数据的字段。通常用于存储样式表。

方法详细信息

getName

public String getName()
获取元素的名称。


omitStart

public boolean omitStart()
如果可以忽略开始标记,则返回 true。


omitEnd

public boolean omitEnd()
如果可以忽略结束标记,则返回 true。


getType

public int getType()
获取类型。


getContent

public ContentModel getContent()
获取内容模式


getAttributes

public AttributeList getAttributes()
获取属性。


getIndex

public int getIndex()
获取索引。


isEmpty

public boolean isEmpty()
检查是否为空


toString

public String toString()
转换为字符串。

覆盖:
Object 中的 toString
返回:
该对象的字符串表示形式。

getAttribute

public AttributeList getAttribute(String name)
按名称获取一个元素。


getAttributeByValue

public AttributeList getAttributeByValue(String name)
按值获取一个属性。


name2type

public static int name2type(String nm)

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策