Package org.xwiki.component.descriptor
Class DefaultComponentDependency<T>
- java.lang.Object
-
- org.xwiki.component.descriptor.DefaultComponentRole<T>
-
- org.xwiki.component.descriptor.DefaultComponentDependency<T>
-
- Type Parameters:
T
- the type of the component role
- All Implemented Interfaces:
ComponentDependency<T>
,ComponentRole<T>
public class DefaultComponentDependency<T> extends DefaultComponentRole<T> implements ComponentDependency<T>
Default implementation ofComponentDependency
.- Since:
- 1.7M1
- Version:
- $Id: 48cacebd9c41fa60ea87356d689705c79824faf3 $
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentDependency()
Default constructor.DefaultComponentDependency(ComponentDependency<T> dependency)
Create a new DefaultComponentDependency by cloning the providedComponentDependency
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object object)
String[]
getHints()
Class<?>
getMappingType()
Deprecated.String
getName()
Class<T>
getRole()
int
hashCode()
void
setHints(String[] hints)
void
setMappingType(Class<?> mappingType)
Deprecated.since 4.0M1 useDefaultComponentRole.setRoleType(java.lang.reflect.Type)
insteadvoid
setName(String name)
void
setRole(Class<T> role)
-
Methods inherited from class org.xwiki.component.descriptor.DefaultComponentRole
getRoleHint, getRoleType, setRoleHint, setRoleType, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.xwiki.component.descriptor.ComponentRole
getRoleHint, getRoleType
-
-
-
-
Constructor Detail
-
DefaultComponentDependency
public DefaultComponentDependency()
Default constructor.
-
DefaultComponentDependency
public DefaultComponentDependency(ComponentDependency<T> dependency)
Create a new DefaultComponentDependency by cloning the providedComponentDependency
.- Parameters:
dependency
- the component dependency to clone- Since:
- 3.4M1
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceComponentDependency<T>
- Returns:
- the name of the injection point (can be the name of the field for field injection or the name of the method for method injection
-
getHints
public String[] getHints()
- Specified by:
getHints
in interfaceComponentDependency<T>
- Returns:
- a list of hints used when the mapping type is a collection or map so that only component implementations matching passed hints are injected
-
setName
public void setName(String name)
- Parameters:
name
- the name of the injection point (can be the name of the field for field injection or the name of the method for method injection
-
setHints
public void setHints(String[] hints)
- Parameters:
hints
- a list of hints used when the mapping type is a collection or map so that only component implementations matching passed hints are injected
-
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
-
getMappingType
@Deprecated public Class<?> getMappingType()
Deprecated.- Specified by:
getMappingType
in interfaceComponentDependency<T>
- Returns:
- the class of the type for the injection (java.lang.String, java.util.List, etc)
-
setMappingType
@Deprecated public void setMappingType(Class<?> mappingType)
Deprecated.since 4.0M1 useDefaultComponentRole.setRoleType(java.lang.reflect.Type)
instead- Parameters:
mappingType
- the class of the type for the injection (java.lang.String, java.util.List, etc)
-
getRole
public Class<T> getRole()
- Specified by:
getRole
in interfaceComponentRole<T>
- Overrides:
getRole
in classDefaultComponentRole<T>
- Returns:
- the class of the component role
-
setRole
public void setRole(Class<T> role)
- Overrides:
setRole
in classDefaultComponentRole<T>
- Parameters:
role
- the class of the component role
-
-