FileDocCategorySizeDatePackage
DTDDVFactory.javaAPI DocJava SE 6 API3071Tue Jun 10 00:22:40 BST 2008com.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.
xerces.internal
author
Sandy Gao, IBM
version
$Id: DTDDVFactory.java,v 1.2.6.1 2005/09/12 10:59:45 neerajbj 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.");
        }