|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.util.dom.XMLCDeferredParsingDOMFactory
XMLC deferred parsing implementation of a DOMFactory. This class will load a DOM using XMLCDeferredParsingFactory.
Optionally, one may provide the XMLCDeferredParsingFactory that this DOMFactory
backs with context init parameters in the web.xml. In order to do that, the
current ServletContext must be set using setServletContext(ServletContext)
before adding a DOMFactory object to a DOMLoader
object. This can be done either programatically or set via the assembly descriptor with
<dom-loader factory="org.enhydra.xml.xmlc.deferredparsing.XMLCDeferredParsingFactory"> <set-property name="servletContext" delegateRuntimeValue="true"/> </dom-loader>
Once above requirement is met, one can set the following <context-param>'s in the web.xml...
These context init parameters match up exactly with those used by org.enhydra.xml.xmlc.servlet.XMLCContext. Therefore, the configuration used for this class is entirely compatible with XMLCContext.
Field Summary | |
protected boolean |
initialized
used for flagging whether the xmlcFactory has been initialized and avoiding unnecessary synchronization. |
protected static org.apache.log4j.Logger |
logger
used for logging |
protected String |
PARAM_XMLC_REPARSE_DEFAULT_METADATA_PATH
Definition of xmlcReparseDefaultMetaDataPath parameter |
protected String |
PARAM_XMLC_REPARSE_PACKAGE_PREFIXES
Definition of xmlcReparsePackagePrefixes parameter |
protected String |
PARAM_XMLC_REPARSE_RESOURCE_DIRS
Definition of xmlcReparseResourceDirs parameter. |
protected javax.servlet.ServletContext |
servletContext
optional, used to access context init parameters if set, ignored if null |
protected Object |
sync
arbitrary object used to synchronize upon |
protected org.enhydra.xml.xmlc.deferredparsing.XMLCDeferredParsingFactory |
xmlcFactory
XMLCFactory instance, stored so that it isn't re-created on every request. |
protected String |
xmlcReparseDefaultMetaDataPath
optional, used to access programatically set xmlc reparse default meta data path, ignored if null |
protected String |
xmlcReparsePackagePrefixes
optional, used to access programatically set xmlc reparse package prefixes, ignored if null |
protected String |
xmlcReparseResourceDirs
optional, used to access programatically set xmlc reparse resource dirs, ignored if null |
Constructor Summary | |
XMLCDeferredParsingDOMFactory()
|
Method Summary | |
Document |
getInstance(Class clazz)
Get a new instance of the DOM that is associated with the given class |
Document |
getInstance(String docPath)
Load a document directly from file. |
void |
setServletContext(javax.servlet.ServletContext iservletContext)
optional method to set the current servlet context. |
void |
setXMLCReparseDefaultMetaDataPath(String ireparseDefaultMetaDataPath)
optional method to directly set the xmlc reparse default meta data path. |
void |
setXMLCReparsePackagePrefixes(String ireparsePackagePrefixes)
optional method to directly set the xmlc reparse package prefixes. |
void |
setXMLCReparseResourceDirs(String ireparseResourceDirs)
optional method to directly set the xmlc resource dirs path. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final org.apache.log4j.Logger logger
protected final String PARAM_XMLC_REPARSE_RESOURCE_DIRS
protected final String PARAM_XMLC_REPARSE_PACKAGE_PREFIXES
protected final String PARAM_XMLC_REPARSE_DEFAULT_METADATA_PATH
protected javax.servlet.ServletContext servletContext
setServletContext(ServletContext)
protected String xmlcReparseResourceDirs
setXMLCReparseResourceDirs(String)
protected String xmlcReparsePackagePrefixes
setXMLCReparsePackagePrefixes(String)
protected String xmlcReparseDefaultMetaDataPath
setXMLCReparseDefaultMetaDataPath(String)
protected final Object sync
protected boolean initialized
protected org.enhydra.xml.xmlc.deferredparsing.XMLCDeferredParsingFactory xmlcFactory
Constructor Detail |
public XMLCDeferredParsingDOMFactory()
Method Detail |
public Document getInstance(Class clazz) throws IOException
getInstance
in interface DOMFactory
clazz
- the class to be loaded as a DOM object. In this case, this class
should implement XMLObject or the underlying XMLCFactory will
not be able to instantiate it.
IOException
public Document getInstance(String docPath) throws IOException
getInstance
in interface DOMFactory
docPath
- path to file relative to provided resource directories
IOException
public void setServletContext(javax.servlet.ServletContext iservletContext)
iservletContext
- the current servlet contextpublic void setXMLCReparseResourceDirs(String ireparseResourceDirs)
ireparseResourceDirs
- a list of additional directories to load the html and meta
data files separated by File.separatorpublic void setXMLCReparsePackagePrefixes(String ireparsePackagePrefixes)
ireparsePackagePrefixes
- a list of package prefixes to be
removed while searching for html and meta data files, relative to the
classpath and resource dirs, separated by File.separatorpublic void setXMLCReparseDefaultMetaDataPath(String ireparseDefaultMetaDataPath)
ireparseDefaultMetaDataPath
- a path to the default meta data
file, relative to the classpath and resource dirs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |