|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.modules.input.AbstractInputModule
org.apache.cocoon.components.modules.input.AbstractJXPathModule
org.apache.cocoon.components.modules.input.XMLFileModule
Source
(e.g.,
cocoon:/...
, context://..
, and regular URLs).
Sources can be held in memory for better performance and reloaded if
changed.
Caching and reloading can be turned on / off (default: caching on,
reloading off) through <reloadable>false</reloadable>
and <cacheable>false</cacheable>
. The file
(source) to use is specified through <file
src="protocol:path/to/file.xml" reloadable="true"
cacheable="true"/>
optionally overriding defaults for
caching and/or reloading.
In addition, xpath expressions are cached for higher performance.
Thus, if an expression has been evaluated for a file, the result
is cached and will be reused, the expression is not evaluated
a second time. This can be turned off using the cache-expressions
configuration option.
Nested Class Summary | |
protected class |
XMLFileModule.DocumentHelper
Takes care of (re-)loading and caching of sources. |
Field Summary |
Fields inherited from class org.apache.cocoon.components.modules.input.AbstractJXPathModule |
configuration, parameter |
Fields inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule |
settings |
Fields inherited from interface org.apache.cocoon.components.modules.input.InputModule |
ROLE |
Constructor Summary | |
XMLFileModule()
|
Method Summary | |
void |
configure(Configuration config)
Static (cocoon.xconf) configuration. |
void |
dispose()
Dispose this component |
protected void |
flushCache()
|
Object |
getAttribute(String name,
Configuration modeConf,
Map objectModel)
Standard access to an attribute's value. |
Object[] |
getAttributeValues(String name,
Configuration modeConf,
Map objectModel)
Returns an array of String objects containing all of the values the given attribute has, or null if the attribute does not exist. |
protected Object |
getContextObject(Configuration modeConf,
Map objectModel)
Get the DOM object that JXPath will operate on when evaluating attributes. |
void |
service(ServiceManager manager)
|
Methods inherited from class org.apache.cocoon.components.modules.input.AbstractJXPathModule |
getAttributeNames |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLFileModule()
Method Detail |
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration config) throws ConfigurationException
getContextObject(Configuration, Map)
configure
in interface Configurable
configure
in class AbstractJXPathModule
config
- a Configuration
value, as described above.
ConfigurationException
- if an error occurspublic void dispose()
dispose
in interface Disposable
dispose
in class AbstractInputModule
protected Object getContextObject(Configuration modeConf, Map objectModel) throws ConfigurationException
configure(Configuration)
.
getContextObject
in class AbstractJXPathModule
modeConf
- The dynamic configuration for the current operation. May
be null
, in which case static (cocoon.xconf) configuration
is used. Configuration is expected to have a <file> child node, and
be of the form:
<...>
<file src="..." reloadable="true|false"/>
</...>objectModel
- Object Model for the current module operation.
ConfigurationException
public Object getAttribute(String name, Configuration modeConf, Map objectModel) throws ConfigurationException
InputModule
InputModule.getAttributeValues(String, Configuration, Map)
or
InputModule.getAttributeNames(Configuration, Map)
and
InputModule.getAttribute(String, Configuration, Map)
to get them one by one.
getAttribute
in interface InputModule
getAttribute
in class AbstractJXPathModule
ConfigurationException
public Object[] getAttributeValues(String name, Configuration modeConf, Map objectModel) throws ConfigurationException
InputModule
InputModule.getAttributeNames(Configuration, Map)
together with
InputModule.getAttribute(String, Configuration, Map)
can be used to get the
values one by one.
getAttributeValues
in interface InputModule
getAttributeValues
in class AbstractJXPathModule
ConfigurationException
protected void flushCache()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |