| Total Complexity | 3 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.hltech.pact.gen.domain.client.annotation; |
||
| 10 | @RequiredArgsConstructor |
||
| 11 | public class MappingHandlerFactory { |
||
| 12 | |||
| 13 | private static final String PACKAGE = "com.hltech.pact.gen"; |
||
| 14 | |||
| 15 | private final HandlersFactory handlersFactory; |
||
| 16 | |||
| 17 | public List<AnnotatedMethodHandler> createAll() { |
||
| 18 | try { |
||
| 19 | return handlersFactory.createHandlers(findClasses()); |
||
| 20 | } catch (IllegalAccessException | InstantiationException exception) { |
||
| 21 | throw new MappingMethodCreationException("Cannot create mapping handler", exception); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | private List<Class<?>> findClasses() { |
||
| 26 | return Lists.newArrayList(new Reflections(PACKAGE).getTypesAnnotatedWith(MappingMethodHandler.class)); |
||
| 27 | } |
||
| 29 |