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 booleanequals(Object object)String[]getHints()Class<?>getMappingType()Deprecated.StringgetName()Class<T>getRole()inthashCode()voidsetHints(String[] hints)voidsetMappingType(Class<?> mappingType)Deprecated.since 4.0M1 useDefaultComponentRole.setRoleType(java.lang.reflect.Type)insteadvoidsetName(String name)voidsetRole(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:
getNamein 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:
getHintsin 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:
equalsin classDefaultComponentRole<T>- Since:
- 3.3M1
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultComponentRole<T>- Since:
- 3.3M1
-
getMappingType
@Deprecated public Class<?> getMappingType()
Deprecated.- Specified by:
getMappingTypein 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:
getRolein interfaceComponentRole<T>- Overrides:
getRolein classDefaultComponentRole<T>- Returns:
- the class of the component role
-
setRole
public void setRole(Class<T> role)
- Overrides:
setRolein classDefaultComponentRole<T>- Parameters:
role- the class of the component role
-
-