Java Doc for SAXParser.java in  » 6.0-JDK-Core » xml » javax » xml » parsers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » xml » javax.xml.parsers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.parsers.SAXParser

SAXParser
abstract public class SAXParser (Code)
Defines the API that wraps an org.xml.sax.XMLReader implementation class. In JAXP 1.0, this class wrapped the org.xml.sax.Parser interface, however this interface was replaced by the org.xml.sax.XMLReader . For ease of transition, this class continues to support the same name and interface as well as supporting new methods. An instance of this class can be obtained from the javax.xml.parsers.SAXParserFactory.newSAXParser method. Once an instance of this class is obtained, XML can be parsed from a variety of input sources. These input sources are InputStreams, Files, URLs, and SAX InputSources.

This static method creates a new factory instance based on a system property setting or uses the platform default if no property has been defined.

The system property that controls which Factory implementation to create is named "javax.xml.parsers.SAXParserFactory". This property names a class that is a concrete subclass of this abstract class. If no property is defined, a platform default will be used.

As the content is parsed by the underlying parser, methods of the given org.xml.sax.HandlerBase or the org.xml.sax.helpers.DefaultHandler are called.

Implementors of this class which wrap an underlaying implementation can consider using the org.xml.sax.helpers.ParserAdapter class to initially adapt their SAX1 implementation to work under this revised class.
author:
   Jeff Suttor
version:
   $Revision: 1.6 $, $Date: 2007/01/27 01:26:27 $




Constructor Summary
protected  SAXParser()
    

Protected constructor to prevent instaniation.


Method Summary
abstract public  org.xml.sax.ParsergetParser()
     Returns the SAX parser that is encapsultated by the implementation of this class.
abstract public  ObjectgetProperty(String name)
    

Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader .


Parameters:
  name - The name of the property to be retrieved.
public  SchemagetSchema()
    
abstract public  org.xml.sax.XMLReadergetXMLReader()
     Returns the org.xml.sax.XMLReader that is encapsulated by the implementation of this class.
abstract public  booleanisNamespaceAware()
     Indicates whether or not this parser is configured to understand namespaces.
abstract public  booleanisValidating()
     Indicates whether or not this parser is configured to validate XML documents.
public  booleanisXIncludeAware()
    
public  voidparse(InputStream is, HandlerBase hb)
    

Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.HandlerBase .

public  voidparse(InputStream is, HandlerBase hb, String systemId)
    

Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.HandlerBase .

public  voidparse(InputStream is, DefaultHandler dh)
     Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.helpers.DefaultHandler .
public  voidparse(InputStream is, DefaultHandler dh, String systemId)
     Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.helpers.DefaultHandler .
public  voidparse(String uri, HandlerBase hb)
     Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified org.xml.sax.HandlerBase .
public  voidparse(String uri, DefaultHandler dh)
     Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified org.xml.sax.helpers.DefaultHandler .
public  voidparse(File f, HandlerBase hb)
     Parse the content of the file specified as XML using the specified org.xml.sax.HandlerBase .
public  voidparse(File f, DefaultHandler dh)
     Parse the content of the file specified as XML using the specified org.xml.sax.helpers.DefaultHandler .
public  voidparse(InputSource is, HandlerBase hb)
     Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.HandlerBase .
public  voidparse(InputSource is, DefaultHandler dh)
     Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.helpers.DefaultHandler .
public  voidreset()
    

Reset this SAXParser to its original configuration.

SAXParser is reset to the same state as when it was created with SAXParserFactory.newSAXParser . reset() is designed to allow the reuse of existing SAXParsers thus saving resources associated with the creation of new SAXParsers.

The reset SAXParser is not guaranteed to have the same Schema Object, e.g.

abstract public  voidsetProperty(String name, Object value)
    

Sets the particular property in the underlying implementation of org.xml.sax.XMLReader .



Constructor Detail
SAXParser
protected SAXParser()(Code)

Protected constructor to prevent instaniation. Use javax.xml.parsers.SAXParserFactory.newSAXParser .





Method Detail
getParser
abstract public org.xml.sax.Parser getParser() throws SAXException(Code)
Returns the SAX parser that is encapsultated by the implementation of this class. The SAX parser that is encapsultated by theimplementation of this class.
throws:
  SAXException - If any SAX errors occur during processing.



getProperty
abstract public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)

Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader .


Parameters:
  name - The name of the property to be retrieved. Value of the requested property.
throws:
  SAXNotRecognizedException - When the underlying XMLReader doesnot recognize the property name.
throws:
  SAXNotSupportedException - When the underlying XMLReaderrecognizes the property name but doesn't support the property.
See Also:   org.xml.sax.XMLReader.getProperty



getSchema
public Schema getSchema()(Code)

Get a reference to the the Schema being used by the XML processor.

If no schema is being used, null is returned.

Schema being used or nullif none in use
throws:
  UnsupportedOperationException - When implementation does notoverride this method
since:
   1.5



getXMLReader
abstract public org.xml.sax.XMLReader getXMLReader() throws SAXException(Code)
Returns the org.xml.sax.XMLReader that is encapsulated by the implementation of this class. The XMLReader that is encapsulated by theimplementation of this class.
throws:
  SAXException - If any SAX errors occur during processing.



isNamespaceAware
abstract public boolean isNamespaceAware()(Code)
Indicates whether or not this parser is configured to understand namespaces. true if this parser is configured tounderstand namespaces; false otherwise.



