JavaTM Platform
Standard Ed. 6

javax.swing.text.html.parser
クラス DTD

java.lang.Object
  上位を拡張 javax.swing.text.html.parser.DTD
すべての実装されたインタフェース:
DTDConstants

public class DTD
extends Object
implements DTDConstants

SGML DTD の表現です。DTD はドキュメントの構文を記述したものであり、HTML ドキュメントの解析に使用されます。この内部には、要素とその属性のリスト、および DTD で定義されたエンティティーのリストが格納されます。

関連項目:
Element, AttributeList, ContentModel, Parser

フィールドの概要
 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
           
 
インタフェース 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
 
コンストラクタの概要
protected DTD(String name)
          指定された名前を持つ新しい DTD を作成します。
 
メソッドの概要
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 の文字列表現を返します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

name

public String name

elements

public Vector<Element> elements

elementHash

public Hashtable<String,Element> elementHash

entityHash

public Hashtable<Object,Entity> entityHash

pcdata

public final Element pcdata

html

public final Element html

meta

public final Element meta

base

public final Element base

isindex

public final Element isindex

head

public final Element head

body

public final Element body

applet

public final Element applet

param

public final Element param

p

public final Element p

title

public final Element title

FILE_VERSION

public static final int FILE_VERSION
関連項目:
定数フィールド値
コンストラクタの詳細

DTD

protected DTD(String name)
指定された名前を持つ新しい DTD を作成します。

パラメータ:
name - 名前 (新しい DTD の String)
メソッドの詳細

getName

public String getName()
DTD の名前を取得します。

戻り値:
DTD の名前

getEntity

public Entity getEntity(String name)
エンティティーを名前で取得します。

戻り値:
name String に対応する Entity

getEntity

public Entity getEntity(int ch)
文字エンティティーを取得します。

戻り値:
ch 文字に対応する Entity

getElement

public Element getElement(String name)
要素を名前で取得します。指定された要素が存在しない場合は、新しく要素が作成されます。

パラメータ:
name - 要求された String
戻り値:
name に対応する Element。 新しく作成されることもある

getElement

public Element getElement(int index)
要素をインデックスで返します。

パラメータ:
index - 要求するインデックス
戻り値:
index に対応する Element

defineEntity

public Entity defineEntity(String name,
                           int type,
                           char[] data)
エンティティーを定義します。name、type、および data で指定される Entity が存在する場合は、そのエンティティーが返されます。 そうでない場合は、新しい Entity が作成され、返されます。

パラメータ:
name - Entity の名前 (String)
type - Entity のタイプ
data - Entity のデータ
戻り値:
要求された Entity。 見つからない場合は、新しい Entity

defineElement

public Element defineElement(String name,
                             int type,
                             boolean omitStart,
                             boolean omitEnd,
                             ContentModel content,
                             BitSet exclusions,
                             BitSet inclusions,
                             AttributeList atts)
指定したパラメータに一致する Element を返します。存在しない場合は、新しい Element が作成され、返されます。

パラメータ:
name - Element の名前
type - Element のタイプ
omitStart - 開始を省略する場合は true
omitEnd - 終了を省略する場合は true
content - ContentModel
atts - Element を指定する AttributeList
戻り値:
指定された Element

defineAttributes

public void defineAttributes(String name,
                             AttributeList atts)
Element の属性を定義します。

パラメータ:
name - Element の名前
atts - Element を指定する AttributeList

defEntity

public Entity defEntity(String name,
                        int type,
                        int ch)
文字 Entity を作成し、返します。

パラメータ:
name - エンティティーの名前
戻り値:
新しい文字 Entity

defEntity

protected Entity defEntity(String name,
                           int type,
                           String str)
文字 Entity を作成し、返します。

パラメータ:
name - エンティティーの名前
戻り値:
新しい Entity

defElement

protected Element defElement(String name,
                             int type,
                             boolean omitStart,
                             boolean omitEnd,
                             ContentModel content,
                             String[] exclusions,
                             String[] inclusions,
                             AttributeList atts)
Element を作成し、返します。

パラメータ:
name - 要素の名前
戻り値:
新しい Element

defAttributeList

protected AttributeList defAttributeList(String name,
                                         int type,
                                         int modifier,
                                         String value,
                                         String values,
                                         AttributeList atts)
AttributeList を作成し、返します。

パラメータ:
name - 属性リストの名前
戻り値:
新しい AttributeList

defContentModel

protected ContentModel defContentModel(int type,
                                       Object obj,
                                       ContentModel next)
新しいコンテンツモデルを作成し、返します。

パラメータ:
type - 新しいコンテンツモデルのタイプ
戻り値:
新しい ContentModel

toString

public String toString()
この DTD の文字列表現を返します。

オーバーライド:
クラス Object 内の toString
戻り値:
この DTD の文字列表現

putDTDHash

public static void putDTDHash(String name,
                              DTD dtd)

getDTD

public static DTD getDTD(String name)
                  throws IOException
指定した name を持つ DTD を返します。その名前の DTD が存在しない場合は、作成して返します。名前に含まれる大文字は小文字に変換されます。

パラメータ:
name - DTD の名前
戻り値:
name に対応する DTD
例外:
IOException

read

public void read(DataInputStream in)
          throws IOException
アーカイブされた形式から DTD を再作成します。

パラメータ:
in - 読み込み元の DataInputStream
例外:
IOException

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。