org.xwiki.component.descriptor
Class DefaultComponentDependency<T>

java.lang.Object
  extended by org.xwiki.component.descriptor.DefaultComponentRole<T>
      extended by 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 of ComponentDependency.

Since:
1.7M1
Version:
$Id: a22adff1182cfd0260efafc0818ecc494f8f2b64 $

Constructor Summary
DefaultComponentDependency()
          Default constructor.
DefaultComponentDependency(ComponentDependency<T> dependency)
          Create a new DefaultComponentDependency by cloning the provided ComponentDependency.
 
Method Summary
 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 use DefaultComponentRole.setRoleType(java.lang.reflect.Type) instead
 void 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 provided ComponentDependency.

Parameters:
dependency - the component dependency to clone
Since:
3.4M1
Method Detail

getName

public String getName()
Specified by:
getName in interface ComponentDependency<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 interface ComponentDependency<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 class DefaultComponentRole<T>
Since:
3.3M1

hashCode

public int hashCode()

Overrides:
hashCode in class DefaultComponentRole<T>
Since:
3.3M1

getMappingType

@Deprecated
public Class<?> getMappingType()
Deprecated. 

Specified by:
getMappingType in interface ComponentDependency<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 use DefaultComponentRole.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 interface ComponentRole<T>
Overrides:
getRole in class DefaultComponentRole<T>
Returns:
the class of the component role

setRole

public void setRole(Class<T> role)
Overrides:
setRole in class DefaultComponentRole<T>
Parameters:
role - the class of the component role


Copyright © 2004–2013 XWiki. All rights reserved.