| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.xml.sax.helpers.ParserAdapter
public class ParserAdapter
将 SAX1 Parser 适配为 SAX2 XMLReader。
此模块(包括源代码和文档)位于公共域中,对该模块不提供担保。有关更多信息,请参阅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)适配器实现方法;不调用。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
public ParserAdapter()
              throws SAXException
使用 "org.xml.sax.parser" 属性查找嵌入的 SAX1 驱动程序。
SAXException - 如果不能实例化嵌入的驱动程序,或者未指定 org.xml.sax.parser 属性。public ParserAdapter(Parser parser)
注意,一旦创建适配器,将不能更改嵌入的解析器;要嵌入不同的解析器,应分配一个新的 ParserAdapter。
parser - 要嵌入的 SAX1 解析器。
NullPointerException - 如果解析器参数为 null。| 方法详细信息 | 
|---|
public void setFeature(String name,
                       boolean value)
                throws SAXNotRecognizedException,
                       SAXNotSupportedException
能识别的功能仅为名称空间和名称前缀。
XMLReader 中的 setFeaturename - 功能名称,作为一个完整的 URI。value - 请求的功能值。
SAXNotRecognizedException - 如果无法分配或检索该功能。
SAXNotSupportedException - 如果不能把该值分配给功能。XMLReader.setFeature(java.lang.String, boolean)
public boolean getFeature(String name)
                   throws SAXNotRecognizedException,
                          SAXNotSupportedException
能识别的功能仅为名称空间和名称前缀。
XMLReader 中的 getFeaturename - 功能名称,作为一个完整的 URI。
SAXNotRecognizedException - 如果无法分配或检索功能值。
SAXNotSupportedException - 如果该功能当前不可读。XMLReader.setFeature(java.lang.String, boolean)
public void setProperty(String name,
                        Object value)
                 throws SAXNotRecognizedException,
                        SAXNotSupportedException
当前未识别任何属性。
XMLReader 中的 setPropertyname - 属性名。value - 属性值。
SAXNotRecognizedException - 如果无法分配或检索属性值。
SAXNotSupportedException - 如果不能把该值分配给属性。XMLReader.setProperty(java.lang.String, java.lang.Object)
public Object getProperty(String name)
                   throws SAXNotRecognizedException,
                          SAXNotSupportedException
当前未识别任何属性。
XMLReader 中的 getPropertyname - 属性名。
SAXNotRecognizedException - 如果无法分配或检索属性值。
SAXNotSupportedException - 如果属性值当前不可读。XMLReader.getProperty(java.lang.String)public void setEntityResolver(EntityResolver resolver)
XMLReader 中的 setEntityResolverresolver - 新实体解析器。XMLReader.setEntityResolver(org.xml.sax.EntityResolver)public EntityResolver getEntityResolver()
XMLReader 中的 getEntityResolverXMLReader.getEntityResolver()public void setDTDHandler(DTDHandler handler)
XMLReader 中的 setDTDHandlerhandler - the new DTD handlerXMLReader.setEntityResolver(org.xml.sax.EntityResolver)public DTDHandler getDTDHandler()
XMLReader 中的 getDTDHandlerXMLReader.getEntityResolver()public void setContentHandler(ContentHandler handler)
XMLReader 中的 setContentHandlerhandler - the new content handlerXMLReader.setEntityResolver(org.xml.sax.EntityResolver)public ContentHandler getContentHandler()
XMLReader 中的 getContentHandlerXMLReader.getEntityResolver()public void setErrorHandler(ErrorHandler handler)
XMLReader 中的 setErrorHandlerhandler - 新的错误处理程序。XMLReader.setEntityResolver(org.xml.sax.EntityResolver)public ErrorHandler getErrorHandler()
XMLReader 中的 getErrorHandlerXMLReader.getEntityResolver()
public void parse(String systemId)
           throws IOException,
                  SAXException
XMLReader 中的 parsesystemId - 文档的绝对 URL。
IOException - 如果在读取文档的原始内容时存在问题。
SAXException - 如果在处理文档时存在问题。parse(org.xml.sax.InputSource), 
Parser.parse(java.lang.String)
public void parse(InputSource input)
           throws IOException,
                  SAXException
XMLReader 中的 parseinput - 文档的输入源。
IOException - 如果在读取文档的原始内容时存在问题。
SAXException - 如果在处理文档时存在问题。parse(java.lang.String), 
Parser.parse(org.xml.sax.InputSource)public void setDocumentLocator(Locator locator)
DocumentHandler 中的 setDocumentLocatorlocator - 文档定位器。ContentHandler.setDocumentLocator(org.xml.sax.Locator)
public void startDocument()
                   throws SAXException
DocumentHandler 中的 startDocumentSAXException - 客户端可能引发处理异常。DocumentHandler.startDocument()
public void endDocument()
                 throws SAXException
DocumentHandler 中的 endDocumentSAXException - 客户端可能引发处理异常。DocumentHandler.endDocument()
public void startElement(String qName,
                         AttributeList qAtts)
                  throws SAXException
如果必要,则执行 Namespace 处理。
DocumentHandler 中的 startElementqName - 限定的(前缀)名称。qAtts - XML 属性列表(带 qnames)。
SAXException - 客户端可能引发处理异常。DocumentHandler.endElement(java.lang.String), 
AttributeList
public void endElement(String qName)
                throws SAXException
DocumentHandler 中的 endElementqName - 限定的(前缀)名称。
SAXException - 客户端可能引发处理异常。DocumentHandler.endElement(java.lang.String)
public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
DocumentHandler 中的 charactersch - 一个字符数组。start - 数组中的开始位置。length - 要使用的字符数。
SAXException - 客户端可能引发处理异常。DocumentHandler.characters(char[], int, int)
public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
DocumentHandler 中的 ignorableWhitespacech - 字符数组。start - 数组中的开始位置。length - 要使用的字符数。
SAXException - 客户端可能引发处理异常。DocumentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(String target,
                                  String data)
                           throws SAXException
DocumentHandler 中的 processingInstructiontarget - 处理指令目标。data - 处理指令的剩余部分
SAXException - 客户端可能引发处理异常。DocumentHandler.processingInstruction(java.lang.String, java.lang.String)| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。