Package com.google.inject.assistedinject
Class AssistedConstructor<T>
- java.lang.Object
-
- com.google.inject.assistedinject.AssistedConstructor<T>
-
class AssistedConstructor<T> extends java.lang.Object
Internal respresentation of a constructor annotated withAssistedInject
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Parameter>
allParameters
private ParameterListKey
assistedParameters
private java.lang.reflect.Constructor<T>
constructor
-
Constructor Summary
Constructors Modifier Constructor Description private
AssistedConstructor(java.lang.reflect.Constructor<T> constructor, java.util.List<TypeLiteral<?>> parameterTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AssistedConstructor<T>
create(java.lang.reflect.Constructor<T> constructor, java.util.List<TypeLiteral<?>> parameterTypes)
java.util.List<Parameter>
getAllParameters()
ParameterListKey
getAssistedParameters()
Returns theParameterListKey
for this constructor.java.util.Set<java.lang.Class<?>>
getDeclaredExceptions()
T
newInstance(java.lang.Object[] args)
Returns an instance of T, constructed using this constructor, with the supplied arguments.java.lang.String
toString()
-
-
-
Field Detail
-
constructor
private final java.lang.reflect.Constructor<T> constructor
-
assistedParameters
private final ParameterListKey assistedParameters
-
allParameters
private final java.util.List<Parameter> allParameters
-
-
Constructor Detail
-
AssistedConstructor
private AssistedConstructor(java.lang.reflect.Constructor<T> constructor, java.util.List<TypeLiteral<?>> parameterTypes)
-
-
Method Detail
-
create
public static <T> AssistedConstructor<T> create(java.lang.reflect.Constructor<T> constructor, java.util.List<TypeLiteral<?>> parameterTypes)
-
getAssistedParameters
public ParameterListKey getAssistedParameters()
Returns theParameterListKey
for this constructor. TheParameterListKey
is created from the ordered list ofAssisted
constructor parameters.
-
getAllParameters
public java.util.List<Parameter> getAllParameters()
-
getDeclaredExceptions
public java.util.Set<java.lang.Class<?>> getDeclaredExceptions()
-
newInstance
public T newInstance(java.lang.Object[] args) throws java.lang.Throwable
Returns an instance of T, constructed using this constructor, with the supplied arguments.- Throws:
java.lang.Throwable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-