@Test public void test_view() { FactoryTreeBuilder<ExampleLiveObjectB,ExampleFactoryViewRootFactory> builder = new FactoryTreeBuilder<>(ExampleFactoryViewRootFactory.class); builder.addFactory(ExampleViewFactory.class, Scope.PROTOTYPE); builder.addFactory(ExamplDummyFactory.class, Scope.PROTOTYPE); ExampleFactoryViewRootFactory root = builder.buildTreeUnvalidated(); System.out.println(ObjectMapperBuilder.build().writeValueAsString(root)); FactoryTreeBuilderBasedAttributeSetup<ExampleFactoryViewRootFactory> factoryTreeBuilderBasedAttributeSetup = new FactoryTreeBuilderBasedAttributeSetup<>(builder); factoryTreeBuilderBasedAttributeSetup.applyToRootFactoryDeep(root); List<ExampleViewFactory> exampleViewFactories = root.referenceAttributeViewFactory.internal_createNewPossibleValues(FactoryMetadataManager.getMetadata(ExampleFactoryViewRootFactory.class).getAttributeMetadata(f->f.referenceAttributeViewFactory)); }
public void applyToRootFactoryDeep(R root) { root.internal().serFactoryTreeBuilderBasedAttributeSetupForRoot(this); root.internal().setFactoryTreeBuilder(this.factoryTreeBuilder); factoryTreeBuilder.fillFromExistingFactoryTree(root); root.internal().collectChildrenDeep().forEach(data -> { data.internal().visitAttributesFlat(this::applyToAttribute); }); }
FactoryTreeBuilderBasedAttributeSetup { public void applyToRootFactoryDeep(R root) { root.internal().serFactoryTreeBuilderBasedAttributeSetupForRoot(this); root.internal().setFactoryTreeBuilder(this.factoryTreeBuilder); factoryTreeBuilder.fillFromExistingFactoryTree(root); root.internal().collectChildrenDeep().forEach(data -> { data.internal().visitAttributesFlat(this::applyToAttribute); }); } }
FactoryTreeBuilderBasedAttributeSetup { public void applyToRootFactoryDeep(R root) { root.internal().serFactoryTreeBuilderBasedAttributeSetupForRoot(this); root.internal().setFactoryTreeBuilder(this.factoryTreeBuilder); factoryTreeBuilder.fillFromExistingFactoryTree(root); root.internal().collectChildrenDeep().forEach(data -> { data.internal().visitAttributesFlat(this::applyToAttribute); }); } FactoryTreeBuilderBasedAttributeSetup(FactoryTreeBuilder<?,R> factoryTreeBuilder); }
FactoryTreeBuilderBasedAttributeSetup { public void applyToRootFactoryDeep(R root) { root.internal().serFactoryTreeBuilderBasedAttributeSetupForRoot(this); root.internal().setFactoryTreeBuilder(this.factoryTreeBuilder); factoryTreeBuilder.fillFromExistingFactoryTree(root); root.internal().collectChildrenDeep().forEach(data -> { data.internal().visitAttributesFlat(this::applyToAttribute); }); } FactoryTreeBuilderBasedAttributeSetup(FactoryTreeBuilder<?,R> factoryTreeBuilder); @SuppressWarnings("unchecked") List<FO> createNewFactory(Class<LO> liveObjectClass); void applyToRootFactoryDeep(R root); }
FactoryTreeBuilderBasedAttributeSetup { public void applyToRootFactoryDeep(R root) { root.internal().serFactoryTreeBuilderBasedAttributeSetupForRoot(this); root.internal().setFactoryTreeBuilder(this.factoryTreeBuilder); factoryTreeBuilder.fillFromExistingFactoryTree(root); root.internal().collectChildrenDeep().forEach(data -> { data.internal().visitAttributesFlat(this::applyToAttribute); }); } FactoryTreeBuilderBasedAttributeSetup(FactoryTreeBuilder<?,R> factoryTreeBuilder); @SuppressWarnings("unchecked") List<FO> createNewFactory(Class<LO> liveObjectClass); void applyToRootFactoryDeep(R root);  }