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