use of org.simpleflatmapper.reflect.ConstructorNotFoundException in project SimpleFlatMapper by arnaudroger.
the class TupleClassMetaTest method failOnNoConstructorMatchingType.
@Test
public void failOnNoConstructorMatchingType() {
Type type = new TypeReference<MyTuple<String, String>>() {
}.getType();
try {
new TupleClassMeta<MyTuple<String, String>>(type, ReflectionService.newInstance());
fail();
} catch (ConstructorNotFoundException e) {
// expect
}
}
use of org.simpleflatmapper.reflect.ConstructorNotFoundException in project SimpleFlatMapper by arnaudroger.
the class TupleClassMeta method getInstantiatorDefinition.
private InstantiatorDefinition getInstantiatorDefinition(Type type, ReflectionService reflectionService) throws java.io.IOException {
final List<InstantiatorDefinition> definitions = reflectionService.extractInstantiator(type);
ListIterator<InstantiatorDefinition> iterator = definitions.listIterator();
while (iterator.hasNext()) {
final InstantiatorDefinition definition = iterator.next();
if (isTupleConstructor(type, definition)) {
return respecifyParameterNames((ExecutableInstantiatorDefinition) definition);
}
}
throw new ConstructorNotFoundException("Cannot find eligible tuple constructor definition for " + type);
}
Aggregations