@Test public void testCreateUiElements() { TestSectionPmo testSectionPmo = new TestSectionPmo(); BindingContext bindingContext = new BindingContext(); List<TestComponentWrapper> wrappers = UiCreator .createUiElements(testSectionPmo, bindingContext, TestComponentWrapper::new) .collect(Collectors.toList()); assertThat(wrappers, hasSize(2)); List<String> componentIds = wrappers.stream().map(TestComponentWrapper::getComponent) .map(TestUiComponent::getId).collect(Collectors.toList()); assertThat(componentIds, contains(TestPmo.PROPERTY_VALUE, TestModelObject.PROPERTY_MODEL_PROP)); List<String> boundIds = bindingContext.getBindings().stream().map(Binding::getBoundComponent) .map(TestUiComponent.class::cast).map(TestUiComponent::getId).collect(Collectors.toList()); assertThat(boundIds, containsInAnyOrder(TestPmo.PROPERTY_VALUE, TestModelObject.PROPERTY_MODEL_PROP)); }
public static <C, W extends ComponentWrapper> Stream<W> createUiElements(Object pmo, BindingContext bindingContext, Function<C, W> componentWrapperCreator) { return ComponentAnnotationReader.getComponentDefinitionMethods(pmo.getClass()) .map(m -> createUiElement(m, pmo, bindingContext, componentWrapperCreator)); }
UiCreator { public static <C, W extends ComponentWrapper> Stream<W> createUiElements(Object pmo, BindingContext bindingContext, Function<C, W> componentWrapperCreator) { return ComponentAnnotationReader.getComponentDefinitionMethods(pmo.getClass()) .map(m -> createUiElement(m, pmo, bindingContext, componentWrapperCreator)); } }
UiCreator { public static <C, W extends ComponentWrapper> Stream<W> createUiElements(Object pmo, BindingContext bindingContext, Function<C, W> componentWrapperCreator) { return ComponentAnnotationReader.getComponentDefinitionMethods(pmo.getClass()) .map(m -> createUiElement(m, pmo, bindingContext, componentWrapperCreator)); } private  UiCreator(); }
UiCreator { public static <C, W extends ComponentWrapper> Stream<W> createUiElements(Object pmo, BindingContext bindingContext, Function<C, W> componentWrapperCreator) { return ComponentAnnotationReader.getComponentDefinitionMethods(pmo.getClass()) .map(m -> createUiElement(m, pmo, bindingContext, componentWrapperCreator)); } private  UiCreator(); static Stream<W> createUiElements(Object pmo,
            BindingContext bindingContext,
            Function<C, W> componentWrapperCreator); static W createUiElement(AnnotatedElement annotatedElement,
            Object pmo,
            BindingContext bindingContext,
            Function<C, W> componentWrapperCreator); static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext); @Deprecated @SuppressWarnings("overloads") static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext,
            Function<Class<?>, Optional<LinkkiComponentDefinition>> componentDefinitionFinder,
            Function<Class<?>, Optional<LinkkiLayoutDefinition>> layoutDefinitionFinder); @SuppressWarnings("overloads") static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext,
            LinkkiComponentDefinition componentDefinition,
            Optional<LinkkiLayoutDefinition> layoutDefinition); }
UiCreator { public static <C, W extends ComponentWrapper> Stream<W> createUiElements(Object pmo, BindingContext bindingContext, Function<C, W> componentWrapperCreator) { return ComponentAnnotationReader.getComponentDefinitionMethods(pmo.getClass()) .map(m -> createUiElement(m, pmo, bindingContext, componentWrapperCreator)); } private  UiCreator(); static Stream<W> createUiElements(Object pmo,
            BindingContext bindingContext,
            Function<C, W> componentWrapperCreator); static W createUiElement(AnnotatedElement annotatedElement,
            Object pmo,
            BindingContext bindingContext,
            Function<C, W> componentWrapperCreator); static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext); @Deprecated @SuppressWarnings("overloads") static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext,
            Function<Class<?>, Optional<LinkkiComponentDefinition>> componentDefinitionFinder,
            Function<Class<?>, Optional<LinkkiLayoutDefinition>> layoutDefinitionFinder); @SuppressWarnings("overloads") static ComponentWrapper createComponent(Object pmo,
            BindingContext bindingContext,
            LinkkiComponentDefinition componentDefinition,
            Optional<LinkkiLayoutDefinition> layoutDefinition);  }