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, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。