public ProtoFileElement convert(T source) {
        DynamicSchemaConverter<T> converter = getConverter();

        Syntax syntax = ProtoConstants.PROTO3.equals(converter.getSyntax(source)) ?
            Syntax.PROTO_3 : Syntax.PROTO_2;

        String packageName = converter.getPackageName(source);

        ImmutableList.Builder<String> imports = ImmutableList.builder();
        imports.addAll(converter.getImports(source));

        ImmutableList.Builder<String> publicImports = ImmutableList.builder();
        publicImports.addAll(converter.getPublicImports(source));

        ImmutableList.Builder<TypeElement> types = ImmutableList.builder();
        types.addAll(converter.getTypes(source));

        ImmutableList.Builder<ServiceElement> services = ImmutableList.builder();
        services.addAll(converter.getServices(source));

        ImmutableList.Builder<OptionElement> options = ImmutableList.builder();
        options.addAll(converter.getOptions(source));

        return new ProtoFileElement(
            ProtoConstants.DEFAULT_LOCATION,
            packageName,
            syntax,
            imports.build(),
            publicImports.build(),
            types.build(),
            services.build(),
            Collections.emptyList(), // extends
            options.build()
        );
    }
Template method for converting protobuf schema representations
core/src/main/java/kafka/automq/table/deserializer/proto/parse/template/ProtoSchemaTemplate.java