Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JSR 172 - J2ME[tm] Web Services
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.xml.parsers
Class SAXParserFactory

    java.lang.Object
      |
      +--javax.xml.parsers.SAXParserFactory

public abstract class SAXParserFactory
extends java.lang.Object

Defines a factory API that enables applications to configure and obtain a SAX based parser to parse XML documents.

An implementation of the `SAXParserFactory` class is NOT guaranteed to be thread safe. It is up to the user application to make sure about the use of the `SAXParserFactory` from more than one thread. Alternatively the application can have one instance of the `SAXParserFactory` per thread. An application can use the same instance of the factory to obtain one or more instances of the `SAXParser` provided the instance of the factory isn't being used in more than one thread at a time.

The static `newInstance` method returns a new concrete implementation of this class.

Since:
  JAXP 1.0

Constructor Summary
`protected` | `SAXParserFactory()`

Method Summary
`abstract boolean` | `getFeature(java.lang.String name)` Returns the particular property requested for in the underlying implementation of DefaultHandler.
`boolean` | `isNamespaceAware()` Indicates whether or not the factory is configured to produce parsers which are namespace aware.
`boolean` | `isValidating()` Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
`static SAXParserFactory` | `newInstance()` Obtain a new instance of a `SAXParserFactory`.
`abstract SAXParser` | `newSAXParser()` Creates a new instance of a SAXParser using the currently configured factory parameters.
`abstract void` | `setFeature(java.lang.String name, boolean value)` Sets the particular feature in the underlying implementation of DefaultHandler.
`void` | `setNamespaceAware(boolean awareness)` Specifies that the parser produced by this code will provide support for XML namespaces.
`void` | `setValidating(boolean validating)` Specifies that the parser produced by this code will validate documents as they are parsed.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SAXParserFactory

    protected SAXParserFactory()

Method Detail

### newInstance

    public static SAXParserFactory newInstance()
                                        throws FactoryConfigurationError

  Obtain a new instance of a `SAXParserFactory`. This static method creates a new factory instance of the platform default `SAXParserFactory` instance. Once an application has obtained a reference to a `SAXParserFactory` it can use the factory to configure and obtain parser instances.

  Returns:
    A new instance of a SAXParserFactory.
  Throws:
    `FactoryConfigurationError` - if the implementation is not available or cannot be instantiated.

### newSAXParser

    public abstract SAXParser newSAXParser()
                                    throws ParserConfigurationException,
                                           SAXException

  Creates a new instance of a SAXParser using the currently configured factory parameters.

  Returns:
    A new instance of a SAXParser.
  Throws:
    `ParserConfigurationException` - if a parser cannot be created which satisfies the requested configuration.
    `SAXException`

### isNamespaceAware

    public boolean isNamespaceAware()

  Indicates whether or not the factory is configured to produce parsers which are namespace aware.

  Returns:
    true if the factory is configured to produce parsers which are namespace aware; false otherwise.

### isValidating

    public boolean isValidating()

  Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.

  Returns:
    true if the factory is configured to produce parsers which validate the XML content during parse.

### setFeature

    public abstract void setFeature(java.lang.String name,
                                    boolean value)
                             throws ParserConfigurationException,
                                    SAXNotRecognizedException,
                                    SAXNotSupportedException

  Sets the particular feature in the underlying implementation of DefaultHandler. A list of the core features and properties can be found at http://www.megginson.com/SAX/Java/features.html

  Parameters:
    `name` - The name of the feature to be set.
    `value` - The value of the feature to be set.
  Throws:
    `SAXNotRecognizedException` - When the underlying DefaultHandler does not recognize the property name.
    `SAXNotSupportedException` - When the underlying DefaultHandler recognizes the property name but doesn't support the property.
    `ParserConfigurationException`

### getFeature

    public abstract boolean getFeature(java.lang.String name)
                                throws ParserConfigurationException,
                                       SAXNotRecognizedException,
                                       SAXNotSupportedException

  Returns the particular property requested for in the underlying implementation of DefaultHandler.

  Parameters:
    `name` - The name of the property to be retrieved.
  Returns:
    Value of the requested property.
  Throws:
    `SAXNotRecognizedException` - When the underlying DefaultHandler does not recognize the property name.
    `SAXNotSupportedException` - When the underlying DefaultHandler recognizes the property name but doesn't support the property.
    `ParserConfigurationException`

### setNamespaceAware

    public void setNamespaceAware(boolean awareness)

  Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set to `false`.

  Parameters:
    `awareness` - true if the parser produced by this code will provide support for XML namespaces; false otherwise.

### setValidating

    public void setValidating(boolean validating)

  Specifies that the parser produced by this code will validate documents as they are parsed. By default the value of this is set to `false`.

  Parameters:
    `validating` - true if the parser produced by this code will validate documents as they are parsed; false otherwise.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JSR 172 - J2ME[tm] Web Services
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a comment or suggestion Version 1.0 of J2ME Web Services Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved. Use is subject to license terms.