FileDocCategorySizeDatePackage
DTDDVFactory.javaAPI DocApache Xerces 3.0.13274Fri Sep 14 20:33:54 BST 2007org.apache.xerces.impl.dv

DTDDVFactory

public abstract class DTDDVFactory extends Object
The factory to create and return DTD types. The implementation should store the created datatypes in static data, so that they can be shared by multiple parser instance, and multiple threads.
xerces.internal
author
Sandy Gao, IBM
version
$Id: DTDDVFactory.java 558581 2007-07-23 01:38:26Z mrglavas $

Fields Summary
private static final String
DEFAULT_FACTORY_CLASS
Constructors Summary
protected DTDDVFactory()

Methods Summary
public abstract DatatypeValidatorgetBuiltInDV(java.lang.String name)
return a dtd type of the given name

param
name the name of the datatype
return
the datatype validator of the given name

public abstract java.util.HashtablegetBuiltInTypes()
get all built-in DVs, which are stored in a hashtable keyed by the name

return
a hashtable which contains all datatypes

public static final org.apache.xerces.impl.dv.DTDDVFactorygetInstance()
Get an instance of the default DTDDVFactory implementation.

return
an instance of DTDDVFactory implementation
exception
DVFactoryException cannot create an instance of the specified class name or the default class name


                                                                        
           
        return getInstance(DEFAULT_FACTORY_CLASS);
    
public static final org.apache.xerces.impl.dv.DTDDVFactorygetInstance(java.lang.String factoryClass)
Get an instance of DTDDVFactory implementation.

param
factoryClass name of the implementation to load.
return
an instance of DTDDVFactory implementation
exception
DVFactoryException cannot create an instance of the specified class name or the default class name

        try {
            // if the class name is not specified, use the default one
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, ObjectFactory.findClassLoader(), true));
        } 
        catch (ClassCastException e) {
            throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
        }