public class DTD extends Object implements DTDConstants
Element
,
AttributeList
,
ContentModel
,
Parser
Modifier and Type | Field and Description |
---|---|
Element |
applet |
Element |
base |
Element |
body |
Hashtable<String,Element> |
elementHash |
Vector<Element> |
elements |
Hashtable<Object,Entity> |
entityHash |
static int |
FILE_VERSION |
Element |
head |
Element |
html |
Element |
isindex |
Element |
meta |
String |
name |
Element |
p |
Element |
param |
Element |
pcdata |
Element |
title |
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 |
---|---|
protected AttributeList |
defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts)
创建并返回一个
AttributeList 。
|
protected ContentModel |
defContentModel(int type, Object obj, ContentModel next)
创建并返回一个新的内容模型。
|
protected Element |
defElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, String[] exclusions, String[] inclusions, AttributeList atts)
创建并返回一个
Element 。
|
Entity |
defEntity(String name, int type, int ch)
创建并返回一个字符
Entity 。
|
protected Entity |
defEntity(String name, int type, String str)
创建并返回一个
Entity 。
|
void |
defineAttributes(String name, AttributeList atts)
定义了一个
Element 属性。
|
Element |
defineElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, BitSet exclusions, BitSet inclusions, AttributeList atts)
返回与指定的参数
Element 。
|
Entity |
defineEntity(String name, int type, char[] data)
定义一个实体。
|
static DTD |
getDTD(String name)
返回与指定的
name DTD。
|
Element |
getElement(int index)
通过索引获取元素。
|
Element |
getElement(String name)
获取一个元素的名称。
|
Entity |
getEntity(int ch)
获取一个字符实体。
|
Entity |
getEntity(String name)
获取一个实体的名称。
|
String |
getName()
获取该DTD名称。
|
static void |
putDTDHash(String name, DTD dtd) |
void |
read(DataInputStream in)
再现从存档格式DTD。
|
String |
toString()
返回该DTD的字符串表示。
|
public String name
public final Element pcdata
public final Element html
public final Element meta
public final Element base
public final Element isindex
public final Element head
public final Element body
public final Element applet
public final Element param
public final Element p
public final Element title
public static final int FILE_VERSION
protected DTD(String name)
name
的名字,作为一种新的DTD
String
public String getName()
public Entity getEntity(int ch)
ch
性格
Entity
public Element getElement(String name)
name
-要求的
String
Element
name
,这可能是新创建的
public Element getElement(int index)
index
-请求的索引
Element
index
public Entity defineEntity(String name, int type, char[] data)
name
,
type
指定的
Entity
,和
data
存在,它被返回;否则创建一个新的
Entity
并返回。
name
的
Entity
的名称作为
String
type
的
Entity
类型
data
-
Entity
数据
Entity
请求或一个新的
Entity
如果没有找到
public Element defineElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, BitSet exclusions, BitSet inclusions, AttributeList atts)
Element
。如果一个不存在,一个新的创建和返回。
name
的
Element
名称
type
的
Element
类型
omitStart
-
true
如果开始应略
omitEnd
-
true
如果端应略
content
-
ContentModel
atts
-
AttributeList
指定
Element
Element
public void defineAttributes(String name, AttributeList atts)
Element
属性。
name
的
Element
名称
atts
-
AttributeList
指定
Element
public Entity defEntity(String name, int type, int ch)
Entity
。
name
-单位名称
Entity
protected Entity defEntity(String name, int type, String str)
Entity
。
name
-单位名称
Entity
protected Element defElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, String[] exclusions, String[] inclusions, AttributeList atts)
Element
。
name
-元素的名称
Element
protected AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts)
AttributeList
。
name
-属性列表的名字
AttributeList
protected ContentModel defContentModel(int type, Object obj, ContentModel next)
type
--新内容模型类型
ContentModel
public static DTD getDTD(String name) throws IOException
name
DTD。如果DTD与该名称不存在,一个是创建并返回。在名称的任何大写字符都转换为小写。
name
的DTD名称
name
DTD
IOException
public void read(DataInputStream in) throws IOException
in
-
DataInputStream
读
IOException
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.