public final class Entity extends Object implements DTDConstants
DTD 
       | Modifier and Type | Field and Description | 
|---|---|
| char[] | data | 
| String | name | 
| int | type | 
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 | Method and Description | 
|---|---|
| char[] | getData()
              返回 
              data。 | 
| String | getName()
              获取实体的名称。 
             | 
| String | getString()
              返回数据为 
              String。 | 
| int | getType()
              获取实体的类型。 
             | 
| boolean | isGeneral()
              如果是一般实体,则返回 
              true。 | 
| boolean | isParameter()
              如果是参数实体,则返回 
              true。 | 
| static int | name2type(String nm)
              将 
              nm字符串转换为相应的实体类型。 | 
public String name
public int type
public char[] data
public Entity(String name, int type, char[] data)
name - 实体的名称 
           type - 实体的类型 
           data - 数据的char数组 
           public String getName()
String 
           public int getType()
public boolean isParameter()
true 。 
          true如果它是一个参数实体 
           public boolean isGeneral()
true 。 
          true如果是一般实体 
           public char[] getData()
data 。 
          data 
           public String getString()
String 。 
          String 
           public static int name2type(String nm)
nm字符串转换为相应的实体类型。 
           如果字符串没有相应的实体类型,则返回与“CDATA”对应的类型。 
           有效的实体类型有:“PUBLIC”,“CDATA”,“SDATA”,“PI”,“STARTTAG”,“ENDTAG”,“MS”,“MD”,“SYSTEM” 
          nm - 要转换的字符串 
            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.