Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » components » [javadoc | source]
org.apache.cocoon.components
public class: ExtendedComponentSelector [javadoc | source]
java.lang.Object
   org.apache.avalon.excalibur.component.ExcaliburComponentSelector
      org.apache.cocoon.components.ExtendedComponentSelector

All Implemented Interfaces:
    ParentAware

Direct Known Subclasses:
    ComponentsSelector

An extension of ExcaliburComponentSelector that can have a parent and accepts a wider variety of configurations.
Field Summary
protected  RoleManager roles    The role manager 
protected  ExtendedComponentSelector parentSelector    The parent selector, if any 
protected  ComponentLocator parentLocator    The parent locator, if any 
protected  ClassLoader classLoader    The class loader to use 
protected  String roleName    The role of this selector. Set in configure()
protected  String defaultHint    The default hint 
Constructor:
 public ExtendedComponentSelector() 
 public ExtendedComponentSelector(ClassLoader loader) 
    Create the ComponentSelector with a ClassLoader
Method from org.apache.cocoon.components.ExtendedComponentSelector Summary:
canRelease,   configure,   dispose,   getClassAttributeName,   getComponentInstanceName,   getDefaultHint,   getDefaultHintAttributeName,   getRoleName,   hasComponent,   hasDeclaredComponent,   release,   select,   setParentLocator,   setRoleManager
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.components.ExtendedComponentSelector Detail:
 protected boolean canRelease(Component component) 
 public  void configure(Configuration config) throws ConfigurationException 
    Configure this selector. This is the main difference with the parent class :
    • if #getComponentInstanceName() returns null, any child configurations having a attribute named as the result of #getClassAttributeName() , is considered as a component instance.
    • if #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.
 public  void dispose() 
 protected String getClassAttributeName() 
    Get the name of the attribute giving the class name of a component. The default here is "class", but this can be overriden in subclasses.
 protected String getComponentInstanceName() 
    Get the name for component-instance elements (i.e. components not defined by their role shortcut. If null, any element having a 'class' attribute will be considered as a component instance.

    The default here is to return null, and subclasses can redefine this method to return particular values.

 public String getDefaultHint() 
    Get the default hint, if any for this selector.
 protected String getDefaultHintAttributeName() 
    Get the name of the attribute giving the default hint to use if none is given. The default here is "default", but this can be overriden in subclasses. If this method returns null, no default hint can be specified.
 protected String getRoleName(Configuration config) 
    Get the role name for this selector. This is called by configure() to set the value of this.roleName.
 public boolean hasComponent(Object hint) 
    Does this selector or its parent have the given hint ?
 protected boolean hasDeclaredComponent(Object hint) 
    Does this selector declare a given hint? Check is performed on the components declared for this selector only, and not those potentially inherited from the parent selector.
 public  void release(Component component) 
 public Component select(Object hint) throws ComponentException 
 public  void setParentLocator(ComponentLocator locator) throws ComponentException 
 public  void setRoleManager(RoleManager roles) 
    Configure the RoleManager. Redeclared only because parent member is private.