All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.qute.runtime.MessageBundleRecorder Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.qute.runtime;

import java.util.Map;
import java.util.function.Supplier;

import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class MessageBundleRecorder {

    public Supplier createContext(Map messageTemplates,
            Map>> bundleInterfaces) {
        return new Supplier() {

            @Override
            public Object get() {
                return new BundleContext() {

                    @Override
                    public Map getMessageTemplates() {
                        return messageTemplates;
                    }

                    @Override
                    public Map>> getBundleInterfaces() {
                        return bundleInterfaces;
                    }
                };
            }
        };
    }

    public interface BundleContext {

        // message id -> message template
        Map getMessageTemplates();

        // bundle -> (locale -> interface class)
        Map>> getBundleInterfaces();

    }
}