FileDocCategorySizeDatePackage
DTDDVFactory.javaAPI DocJava SE 5 API5107Fri Aug 26 14:55:46 BST 2005com.sun.org.apache.xerces.internal.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.
author
Sandy Gao, IBM
version
$Id: DTDDVFactory.java,v 1.7 2004/02/17 07:14:48 neeraj Exp $

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

Methods Summary
public abstract com.sun.org.apache.xerces.internal.impl.dv.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 synchronized com.sun.org.apache.xerces.internal.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 synchronized com.sun.org.apache.xerces.internal.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.");
        }