Package org.xwiki.component.descriptor
Class DefaultComponentDescriptor<T>
- java.lang.Object
-
- org.xwiki.component.descriptor.DefaultComponentRole<T>
-
- org.xwiki.component.descriptor.DefaultComponentDescriptor<T>
-
- Type Parameters:
T
- the type of the component role
- All Implemented Interfaces:
ComponentDescriptor<T>
,ComponentRole<T>
public class DefaultComponentDescriptor<T> extends DefaultComponentRole<T> implements ComponentDescriptor<T>
Default implementation ofComponentDescriptor
.- Since:
- 1.7M1
- Version:
- $Id: c710f126634dfd8c5630fd345bef62f06b3b59bd $
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentDescriptor()
Default constructor.DefaultComponentDescriptor(ComponentDescriptor<T> descriptor)
Creating a newDefaultComponentDescriptor
by cloning the providedComponentDescriptor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <D> void
addComponentDependency(Class<D> role, String roleHint)
void
addComponentDependency(ComponentDependency<?> componentDependency)
boolean
equals(Object object)
Collection<ComponentDependency<?>>
getComponentDependencies()
Class<? extends T>
getImplementation()
ComponentInstantiationStrategy
getInstantiationStrategy()
int
hashCode()
void
setImplementation(Class<? extends T> implementation)
void
setInstantiationStrategy(ComponentInstantiationStrategy instantiationStrategy)
String
toString()
-
Methods inherited from class org.xwiki.component.descriptor.DefaultComponentRole
getRole, getRoleHint, getRoleType, setRole, setRoleHint, setRoleType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.xwiki.component.descriptor.ComponentRole
getRole, getRoleHint, getRoleType
-
-
-
-
Constructor Detail
-
DefaultComponentDescriptor
public DefaultComponentDescriptor()
Default constructor.
-
DefaultComponentDescriptor
public DefaultComponentDescriptor(ComponentDescriptor<T> descriptor)
Creating a newDefaultComponentDescriptor
by cloning the providedComponentDescriptor
.- Parameters:
descriptor
- the component descriptor to clone- Since:
- 3.4M1
-
-
Method Detail
-
setImplementation
public void setImplementation(Class<? extends T> implementation)
- Parameters:
implementation
- the class of the component implementation
-
getImplementation
public Class<? extends T> getImplementation()
- Specified by:
getImplementation
in interfaceComponentDescriptor<T>
- Returns:
- the class of the component implementation
-
setInstantiationStrategy
public void setInstantiationStrategy(ComponentInstantiationStrategy instantiationStrategy)
- Parameters:
instantiationStrategy
- the way the component should be instantiated- See Also:
ComponentInstantiationStrategy
-
getInstantiationStrategy
public ComponentInstantiationStrategy getInstantiationStrategy()
- Specified by:
getInstantiationStrategy
in interfaceComponentDescriptor<T>
- Returns:
- the way the component should be instantiated
- See Also:
ComponentInstantiationStrategy
-
getComponentDependencies
public Collection<ComponentDependency<?>> getComponentDependencies()
- Specified by:
getComponentDependencies
in interfaceComponentDescriptor<T>
- Returns:
- the components on which this component depends
-
addComponentDependency
public void addComponentDependency(ComponentDependency<?> componentDependency)
- Parameters:
componentDependency
- the dependency to add
-
addComponentDependency
public <D> void addComponentDependency(Class<D> role, String roleHint)
- Type Parameters:
D
- the type of the dependency role- Parameters:
role
- the class of the component roleroleHint
- the hint of the component role
-
toString
public String toString()
- Overrides:
toString
in classDefaultComponentRole<T>
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classDefaultComponentRole<T>
- Since:
- 3.3M1
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultComponentRole<T>
- Since:
- 3.3M1
-
-