isValidating
abstract public boolean isValidating()(Code)
Indicates whether or not this parser is configured to validate XML documents. true if this parser is configured tovalidate XML documents; false otherwise.



isXIncludeAware
public boolean isXIncludeAware()(Code)

Get the XInclude processing mode for this parser.

the return value ofthe SAXParserFactory.isXIncludeAwarewhen this parser was created from factory.
throws:
  UnsupportedOperationException - When implementation does notoverride this method
since:
   1.5
See Also:   SAXParserFactory.setXIncludeAware(boolean)



parse
public void parse(InputStream is, HandlerBase hb) throws SAXException, IOException(Code)

Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.HandlerBase . Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0.


Parameters:
  is - InputStream containing the content to be parsed.
Parameters:
  hb - The SAX HandlerBase to use.
throws:
  IllegalArgumentException - If the given InputStream is null.
throws:
  SAXException - If parse produces a SAX error.
throws:
  IOException - If an IO error occurs interacting with theInputStream.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(InputStream is, HandlerBase hb, String systemId) throws SAXException, IOException(Code)

Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.HandlerBase . Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0.


Parameters:
  is - InputStream containing the content to be parsed.
Parameters:
  hb - The SAX HandlerBase to use.
Parameters:
  systemId - The systemId which is needed for resolving relative URIs.
throws:
  IllegalArgumentException - If the given InputStream isnull.
throws:
  IOException - If any IO error occurs interacting with theInputStream.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler
See Also:    version of this method instead.



parse
public void parse(InputStream is, DefaultHandler dh) throws SAXException, IOException(Code)
Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.helpers.DefaultHandler .
Parameters:
  is - InputStream containing the content to be parsed.
Parameters:
  dh - The SAX DefaultHandler to use.
throws:
  IllegalArgumentException - If the given InputStream is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(InputStream is, DefaultHandler dh, String systemId) throws SAXException, IOException(Code)
Parse the content of the given java.io.InputStream instance as XML using the specified org.xml.sax.helpers.DefaultHandler .
Parameters:
  is - InputStream containing the content to be parsed.
Parameters:
  dh - The SAX DefaultHandler to use.
Parameters:
  systemId - The systemId which is needed for resolving relative URIs.
throws:
  IllegalArgumentException - If the given InputStream is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler
See Also:    version of this method instead.



parse
public void parse(String uri, HandlerBase hb) throws SAXException, IOException(Code)
Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified org.xml.sax.HandlerBase . Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0
Parameters:
  uri - The location of the content to be parsed.
Parameters:
  hb - The SAX HandlerBase to use.
throws:
  IllegalArgumentException - If the uri is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(String uri, DefaultHandler dh) throws SAXException, IOException(Code)
Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified org.xml.sax.helpers.DefaultHandler .
Parameters:
  uri - The location of the content to be parsed.
Parameters:
  dh - The SAX DefaultHandler to use.
throws:
  IllegalArgumentException - If the uri is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(File f, HandlerBase hb) throws SAXException, IOException(Code)
Parse the content of the file specified as XML using the specified org.xml.sax.HandlerBase . Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0
Parameters:
  f - The file containing the XML to parse
Parameters:
  hb - The SAX HandlerBase to use.
throws:
  IllegalArgumentException - If the File object is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(File f, DefaultHandler dh) throws SAXException, IOException(Code)
Parse the content of the file specified as XML using the specified org.xml.sax.helpers.DefaultHandler .
Parameters:
  f - The file containing the XML to parse
Parameters:
  dh - The SAX DefaultHandler to use.
throws:
  IllegalArgumentException - If the File object is null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(InputSource is, HandlerBase hb) throws SAXException, IOException(Code)
Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.HandlerBase . Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0
Parameters:
  is - The InputSource containing the content to be parsed.
Parameters:
  hb - The SAX HandlerBase to use.
throws:
  IllegalArgumentException - If the InputSource objectis null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



parse
public void parse(InputSource is, DefaultHandler dh) throws SAXException, IOException(Code)
Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.helpers.DefaultHandler .
Parameters:
  is - The InputSource containing the content to be parsed.
Parameters:
  dh - The SAX DefaultHandler to use.
throws:
  IllegalArgumentException - If the InputSource objectis null.
throws:
  IOException - If any IO errors occur.
throws:
  SAXException - If any SAX errors occur during processing.
See Also:   org.xml.sax.DocumentHandler



reset
public void reset()(Code)

Reset this SAXParser to its original configuration.

SAXParser is reset to the same state as when it was created with SAXParserFactory.newSAXParser . reset() is designed to allow the reuse of existing SAXParsers thus saving resources associated with the creation of new SAXParsers.

The reset SAXParser is not guaranteed to have the same Schema Object, e.g. Object.equals(Object obj) . It is guaranteed to have a functionally equal Schema.


throws:
  UnsupportedOperationException - When Implementations do notoverride this method
since:
   1.5



setProperty
abstract public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)

Sets the particular property in the underlying implementation of org.xml.sax.XMLReader . A list of the core features and properties can be found at http://sax.sourceforge.net/?selected=get-set.


Parameters:
  name - The name of the property to be set.
Parameters:
  value - The value of the property to be set.
throws:
  SAXNotRecognizedException - When the underlying XMLReader doesnot recognize the property name.
throws:
  SAXNotSupportedException - When the underlying XMLReaderrecognizes the property name but doesn't support the property.
See Also:   org.xml.sax.XMLReader.setProperty



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.