public class ParserAdapter extends Object implements XMLReader, DocumentHandler
このモジュールは、ソース・コード、文書ともに公開ドメインに置かれています。したがって、内容に関する保証は一切提供されません。詳細については、http://www.saxproject.orgを参照してください。
このクラスは、SAX1 Parserをラップして、機能、プロパティ、名前空間を利用できるSAX2 XMLReaderとして動作させます。ただし、skippedEntityイベントの報告は行われません。これは、この情報がSAX1では提供されないためです。
名前空間修飾子付きの属性名が重複している環境におけるこのアダプタの動作は未検証です。
XMLReaderAdapter, XMLReader, Parser| コンストラクタと説明 |
|---|
ParserAdapter()
新しいパーサー・アダプタを構築します。
|
ParserAdapter(Parser parser)
新しいパーサー・アダプタを構築します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
void |
characters(char[] ch, int start, int length)
アダプタ実装メソッドは呼び出しません。
|
void |
endDocument()
アダプタ実装メソッドは呼び出しません。
|
void |
endElement(String qName)
アダプタ実装メソッドは呼び出しません。
|
ContentHandler |
getContentHandler()
現在のコンテンツ・ハンドラを返します。
|
DTDHandler |
getDTDHandler()
現在のDTDハンドラを返します。
|
EntityResolver |
getEntityResolver()
現在のエンティティ・リゾルバを返します。
|
ErrorHandler |
getErrorHandler()
現在のエラー・ハンドラを返します。
|
boolean |
getFeature(String name)
パーサー機能フラグをチェックします。
|
Object |
getProperty(String name)
パーサー・プロパティを取得します。
|
void |
ignorableWhitespace(char[] ch, int start, int length)
アダプタ実装メソッドは呼び出しません。
|
void |
parse(InputSource input)
XML文書を構文解析します。
|
void |
parse(String systemId)
XML文書を構文解析します。
|
void |
processingInstruction(String target, String data)
アダプタ実装メソッドは呼び出しません。
|
void |
setContentHandler(ContentHandler handler)
コンテンツ・ハンドラを設定します。
|
void |
setDocumentLocator(Locator locator)
アダプタ実装メソッドは呼び出しません。
|
void |
setDTDHandler(DTDHandler handler)
DTDハンドラを設定します。
|
void |
setEntityResolver(EntityResolver resolver)
エンティティ・リゾルバを設定します。
|
void |
setErrorHandler(ErrorHandler handler)
エラー・ハンドラを設定します。
|
void |
setFeature(String name, boolean value)
パーサーの機能フラグを設定します。
|
void |
setProperty(String name, Object value)
パーサー・プロパティを設定します。
|
void |
startDocument()
アダプタ実装メソッドは呼び出しません。
|
void |
startElement(String qName, AttributeList qAtts)
アダプタ実装メソッドは呼び出しません。
|
public ParserAdapter()
throws SAXException
「org.xml.sax.parser」プロパティを使用して組み込みSAX1ドライバを特定します。
SAXException - 組込みドライバをインスタンス化できない場合、またはorg.xml.sax.parserプロパティが指定されていない場合。public ParserAdapter(Parser parser)
アダプタの作成後は、組込みパーサーを変更できません。ほかのパーサーを組み込むには、新しいParserAdapterを割り当てます。
parser - 組み込むSAX1パーサー。NullPointerException - parserパラメータがnullの場合。public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
認識されている機能は名前空間と名前空間接頭辞のみです。
setFeature、インタフェース: XMLReadername - 機能名を示す完全なURI。value - 要求された機能の値。SAXNotRecognizedException - 機能を割り当てられない、または取得できない場合。SAXNotSupportedException - 機能にその値を割り当てられない場合。XMLReader.setFeature(java.lang.String, boolean)public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
認識されている機能は名前空間と名前空間接頭辞のみです。
getFeature、インタフェース: XMLReadername - 機能名を示す完全なURI。SAXNotRecognizedException - 機能値を割り当てられない、または取得できない場合。SAXNotSupportedException - 機能を現在読み取れない場合。XMLReader.setFeature(java.lang.String, boolean)public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
現在認識されるプロパティはありません。
setProperty、インタフェース: XMLReadername - プロパティ名。value - プロパティ値。SAXNotRecognizedException - プロパティ値を割り当てられない、または取得できない場合。SAXNotSupportedException - プロパティにその値を割り当てられない場合。XMLReader.setProperty(java.lang.String, java.lang.Object)public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
現在認識されるプロパティはありません。
getProperty、インタフェース: XMLReadername - プロパティ名。SAXNotRecognizedException - プロパティ値を割り当てられない、または取得できない場合。SAXNotSupportedException - プロパティの値を現在読み取れない場合。XMLReader.getProperty(java.lang.String)public void setEntityResolver(EntityResolver resolver)
setEntityResolver、インタフェース: XMLReaderresolver - 新しいエンティティ・リゾルバ。XMLReader.setEntityResolver(org.xml.sax.EntityResolver)public EntityResolver getEntityResolver()
getEntityResolver、インタフェース: XMLReaderXMLReader.getEntityResolver()public void setDTDHandler(DTDHandler handler)
setDTDHandler、インタフェース: XMLReaderhandler - 新しいDTDハンドラXMLReader.setEntityResolver(org.xml.sax.EntityResolver)public DTDHandler getDTDHandler()
getDTDHandler、インタフェース: XMLReaderXMLReader.getEntityResolver()public void setContentHandler(ContentHandler handler)
setContentHandler、インタフェース: XMLReaderhandler - 新しいコンテンツ・ハンドラXMLReader.setEntityResolver(org.xml.sax.EntityResolver)public ContentHandler getContentHandler()
getContentHandler、インタフェース: XMLReaderXMLReader.getEntityResolver()public void setErrorHandler(ErrorHandler handler)
setErrorHandler、インタフェース: XMLReaderhandler - 新しいエラー・ハンドラ。XMLReader.setEntityResolver(org.xml.sax.EntityResolver)public ErrorHandler getErrorHandler()
getErrorHandler、インタフェース: XMLReaderXMLReader.getEntityResolver()public void parse(String systemId) throws IOException, SAXException
parse、インタフェース: XMLReadersystemId - 文書の絶対URL。IOException - 文書のrawコンテンツの読取り時に問題が発生した場合。SAXException - 文書処理時に問題が発生した場合。parse(org.xml.sax.InputSource), Parser.parse(java.lang.String)public void parse(InputSource input) throws IOException, SAXException
parse、インタフェース: XMLReaderinput - 文書の入力ソース。IOException - 文書のrawコンテンツの読取り時に問題が発生した場合。SAXException - 文書処理時に問題が発生した場合。parse(java.lang.String), Parser.parse(org.xml.sax.InputSource)public void setDocumentLocator(Locator locator)
setDocumentLocator、インタフェース: DocumentHandlerlocator - 文書ロケータ。ContentHandler.setDocumentLocator(org.xml.sax.Locator)public void startDocument()
throws SAXException
startDocument、インタフェース: DocumentHandlerSAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.startDocument()public void endDocument()
throws SAXException
endDocument、インタフェース: DocumentHandlerSAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.endDocument()public void startElement(String qName, AttributeList qAtts) throws SAXException
必要に応じて、名前空間処理を行います。
startElement、インタフェース: DocumentHandlerqName - 接頭辞付きの修飾名。qAtts - XML属性リスト(修飾名付き)。SAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.endElement(java.lang.String), AttributeListpublic void endElement(String qName) throws SAXException
endElement、インタフェース: DocumentHandlerqName - 接頭辞付きの修飾名。SAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.endElement(java.lang.String)public void characters(char[] ch,
int start,
int length)
throws SAXException
characters、インタフェース: DocumentHandlerch - 文字配列。start - 配列内の開始位置。length - 使用する文字数。SAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.characters(char[], int, int)public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace、インタフェース: DocumentHandlerch - 文字配列。start - 配列内の開始位置。length - 使用する文字数。SAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.ignorableWhitespace(char[], int, int)public void processingInstruction(String target, String data) throws SAXException
processingInstruction、インタフェース: DocumentHandlertarget - 処理命令のターゲット。data - 処理命令を受けるデータSAXException - クライアントで処理例外が発生する場合があります。DocumentHandler.processingInstruction(java.lang.String, java.lang.String) バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.