org.enhydra.xml.xmlc.deferredparsing
Class XMLCDeferredParsingFactory

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.XMLCStdFactory
        |
        +--org.enhydra.xml.xmlc.deferredparsing.XMLCDeferredParsingFactory
All Implemented Interfaces:
XMLCFactory

public class XMLCDeferredParsingFactory
extends XMLCStdFactory

Factory class to create instances of an XMLC-generated class with "deferred parsing". Deferred parsing means that the DOM is parsed from a file on first acess and re-parsed on subsequent acesses whenever the DOM is out of date with regard to the source file.


Constructor Summary
XMLCDeferredParsingFactory(DocumentLoader docLoader, ClassLoader classLoader, XMLCLogger logger)
          Constructor.
 
Method Summary
 void addPackagePrefix(String prefix)
          Add a package prefix to be checked
 void addResourceDir(String path)
          Add a resource directory
 XMLObject createFromFile(String filename)
           
 XMLObject createFromFile(String filename, String domFactoryClassName)
          Create an XMLCObject from a source file.
protected  XMLObject doCreate(Class xmlcBasedClass)
          Create a new document instance.
protected  XMLObject doCreate(String xmlcClassName, ClassLoader classLoader)
          Do actualy work of creating a new object given a name.
 String getDefaultMetaDataFile()
          Get the default meta data file to be used by the dynamically added pages
(package private)  List getPackagePrefixList()
          Get the package prefix list, the list of package path is seperated with File.pathSeparator instead of '.'
(package private)  List getResourceDirList()
          Return the resource directory list
 void remove(String prefix)
          Remove the package prefix
 void removeResourceDir(String path)
          Remove the given directory from the resource directory list
 void setDefaultMetaDataPath(String path)
          Set the default meta data file to be used by the dynamically added pages
 
Methods inherited from class org.enhydra.xml.xmlc.XMLCStdFactory
create, create, getDefaultClassLoader, getLogger, handleError
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLCDeferredParsingFactory

public XMLCDeferredParsingFactory(DocumentLoader docLoader,
                                  ClassLoader classLoader,
                                  XMLCLogger logger)
Constructor.
Parameters:
docLoader - Document loader to use or null
classLoader - Classloader used to load classes when a class name is specified. If null, the system classload is used. for the StandardDocumentLoader
logger - XMLC logger or null for no logging.
Method Detail

doCreate

protected XMLObject doCreate(Class xmlcBasedClass)
                      throws ClassNotFoundException,
                             IllegalAccessException,
                             InstantiationException
Create a new document instance.
Overrides:
doCreate in class XMLCStdFactory

doCreate

protected XMLObject doCreate(String xmlcClassName,
                             ClassLoader classLoader)
                      throws ClassNotFoundException,
                             IllegalAccessException,
                             InstantiationException
Do actualy work of creating a new object given a name.
Overrides:
doCreate in class XMLCStdFactory

createFromFile

public XMLObject createFromFile(String filename)
See Also:
createFromFile(String, String)

createFromFile

public XMLObject createFromFile(String filename,
                                String domFactoryClassName)
Create an XMLCObject from a source file. If the domFactoryClassName is null, the default defined by the XMLCDomFactoryCache class.
Parameters:
the - name of the file to parse
the - fully qualified name of the dom factory to use, may be null

addResourceDir

public void addResourceDir(String path)
Add a resource directory
Parameters:
path - path to the directory to be added

removeResourceDir

public void removeResourceDir(String path)
Remove the given directory from the resource directory list
Parameters:
path - path to be removed

getResourceDirList

List getResourceDirList()
Return the resource directory list

addPackagePrefix

public void addPackagePrefix(String prefix)
Add a package prefix to be checked
Parameters:
prefix - package prefix to be added

remove

public void remove(String prefix)
Remove the package prefix
Parameters:
prefix - pacakge prefix to be removed

getPackagePrefixList

List getPackagePrefixList()
Get the package prefix list, the list of package path is seperated with File.pathSeparator instead of '.'

setDefaultMetaDataPath

public void setDefaultMetaDataPath(String path)
Set the default meta data file to be used by the dynamically added pages
Parameters:
path - path to the meta data file

getDefaultMetaDataFile

public String getDefaultMetaDataFile()
Get the default meta data file to be used by the dynamically added pages


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.