@Test @Deprecated public void testCreateUiComponent_NoLayoutDefinition() { TestSectionPmo testSectionPmo = new TestSectionPmo(); BindingContext bindingContext = new BindingContext(); @SuppressWarnings("deprecation") ComponentWrapper componentWrapper = UiCreator.createComponent(testSectionPmo, bindingContext, c -> Optional .of(TestLinkkiComponentDefinition .create(TestUiLayoutComponent::new)), c -> Optional.empty()); assertThat(componentWrapper.getComponent(), is(instanceOf(TestUiLayoutComponent.class))); TestUiLayoutComponent testUiLayoutComponent = (TestUiLayoutComponent)componentWrapper.getComponent(); assertThat(testUiLayoutComponent.getId(), is(testSectionPmo.getId())); assertThat(bindingContext.getBindings(), hasSize(1)); Binding binding = bindingContext.getBindings().iterator().next(); assertThat(binding.getBoundComponent(), is(componentWrapper.getComponent())); assertThat(binding, is(not(instanceOf(BindingContext.class)))); }
public static ComponentWrapper createComponent(Object pmo, BindingContext bindingContext) { return createComponent(pmo, bindingContext, ComponentAnnotationReader::findComponentDefinition, LayoutAnnotationReader::findLayoutDefinition); }
UiCreator { public static ComponentWrapper createComponent(Object pmo, BindingContext bindingContext) { return createComponent(pmo, bindingContext, ComponentAnnotationReader::findComponentDefinition, LayoutAnnotationReader::findLayoutDefinition); } }
UiCreator { public static ComponentWrapper createComponent(Object pmo, BindingContext bindingContext) { return createComponent(pmo, bindingContext, ComponentAnnotationReader::findComponentDefinition, LayoutAnnotationReader::findLayoutDefinition); } private  UiCreator(); }
UiCreator { public static ComponentWrapper createComponent(Object pmo, BindingContext bindingContext) { return createComponent(pmo, bindingContext, ComponentAnnotationReader::findComponentDefinition, LayoutAnnotationReader::findLayoutDefinition); } 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 ComponentWrapper createComponent(Object pmo, BindingContext bindingContext) { return createComponent(pmo, bindingContext, ComponentAnnotationReader::findComponentDefinition, LayoutAnnotationReader::findLayoutDefinition); } 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);  }