Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1
    • Component/s: Core
    • Labels:
      None

      Description

      e.g.:

      @Bundle //without #name it will be mapped by convention
      public interface MyConfig
      {
      @Named("value1")
      public class MyValue1 implements BundleKey, MyConfig {}

      public class MyValue2 implements BundleKey, MyConfig {}
      }

      usage:

      @Inject
      @Bundle(MyConfig.class)
      private ResourceBundle resourceBundle;
      //...
      this.resourceBundle.getValue(MyConfig.MyValue2.class);

      @Produces
      @MyConfig
      protected org.apache.myfaces.extensions.cdi.core.api.ResourceBundle createConfig(org.apache.myfaces.extensions.cdi.core.api.ResourceBundle injectableResourceBundle)

      { return injectableResourceBundle.useBundle("my.custom.bundle"); }

      or

      @Produces
      @MyLabels
      protected org.apache.myfaces.extensions.cdi.core.api.ResourceBundle createLabels(@Jsf org.apache.myfaces.extensions.cdi.core.api.ResourceBundle injectableResourceBundle) { return injectableResourceBundle.useBundle("my.custom.bundle"); }

      ... to benefit from the existing local-resolver.

      usage:

      @Inject
      @MyLabels
      private ResourceBundle injectableResourceBundle;

      this.injectableResourceBundle.getValue("myKey");

      it would allow to inject resource-bundles in a type-safe manner and it should be a simple wrapper for java.util.ResourceBundle but without MissingResourceException.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development