Java Doc for ParserAdapter.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.ParserAdapter

ParserAdapter
public class ParserAdapter implements XMLReader,DocumentHandler(Code)
Adapt a SAX1 Parser as a SAX2 XMLReader.
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 SAX1 org.xml.sax.Parser Parser and makes it act as a SAX2 org.xml.sax.XMLReader XMLReader , with feature, property, and Namespace support. Note that it is not possible to report org.xml.sax.ContentHandler.skippedEntityskippedEntity events, since SAX1 does not make that information available.

This adapter does not test for duplicate Namespace-qualified attribute names.


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

Inner Class :final class AttributeListAdapter implements Attributes

Field Summary
 ContentHandlercontentHandler
    
 DTDHandlerdtdHandler
    
 EntityResolverentityResolver
    
 ErrorHandlererrorHandler
    
 Locatorlocator
    

Constructor Summary
public  ParserAdapter()
     Construct a new parser adapter.
public  ParserAdapter(Parser parser)
     Construct a new parser adapter.

Method Summary
public  voidcharacters(char ch, int start, int length)
     Adapter implementation method; do not call.
public  voidendDocument()
     Adapter implementation method; do not call.
public  voidendElement(String qName)
     Adapter implementation method; do not call.
public  ContentHandlergetContentHandler()
     Return the current content handler.
public  DTDHandlergetDTDHandler()
     Return the current DTD handler.
public  EntityResolvergetEntityResolver()
     Return the current entity resolver.
public  ErrorHandlergetErrorHandler()
     Return the current error handler.
public  booleangetFeature(String name)
     Check a parser feature flag.

The only features recognized are namespaces and namespace-prefixes.


Parameters:
  name - The feature name, as a complete URI.
public  ObjectgetProperty(String name)
     Get a parser property.

No properties are currently recognized.


Parameters:
  name - The property name.
public  voidignorableWhitespace(char ch, int start, int length)
     Adapter implementation method; do not call.
public  voidparse(String systemId)
     Parse an XML document.
public  voidparse(InputSource input)
     Parse an XML document.
public  voidprocessingInstruction(String target, String data)
     Adapter implementation method; do not call.
 voidreportError(String message)
     Report a non-fatal error.
public  voidsetContentHandler(ContentHandler handler)
     Set the content handler.
public  voidsetDTDHandler(DTDHandler handler)
     Set the DTD handler.
public  voidsetDocumentLocator(Locator locator)
     Adapter implementation method; do not call.
public  voidsetEntityResolver(EntityResolver resolver)
     Set the entity resolver.
public  voidsetErrorHandler(ErrorHandler handler)
     Set the error handler.
public  voidsetFeature(String name, boolean value)
     Set a feature flag for the parser.
public  voidsetProperty(String name, Object value)
     Set a parser property.
public  voidstartDocument()
     Adapter implementation method; do not call.
public  voidstartElement(String qName, AttributeList qAtts)
     Adapter implementation method; do not call.

Field Detail
contentHandler
ContentHandler contentHandler(Code)



dtdHandler
DTDHandler dtdHandler(Code)



entityResolver
EntityResolver entityResolver(Code)



errorHandler
ErrorHandler errorHandler(Code)



locator
Locator locator(Code)




Constructor Detail
ParserAdapter
public ParserAdapter() throws SAXException(Code)
Construct a new parser adapter.

Use the "org.xml.sax.parser" property to locate the embedded SAX1 driver.


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



ParserAdapter
public ParserAdapter(Parser parser)(Code)
Construct a new parser adapter.

Note that the embedded parser cannot be changed once the adapter is created; to embed a different parser, allocate a new ParserAdapter.


Parameters:
  parser - The SAX1 parser to embed.
exception:
  java.lang.NullPointerException - If the parser parameteris null.




Method Detail
characters
public void characters(char ch, int start, int length) throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 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:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.characters



endDocument
public void endDocument() throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 end document event.
exception:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.endDocument



endElement
public void endElement(String qName) throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 end element event.
Parameters:
  qName - The qualified (prefixed) name.
exception:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.endElement



getContentHandler
public ContentHandler getContentHandler()(Code)
Return the current content handler. The current content handler, or null if none was supplied.
See Also:   org.xml.sax.XMLReader.getEntityResolver



getDTDHandler
public DTDHandler getDTDHandler()(Code)
Return the current DTD handler. The current DTD handler, or null if none was supplied.
See Also:   org.xml.sax.XMLReader.getEntityResolver



