Java Doc for XMLReaderAdapter.java in  » XML » Piccolo » org » xml » sax » helpers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » Piccolo » org.xml.sax.helpers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xml.sax.helpers.XMLReaderAdapter

XMLReaderAdapter
public class XMLReaderAdapter implements Parser,ContentHandler(Code)
Adapt a SAX2 XMLReader as a SAX1 Parser.
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.

This class wraps a SAX2 org.xml.sax.XMLReader XMLReader and makes it act as a SAX1 org.xml.sax.Parser Parser . The XMLReader must support a true value for the http://xml.org/sax/features/namespace-prefixes property or parsing will fail with a org.xml.sax.SAXException SAXException ; if the XMLReader supports a false value for the http://xml.org/sax/features/namespaces property, that will also be used to improve efficiency.


since:
   SAX 2.0
author:
   David Megginson
version:
   2.0.1 (sax2r2)
See Also:   org.xml.sax.Parser
See Also:   org.xml.sax.XMLReader

Inner Class :final class AttributesAdapter implements AttributeList

Field Summary
 DocumentHandlerdocumentHandler
    
 AttributesAdapterqAtts
    
 XMLReaderxmlReader
    

Constructor Summary
public  XMLReaderAdapter()
     Create a new adapter.
public  XMLReaderAdapter(XMLReader xmlReader)
     Create a new adapter.

Method Summary
public  voidcharacters(char ch, int start, int length)
     Adapt a SAX2 characters event.
public  voidendDocument()
     End document event.
public  voidendElement(String uri, String localName, String qName)
     Adapt a SAX2 end element event.
public  voidendPrefixMapping(String prefix)
     Adapt a SAX2 end prefix mapping event.
public  voidignorableWhitespace(char ch, int start, int length)
     Adapt a SAX2 ignorable whitespace event.
public  voidparse(String systemId)
     Parse the document.
public  voidparse(InputSource input)
     Parse the document.
public  voidprocessingInstruction(String target, String data)
     Adapt a SAX2 processing instruction event.
public  voidsetDTDHandler(DTDHandler handler)
     Register the DTD event handler.
public  voidsetDocumentHandler(DocumentHandler handler)
     Register the SAX1 document event handler.
public  voidsetDocumentLocator(Locator locator)
     Set a document locator.
public  voidsetEntityResolver(EntityResolver resolver)
     Register the entity resolver.
public  voidsetErrorHandler(ErrorHandler handler)
     Register the error event handler.
public  voidsetLocale(Locale locale)
     Set the locale for error reporting.
public  voidskippedEntity(String name)
     Adapt a SAX2 skipped entity event.
public  voidstartDocument()
     Start document event.
public  voidstartElement(String uri, String localName, String qName, Attributes atts)
     Adapt a SAX2 start element event.
public  voidstartPrefixMapping(String prefix, String uri)
     Adapt a SAX2 start prefix mapping event.

Field Detail
documentHandler
DocumentHandler documentHandler(Code)



qAtts
AttributesAdapter qAtts(Code)



xmlReader
XMLReader xmlReader(Code)




Constructor Detail
XMLReaderAdapter
public XMLReaderAdapter() throws SAXException(Code)
Create a new adapter.

Use the "org.xml.sax.driver" property to locate the SAX2 driver to embed.


exception:
  org.xml.sax.SAXException - If the embedded drivercannot be instantiated or if theorg.xml.sax.driver property is not specified.



XMLReaderAdapter
public XMLReaderAdapter(XMLReader xmlReader)(Code)
Create a new adapter.

Create a new adapter, wrapped around a SAX2 XMLReader. The adapter will make the XMLReader act like a SAX1 Parser.


Parameters:
  xmlReader - The SAX2 XMLReader to wrap.
exception:
  java.lang.NullPointerException - If the argument is null.




Method Detail
characters
public void characters(char ch, int start, int length) throws SAXException(Code)
Adapt a SAX2 characters event.
Parameters:
  ch - An array of characters.
Parameters:
  start - The starting position in the array.
Parameters:
  length - The number of characters to use.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.characters



endDocument
public void endDocument() throws SAXException(Code)
End document event.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.endDocument



endElement
public void endElement(String uri, String localName, String qName) throws SAXException(Code)
Adapt a SAX2 end element event.
Parameters:
  uri - The Namespace URI.
Parameters:
  localName - The Namespace local name.
Parameters:
  qName - The qualified (prefixed) name.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.endElement



endPrefixMapping
public void endPrefixMapping(String prefix)(Code)
Adapt a SAX2 end prefix mapping event.
Parameters:
  prefix - The prefix being mapped.
See Also:   org.xml.sax.ContentHandler.endPrefixMapping



ignorableWhitespace
public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)
Adapt a SAX2 ignorable whitespace event.
Parameters:
  ch - An array of characters.
Parameters:
  start - The starting position in the array.
Parameters:
  length - The number of characters to use.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.ignorableWhitespace



parse
public void parse(String systemId) throws IOException, SAXException(Code)
Parse the document.

This method will throw an exception if the embedded XMLReader does not support the http://xml.org/sax/features/namespace-prefixes property.


Parameters:
  systemId - The absolute URL of the document.
exception:
  java.io.IOException - If there is a problem readingthe raw content of the document.
exception:
  org.xml.sax.SAXException - If there is a problemprocessing the document.
See Also:   XMLReaderAdapter.parse(org.xml.sax.InputSource)
See Also:   org.xml.sax.Parser.parse(java.lang.String)



parse
public void parse(InputSource input) throws IOException, SAXException(Code)
Parse the document.

This method will throw an exception if the embedded XMLReader does not support the http://xml.org/sax/features/namespace-prefixes property.


Parameters:
  input - An input source for the document.
exception:
  java.io.IOException - If there is a problem readingthe raw content of the document.
exception:
  org.xml.sax.SAXException - If there is a problemprocessing the document.
See Also:   XMLReaderAdapter.parse(java.lang.String)
See Also:   org.xml.sax.Parser.parse(org.xml.sax.InputSource)



processingInstruction
public void processingInstruction(String target, String data) throws SAXException(Code)
Adapt a SAX2 processing instruction event.
Parameters:
  target - The processing instruction target.
Parameters:
  data - The remainder of the processing instruction
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.processingInstruction



setDTDHandler
public void setDTDHandler(DTDHandler handler)(Code)
Register the DTD event handler.
Parameters:
  handler - The new DTD event handler.
See Also:   org.xml.sax.Parser.setDTDHandler



setDocumentHandler
public void setDocumentHandler(DocumentHandler handler)(Code)
Register the SAX1 document event handler.

Note that the SAX1 document handler has no Namespace support.


Parameters:
  handler - The new SAX1 document event handler.
See Also:   org.xml.sax.Parser.setDocumentHandler



setDocumentLocator
public void setDocumentLocator(Locator locator)(Code)
Set a document locator.
Parameters:
  locator - The document locator.
See Also:   org.xml.sax.ContentHandler.setDocumentLocator



setEntityResolver
public void setEntityResolver(EntityResolver resolver)(Code)
Register the entity resolver.
Parameters:
  resolver - The new resolver.
See Also:   org.xml.sax.Parser.setEntityResolver



setErrorHandler
public void setErrorHandler(ErrorHandler handler)(Code)
Register the error event handler.
Parameters:
  handler - The new error event handler.
See Also:   org.xml.sax.Parser.setErrorHandler



setLocale
public void setLocale(Locale locale) throws SAXException(Code)
Set the locale for error reporting.

This is not supported in SAX2, and will always throw an exception.


Parameters:
  The - locale for error reporting.
See Also:   org.xml.sax.Parser.setLocale
exception:
  org.xml.sax.SAXException - Thrown unless overridden.



skippedEntity
public void skippedEntity(String name) throws SAXException(Code)
Adapt a SAX2 skipped entity event.
Parameters:
  name - The name of the skipped entity.
See Also:   org.xml.sax.ContentHandler.skippedEntity
exception:
  org.xml.sax.SAXException - Throwable by subclasses.



startDocument
public void startDocument() throws SAXException(Code)
Start document event.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.startDocument



startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException(Code)
Adapt a SAX2 start element event.
Parameters:
  uri - The Namespace URI.
Parameters:
  localName - The Namespace local name.
Parameters:
  qName - The qualified (prefixed) name.
Parameters:
  atts - The SAX2 attributes.
exception:
  org.xml.sax.SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.ContentHandler.endDocument



startPrefixMapping
public void startPrefixMapping(String prefix, String uri)(Code)
Adapt a SAX2 start prefix mapping event.
Parameters:
  prefix - The prefix being mapped.
Parameters:
  uri - The Namespace URI being mapped to.
See Also:   org.xml.sax.ContentHandler.startPrefixMapping



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.