1 | |
package com.lexicalscope.fluentreflection; |
2 | |
|
3 | |
import static ch.lambdaj.Lambda.convert; |
4 | |
import static java.util.Collections.unmodifiableList; |
5 | |
|
6 | |
import java.util.List; |
7 | |
|
8 | |
import com.google.inject.TypeLiteral; |
9 | |
|
10 | |
final class ReflectedConstructorsImpl<T> implements ReflectedConstructors<T> { |
11 | |
private final ReflectedTypeFactory reflectedTypeFactory; |
12 | |
private final TypeLiteral<T> typeLiteral; |
13 | |
|
14 | 14584 | public ReflectedConstructorsImpl(final ReflectedTypeFactory reflectedTypeFactory, final TypeLiteral<T> typeLiteral) { |
15 | 14584 | this.reflectedTypeFactory = reflectedTypeFactory; |
16 | 14584 | this.typeLiteral = typeLiteral; |
17 | 14584 | } |
18 | |
|
19 | |
@Override public List<FluentConstructor<T>> constructors() { |
20 | 74 | return unmodifiableList(convert( |
21 | 74 | typeLiteral.getRawType().getConstructors(), |
22 | 148 | new ConvertConstructorToReflectedConstructor<T>( |
23 | 74 | reflectedTypeFactory, typeLiteral))); |
24 | |
} |
25 | |
} |