getEntityResolver
public EntityResolver getEntityResolver()(Code)
Return the current entity resolver. The current entity resolver, or null if none was supplied.
See Also:   org.xml.sax.XMLReader.getEntityResolver



getErrorHandler
public ErrorHandler getErrorHandler()(Code)
Return the current error handler. The current error handler, or null if none was supplied.
See Also:   org.xml.sax.XMLReader.getEntityResolver



getFeature
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Check a parser feature flag.

The only features recognized are namespaces and namespace-prefixes.


Parameters:
  name - The feature name, as a complete URI. The current feature value.
exception:
  SAXNotRecognizedException - If the featurevalue can't be assigned or retrieved.
exception:
  SAXNotSupportedException - If thefeature is not currently readable.
See Also:   org.xml.sax.XMLReader.setFeature



getProperty
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Get a parser property.

No properties are currently recognized.


Parameters:
  name - The property name. The property value.
exception:
  SAXNotRecognizedException - If the propertyvalue can't be assigned or retrieved.
exception:
  SAXNotSupportedException - If the propertyvalue is not currently readable.
See Also:   org.xml.sax.XMLReader.getProperty



ignorableWhitespace
public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 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:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.ignorableWhitespace



parse
public void parse(String systemId) throws IOException, SAXException(Code)
Parse an XML document.
Parameters:
  systemId - The absolute URL of the document.
exception:
  java.io.IOException - If there is a problem readingthe raw content of the document.
exception:
  SAXException - If there is a problemprocessing the document.
See Also:   ParserAdapter.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 an XML document.
Parameters:
  input - An input source for the document.
exception:
  java.io.IOException - If there is a problem readingthe raw content of the document.
exception:
  SAXException - If there is a problemprocessing the document.
See Also:   ParserAdapter.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)
Adapter implementation method; do not call. Adapt a SAX1 processing instruction event.
Parameters:
  target - The processing instruction target.
Parameters:
  data - The remainder of the processing instruction
exception:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.processingInstruction



reportError
void reportError(String message) throws SAXException(Code)
Report a non-fatal error.
Parameters:
  message - The error message.
exception:
  SAXException - The client may throwan exception.



setContentHandler
public void setContentHandler(ContentHandler handler)(Code)
Set the content handler.
Parameters:
  resolver - The new content handler.
See Also:   org.xml.sax.XMLReader.setEntityResolver



setDTDHandler
public void setDTDHandler(DTDHandler handler)(Code)
Set the DTD handler.
Parameters:
  resolver - The new DTD handler.
See Also:   org.xml.sax.XMLReader.setEntityResolver



setDocumentLocator
public void setDocumentLocator(Locator locator)(Code)
Adapter implementation method; do not call. Adapt a SAX1 document locator event.
Parameters:
  locator - A document locator.
See Also:   org.xml.sax.ContentHandler.setDocumentLocator



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



setErrorHandler
public void setErrorHandler(ErrorHandler handler)(Code)
Set the error handler.
Parameters:
  resolver - The new error handler.
See Also:   org.xml.sax.XMLReader.setEntityResolver



setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Set a feature flag for the parser.

The only features recognized are namespaces and namespace-prefixes.


Parameters:
  name - The feature name, as a complete URI.
Parameters:
  value - The requested feature value.
exception:
  SAXNotRecognizedException - If the featurecan't be assigned or retrieved.
exception:
  SAXNotSupportedException - If the featurecan't be assigned that value.
See Also:   org.xml.sax.XMLReader.setFeature



setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Set a parser property.

No properties are currently recognized.


Parameters:
  name - The property name.
Parameters:
  value - The property value.
exception:
  SAXNotRecognizedException - If the propertyvalue can't be assigned or retrieved.
exception:
  SAXNotSupportedException - If the propertycan't be assigned that value.
See Also:   org.xml.sax.XMLReader.setProperty



startDocument
public void startDocument() throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 start document event.
exception:
  SAXException - The client may raise aprocessing exception.
See Also:   org.xml.sax.DocumentHandler.startDocument



startElement
public void startElement(String qName, AttributeList qAtts) throws SAXException(Code)
Adapter implementation method; do not call. Adapt a SAX1 startElement event.

If necessary, perform Namespace processing.


Parameters:
  qName - The qualified (prefixed) name.
Parameters:
  qAtts - The XML 1.0 attribute list (with qnames).
exception:
  SAXException - The client may raise aprocessing exception.



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.