org.apache.cocoon.components.treeprocessor.sitemap
Class ComponentsSelector
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLoggable
|
+--org.apache.avalon.excalibur.component.ExcaliburComponentSelector
|
+--org.apache.cocoon.components.ExtendedComponentSelector
|
+--org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector
- All Implemented Interfaces:
- org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.logger.LogKitManageable, OutputComponentSelector, org.apache.avalon.excalibur.component.RoleManageable, SitemapComponentSelector, org.apache.avalon.framework.thread.ThreadSafe
- public class ComponentsSelector
- extends ExtendedComponentSelector
- implements OutputComponentSelector, SitemapComponentSelector
Component selector for sitemap components.
- Version:
- CVS $Id: ComponentsSelector.java,v 1.1 2002/03/05 08:26:23 sylvain Exp $
- Author:
- Sylvain Wallez
Fields inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentSelector |
m_context |
Method Summary |
void |
addComponent(java.lang.Object hint,
java.lang.Class clazz,
org.apache.avalon.framework.configuration.Configuration config)
Add a component in this selector. |
void |
configure(org.apache.avalon.framework.configuration.Configuration config)
Configure this selector. |
protected java.lang.String |
getClassAttributeName()
Get the attribute for class names. |
protected java.lang.String |
getComponentInstanceName()
Return the component instance name according to the selector role
(e.g. |
java.lang.String[] |
getLabels(java.lang.Object hint)
|
java.lang.String |
getMimeTypeForHint(java.lang.Object hint)
Get the MIME type for a given hint. |
boolean |
hasLabel(java.lang.Object hint,
java.lang.String label)
|
void |
initialize()
Ensure system-defined components exist (e.g. |
void |
setParentSelector(org.apache.avalon.framework.component.ComponentSelector selector)
Set the parent of this selector. |
Methods inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentSelector |
addComponentInstance, compose, contextualize, dispose, hasComponent, setLogKitManager |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, 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.avalon.framework.component.ComponentSelector |
hasComponent, release, select |
UNKNOWN
public static final int UNKNOWN
GENERATOR
public static final int GENERATOR
TRANSFORMER
public static final int TRANSFORMER
SERIALIZER
public static final int SERIALIZER
READER
public static final int READER
MATCHER
public static final int MATCHER
SELECTOR
public static final int SELECTOR
ACTION
public static final int ACTION
SELECTOR_ROLES
public static final java.lang.String[] SELECTOR_ROLES
COMPONENT_NAMES
public static final java.lang.String[] COMPONENT_NAMES
ComponentsSelector
public ComponentsSelector()
setParentSelector
public void setParentSelector(org.apache.avalon.framework.component.ComponentSelector selector)
- Description copied from class:
ExtendedComponentSelector
- Set the parent of this selector. This can be done after the selector is
initialized, but only once. This allows this selector to be
created by a component manager while still being able to have a parent.
- Overrides:
setParentSelector
in class ExtendedComponentSelector
- Following copied from class:
org.apache.cocoon.components.ExtendedComponentSelector
- Parameters:
parent
- the parent selector- Throws:
java.lang.IllegalStateException
- if parent is already set
getComponentInstanceName
protected java.lang.String getComponentInstanceName()
- Return the component instance name according to the selector role
(e.g. "action" for "org.apache.cocoon.acting.Action").
- Overrides:
getComponentInstanceName
in class ExtendedComponentSelector
- Following copied from class:
org.apache.cocoon.components.ExtendedComponentSelector
- Returns:
null
, but can be changed by subclasses
getClassAttributeName
protected java.lang.String getClassAttributeName()
- Get the attribute for class names. This is "src" for known roles, and
"class" (the default) for other roles.
- Overrides:
getClassAttributeName
in class ExtendedComponentSelector
- Following copied from class:
org.apache.cocoon.components.ExtendedComponentSelector
- Returns:
- "
class
", but can be changed by subclasses
configure
public void configure(org.apache.avalon.framework.configuration.Configuration config)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Description copied from class:
ExtendedComponentSelector
- Configure this selector. This is the main difference with the parent class :
- if
ExtendedComponentSelector.getComponentInstanceName()
returns null
,
any child configurations having a attribute named as the result of
"getClassAttributeName(), is considered as a component instance.
- if
ExtendedComponentSelector.getComponentInstanceName()
returns a non-null value,
only child configurations having this name are considered as a
component instance.
- if other cases, it's name is considered to be a hint in the role manager.
The behaviour is then the same as
ExcaliburComponentSelector
.
- Overrides:
configure
in class ExtendedComponentSelector
- Following copied from class:
org.apache.cocoon.components.ExtendedComponentSelector
- Parameters:
config
- the configuration- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
- if some hints aren't defined
addComponent
public void addComponent(java.lang.Object hint,
java.lang.Class clazz,
org.apache.avalon.framework.configuration.Configuration config)
throws org.apache.avalon.framework.component.ComponentException
- Add a component in this selector. If needed, also register it's MIME type.
- Overrides:
addComponent
in class org.apache.avalon.excalibur.component.ExcaliburComponentSelector
initialize
public void initialize()
- Ensure system-defined components exist (e.g. !content-aggregator!) and initialize
the selector.
- Overrides:
initialize
in class org.apache.avalon.excalibur.component.ExcaliburComponentSelector
getMimeTypeForHint
public java.lang.String getMimeTypeForHint(java.lang.Object hint)
- Get the MIME type for a given hint.
- Specified by:
getMimeTypeForHint
in interface OutputComponentSelector
- Following copied from interface:
org.apache.cocoon.components.pipeline.OutputComponentSelector
- Parameters:
hint
- the component hint- Returns:
- the MIME type for this hint, or
null
.
hasLabel
public boolean hasLabel(java.lang.Object hint,
java.lang.String label)
- Specified by:
hasLabel
in interface SitemapComponentSelector
getLabels
public java.lang.String[] getLabels(java.lang.Object hint)
- Specified by:
getLabels
in interface SitemapComponentSelector
Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.