FileDocCategorySizeDatePackage
ParserFactory.javaAPI DocphoneME MR2 API (J2ME)4932Wed May 02 18:00:34 BST 2007com.sun.ukit.jaxp

ParserFactory

public class ParserFactory extends SAXParserFactory
Implementation of JAXP SAXParserFactory.

Fields Summary
public static final String
FEATURE_NS
public static final String
FEATURE_PREF
private boolean
namespaces
private boolean
prefixes
Constructors Summary
Methods Summary
public booleangetFeature(java.lang.String name)
Returns the particular property requested for in the underlying implementation of DefaultHandler.

param
name The name of the property to be retrieved.
return
Value of the requested property.
exception
SAXNotRecognizedException When the underlying DefaultHandler does not recognize the property name.
exception
SAXNotSupportedException When the underlying DefaultHandler recognizes the property name but doesn't support the property.

		if (FEATURE_NS.equals(name) == true) {
			return namespaces;
		} else if (FEATURE_PREF.equals(name) == true) {
			return prefixes;
		} else {
			throw new SAXNotRecognizedException(name);
		}
	
public javax.xml.parsers.SAXParsernewSAXParser()
Creates a new instance of a SAXParser using the currently configured factory parameters.

return
A new instance of a SAXParser.
exception
ParserConfigurationException if a parser cannot be created which satisfies the requested configuration.


                                          
	  
		  
	
		if ((namespaces == true) && (prefixes == false)) {
			return new Parser(true);
		} else if ((namespaces == false) && (prefixes == true)) {
			return new Parser(false);
		} else {
			throw new ParserConfigurationException("");
		}
	
public voidsetFeature(java.lang.String name, boolean value)
Sets the particular feature in the underlying implementation of DefaultHandler. A list of the core features and properties can be found at http://www.saxproject.org/?selected=get-set

param
name The name of the feature to be set.
param
value The value of the feature to be set.
exception
SAXNotRecognizedException When the underlying DefaultHandler does not recognize the property name.
exception
SAXNotSupportedException When the underlying DefaultHandler recognizes the property name but doesn't support the property.

		if (FEATURE_NS.equals(name) == true) {
			namespaces = value;
		} else if (FEATURE_PREF.equals(name) == true) {
			prefixes   = value;
		} else {
			throw new SAXNotRecognizedException(name);
		}
	
public voidsetNamespaceAware(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.

param
awareness true if the parser produced by this code will provide support for XML namespaces; false otherwise.

        super.setNamespaceAware(awareness);
        if (awareness == true) {
        	namespaces = true;
        	prefixes   = false;
        } else {
        	namespaces = false;
        	prefixes   = true;
        }