- java.lang.Object
 -  
      
- javax.swing.text.html.parser.Element
 
 
-  
       
- All Implemented Interfaces:
 -  
         
Serializable,DTDConstants 
public final class Element extends Object implements DTDConstants, Serializable
使用ELEMENT构造在DTD中描述的元素。 这对标签的描述至关重要。 它描述了类型,内容模型,属性,属性类型等。它用于解析器正确解析文档。- 另请参见:
 -  
         
DTD,AttributeList, Serialized Form 
 
-  
        
       
-  
             
Field Summary
Fields Modifier and Type Field 描述 AttributeListatts属性ContentModelcontent内容模型Objectdata用于存储用户数据的字段。BitSetexclusions元素中不能出现的元素集BitSetinclusions可以在元素内发生的一组元素intindex元素索引Stringname元素的名称booleanoEndtrue如果可以省略结束标签booleanoStarttrue如果开始标签可以省略inttype元素类型-  
               
Fields inherited from interface 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 
 -  
               
 
-  
             
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 AttributeListgetAttribute(String name)通过名称获取属性。AttributeListgetAttributeByValue(String value)通过值获取属性。AttributeListgetAttributes()获取属性。ContentModelgetContent()获取内容模型intgetIndex()获取索引。StringgetName()获取元素的名称。intgetType()获取类型。booleanisEmpty()检查是否空static intname2type(String nm)转换nm键入。booleanomitEnd()如果结束标签可以省略,返回true。booleanomitStart()如果可以省略起始标签,则返回true。StringtoString()转换成字符串。 
 -  
             
 
-  
        
       
-  
             
字段详细信息
-  
index
public int index
元素索引 
-  
name
public String name
元素的名称 
-  
oStart
public boolean oStart
true如果可以省略起始标签 
-  
oEnd
public boolean oEnd
true如果可以省略结束标签 
-  
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。- 结果
 -  
              
true如果可以省略起始标签 
 
-  
omitEnd
public boolean omitEnd()
如果结束标签可以省略,返回true。- 结果
 -  
              
true如果可以省略结束标签 
 
-  
getType
public int getType()
获取类型。- 结果
 - 元素的类型
 
 
-  
getContent
public ContentModel getContent()
获取内容模型- 结果
 - 内容模型
 
 
-  
getAttributes
public AttributeList getAttributes()
获取属性。- 结果
 - 
               指定元素的 
              
AttributeList 
 
-  
getIndex
public int getIndex()
获取索引。- 结果
 - 元素索引
 
 
-  
isEmpty
public boolean isEmpty()
检查是否空- 结果
 - 如果当前元素为空,则为true
 
 
-  
getAttribute
public AttributeList getAttribute(String name)
通过名称获取属性。- 参数
 -  
              
name- 属性名称 - 结果
 -  
              
AttributeList为给定的name 
 
-  
getAttributeByValue
public AttributeList getAttributeByValue(String value)
通过值获取属性。- 参数
 -  
              
value- 值的字符串表示形式 - 结果
 -  
              
AttributeList为给定的value 
 
-  
name2type
public static int name2type(String nm)
将nm转换为类型。 如果nm等于CDATA,RCDATA,EMPTY或ANY,则返回适当的DTDConstants,否则返回0。- 参数
 -  
              
nm- 一个名字 - 结果
 - 
               适当的DTDConstants如果 
              
nm等于CDATA,RCDATA,EMPTY或任何,否则为0。 
 
 -  
 
 -