struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [15/24] struts git commit: Extends constructors to inject LocalizedTextUtil
Date Tue, 14 Mar 2017 18:36:08 GMT
Extends constructors to inject LocalizedTextUtil


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ca0f6292
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ca0f6292
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ca0f6292

Branch: refs/heads/master
Commit: ca0f62925ab6338823f454799f521208ed0dd6e7
Parents: f1a963b
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Mon Mar 13 09:10:19 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Mon Mar 13 09:10:19 2017 +0100

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/TextProviderFactory.java     | 11 +++++++++--
 .../com/opensymphony/xwork2/TextProviderSupport.java     |  6 ++++--
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/ca0f6292/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java b/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
index b00f451..43c6792 100644
--- a/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
+++ b/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
@@ -16,6 +16,7 @@
 package com.opensymphony.xwork2;
 
 import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.LocalizedTextUtil;
 
 import java.util.ResourceBundle;
 
@@ -29,6 +30,7 @@ public class TextProviderFactory {
 
     private TextProvider textProvider;
     private LocaleProvider localeProvider;
+    private LocalizedTextUtil localizedTextUtil;
 
     @Inject
     public void setTextProvider(TextProvider textProvider) {
@@ -40,6 +42,11 @@ public class TextProviderFactory {
         this.localeProvider = localeProvider;
     }
 
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
+
     public TextProvider createInstance(Class clazz) {
         TextProvider instance = getTextProvider(clazz);
         if (instance instanceof ResourceBundleTextProvider) {
@@ -60,7 +67,7 @@ public class TextProviderFactory {
 
     protected TextProvider getTextProvider(Class clazz) {
         if (this.textProvider == null) {
-            return new TextProviderSupport(clazz, localeProvider);
+            return new TextProviderSupport(clazz, localeProvider, localizedTextUtil);
         } else {
             return textProvider;
         }
@@ -68,7 +75,7 @@ public class TextProviderFactory {
 
     private TextProvider getTextProvider(ResourceBundle bundle) {
         if (this.textProvider == null) {
-            textProvider = new TextProviderSupport(bundle, localeProvider);
+            return new TextProviderSupport(bundle, localeProvider, localizedTextUtil);
         }
         return textProvider;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/ca0f6292/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java b/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
index ab37e92..98dd3d2 100644
--- a/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
@@ -47,9 +47,10 @@ public class TextProviderSupport implements ResourceBundleTextProvider
{
      * @param clazz    a clazz to use for reading the resource bundle.
      * @param provider a locale provider.
      */
-    public TextProviderSupport(Class clazz, LocaleProvider provider) {
+    public TextProviderSupport(Class clazz, LocaleProvider provider, LocalizedTextUtil localizedTextUtil)
{
         this.clazz = clazz;
         this.localeProvider = provider;
+        this.localizedTextUtil = localizedTextUtil;
     }
 
     /**
@@ -58,9 +59,10 @@ public class TextProviderSupport implements ResourceBundleTextProvider
{
      * @param bundle   the resource bundle.
      * @param provider a locale provider.
      */
-    public TextProviderSupport(ResourceBundle bundle, LocaleProvider provider) {
+    public TextProviderSupport(ResourceBundle bundle, LocaleProvider provider, LocalizedTextUtil
localizedTextUtil) {
         this.bundle = bundle;
         this.localeProvider = provider;
+        this.localizedTextUtil = localizedTextUtil;
     }
 
     /**


Mime
View raw message