Class DependencyMetaData
- java.lang.Object
-
- net.officefloor.plugin.managedobject.clazz.DependencyMetaData
-
- Direct Known Subclasses:
StatefulDependencyMetaData
public class DependencyMetaData extends java.lang.Object
Meta-data for aDependency
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DependencyMetaData.DependencyType
Type of dependency.
-
Field Summary
Fields Modifier and Type Field Description java.lang.reflect.Field
field
Field
to receive the injected dependency.int
index
Index of the dependency within theObjectRegistry
.java.lang.String
name
Name of the dependency.DependencyMetaData.DependencyType
type
Type of the dependency.
-
Constructor Summary
Constructors Constructor Description DependencyMetaData(java.lang.String name, int index, java.lang.reflect.Field field)
Initiate.DependencyMetaData(DependencyMetaData.DependencyType type, java.lang.reflect.Field field)
Initiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTypeQualifier()
Obtains the type qualifier for the dependency.static java.lang.String
getTypeQualifier(java.lang.String dependencyName, java.util.Collection<java.lang.annotation.Annotation> annotations)
Obtains the qualifier from the set ofAnnotation
instances.void
injectDependency(java.lang.Object object, java.lang.Object dependency)
Injects the dependency into the object.
-
-
-
Field Detail
-
type
public final DependencyMetaData.DependencyType type
Type of the dependency.
-
name
public final java.lang.String name
Name of the dependency. Only applicable ifDependencyMetaData.DependencyType.DEPENDENCY
.
-
index
public final int index
Index of the dependency within theObjectRegistry
. Only applicable ifDependencyMetaData.DependencyType.DEPENDENCY
.
-
field
public final java.lang.reflect.Field field
Field
to receive the injected dependency.
-
-
Constructor Detail
-
DependencyMetaData
public DependencyMetaData(DependencyMetaData.DependencyType type, java.lang.reflect.Field field)
Initiate.- Parameters:
type
-DependencyMetaData.DependencyType
.field
-Field
to receive the injected dependency.
-
DependencyMetaData
public DependencyMetaData(java.lang.String name, int index, java.lang.reflect.Field field)
Initiate.- Parameters:
name
- Name of the dependency.index
- Index of the dependency within theObjectRegistry
.field
-Field
to receive the injected dependency.
-
-
Method Detail
-
getTypeQualifier
public static java.lang.String getTypeQualifier(java.lang.String dependencyName, java.util.Collection<java.lang.annotation.Annotation> annotations) throws java.lang.Exception
Obtains the qualifier from the set ofAnnotation
instances.- Parameters:
dependencyName
- Name of the dependency.annotations
-Annotation
instances to interrogate for qualification.- Returns:
- Qualfiier. May be
null
if no qualifier. - Throws:
java.lang.Exception
-
getTypeQualifier
public java.lang.String getTypeQualifier() throws java.lang.Exception
Obtains the type qualifier for the dependency.- Returns:
- Type qualifier. May be
null
if no type qualifier. - Throws:
java.lang.Exception
- If fails to obtain the type qualifier.
-
injectDependency
public void injectDependency(java.lang.Object object, java.lang.Object dependency) throws java.lang.Exception
Injects the dependency into the object.- Parameters:
object
- Object to receive the dependency.dependency
- Dependency to inject.- Throws:
java.lang.Exception
- If fails to inject the dependency.
-
-