|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.source.impl.AbstractConfigurableSourceInspector
public abstract class AbstractConfigurableSourceInspector
Abstract base class for SourceInspectors that want to configure the set of properties they handle beforehand.
Knowing which properties an inspector handles beforehand greatly improves property management performance.
Field Summary |
---|
Fields inherited from interface org.apache.cocoon.components.source.SourceInspector |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractConfigurableSourceInspector()
|
Method Summary | |
---|---|
void |
configure(Configuration configuration)
Configure this source inspector to handle properties of required types. |
protected abstract SourceProperty |
doGetSourceProperty(Source source,
String ns,
String name)
Do the actual work of getting the requested SourceProperty for the given Source. |
protected Set |
getPropertyTypes()
Provide subclasses access to the set of configured properties. |
SourceProperty[] |
getSourceProperties(Source source)
Iterates over the configured set of properties to handle, for each property calls doGetSourceProperty() ,
and returns the list of properties thus obtained. |
SourceProperty |
getSourceProperty(Source source,
String namespace,
String name)
Checks if this inspector is configured to handle the requested property and if so forwards the call to doGetSourceProperty . |
boolean |
handlesProperty(String namespace,
String name)
Check if this inspector is configured to handle properties of the given type. |
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 |
Methods inherited from interface org.apache.cocoon.components.source.SourceInspector |
---|
getValidity |
Constructor Detail |
---|
public AbstractConfigurableSourceInspector()
Method Detail |
---|
public void configure(Configuration configuration) throws ConfigurationException
Configuration is in the form of a set of property elements as follows:
<property name="owner" namespace="meta">
configure
in interface Configurable
ConfigurationException
public SourceProperty[] getSourceProperties(Source source) throws SourceException
doGetSourceProperty()
,
and returns the list of properties thus obtained. Subclasses
may want to overide this behavior to improve performance.
getSourceProperties
in interface SourceInspector
source
- the Source for wich to compute the property.
SourceException
public final SourceProperty getSourceProperty(Source source, String namespace, String name) throws SourceException
doGetSourceProperty
.
getSourceProperty
in interface SourceInspector
source
- the source for which to compute the propertynamespace
- the namespace of the propertyname
- the name of the property
null
if the inspector does not provide this property.
SourceException
protected abstract SourceProperty doGetSourceProperty(Source source, String ns, String name) throws SourceException
SourceException
public final boolean handlesProperty(String namespace, String name)
handlesProperty
in interface SourceInspector
namespace
- the namespace of the propertyname
- the name of the property
true
if this inspector handles properties of the given type
else false
.protected final Set getPropertyTypes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |