BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xerces.validators.datatype
Class DatatypeValidatorFactoryImpl

java.lang.Object
  |
  +--weblogic.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl

public class DatatypeValidatorFactoryImpl
extends java.lang.Object
implements DatatypeValidatorFactory

This class implements a factory of Datatype Validators. Internally the DatatypeValidators are kept in a registry.
There is one instance of DatatypeValidatorFactoryImpl per Parser.
There is one datatype Registry per instance of DatatypeValidatorFactoryImpl, such registry is first allocated with the number DatatypeValidators needed.
e.g. If Parser finds an XML document with a DTD, a registry of DTD validators (only 9 validators) get initialized in the registry. The initialization process consist of instantiating the Datatype and facets and registering the Datatype into registry table. This implementatio uses a Hahtable as a registry table but future implementation should use a lighter object, maybe a Map class ( not use a derived Map class because of JDK 1.1.8 no supporting Map).

As the Parser parses an instance document it knows if validation needs to be checked. If no validation is necesary we should not instantiate a DatatypeValidatorFactoryImpl.
If validation is needed, we need to instantiate a DatatypeValidatorFactoryImpl.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Version:
$Id: DatatypeValidatorFactoryImpl.java,v 1.20 2001/02/14 21:28:30 elena Exp $
Author:
Jeffrey Rodriguez, Mark Swinkles - List Validation refactoring

Constructor Summary
DatatypeValidatorFactoryImpl()
           
 
Method Summary
 DatatypeValidator createDatatypeValidator(java.lang.String typeName, DatatypeValidator base, java.util.Hashtable facets, boolean list)
           
 DatatypeValidator createDatatypeValidator(java.lang.String typeName, java.util.Vector validators)
           
 void expandRegistryToFullSchemaSet()
           
 DatatypeValidator getDatatypeValidator(java.lang.String type)
           
 void initializeDTDRegistry()
          Initializes registry with primitive and derived Simple types.
 void resetRegistry()
          An optimization option that we should write in the future is to separate the static list of Datatype Validators from the dynamic part where anonymous, and user derived datatype are kept, then when we resetRegistry only the dynamic part of the registry should be cleared.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatatypeValidatorFactoryImpl

public DatatypeValidatorFactoryImpl()
Method Detail

initializeDTDRegistry

public void initializeDTDRegistry()
Initializes registry with primitive and derived Simple types. This method does not clear the registry to clear the registry you have to call resetRegistry. The net effect of this method is to start with a the smallest set of datatypes needed by the validator. If we start with DTD's then we initialize the table to only the 9 validators needed by DTD Validation. If we start with Schema's then we initialize to to full set of validators.

Parameters:
registrySet -  

expandRegistryToFullSchemaSet

public void expandRegistryToFullSchemaSet()


resetRegistry

public void resetRegistry()
An optimization option that we should write in the future is to separate the static list of Datatype Validators from the dynamic part where anonymous, and user derived datatype are kept, then when we resetRegistry only the dynamic part of the registry should be cleared. So we don't end up clearing the static part of the table over and over every time that we do a parse cycle.


createDatatypeValidator

public DatatypeValidator createDatatypeValidator(java.lang.String typeName,
                                                 DatatypeValidator base,
                                                 java.util.Hashtable facets,
                                                 boolean list)
                                          throws InvalidDatatypeFacetException
Specified by:
createDatatypeValidator in interface DatatypeValidatorFactory


createDatatypeValidator

public DatatypeValidator createDatatypeValidator(java.lang.String typeName,
                                                 java.util.Vector validators)


getDatatypeValidator

public DatatypeValidator getDatatypeValidator(java.lang.String type)


Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.