@Override
    public <A, B> Optional<Meta<A, B>> transform(Transform<A, B> transform, A model, TransformFactory factory) {
        requireNonNulls(transform, model, factory);

        final RenderTree.Builder parent = renderTreeBuilder.peek();
        final RenderTree.Builder branch = RenderTree.builder();
        
        renderTreeBuilder.push(branch);
        renderStack.push(model);
        
        final Optional<Meta<A, B>> meta = transform
            .transform(this, model)
            .map(s -> Meta.builder(model, s)
                .withTransform(transform)
                .withFactory(factory)
                .withRenderTree(branch.build())
                .withRenderStack(new DefaultRenderStack(renderStack))
                .build()
        );
        
        meta.ifPresent(parent::withBranch);
        
        renderStack.pop();
        renderTreeBuilder.pop();
        
        return meta;
    }
Creates a new generator.

@param mgr      the dependency manager to use
@param factory  the factory to use
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/GeneratorImpl.java