tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1637892 - /tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java
Date Mon, 10 Nov 2014 15:39:46 GMT
Author: markt
Date: Mon Nov 10 15:39:46 2014
New Revision: 1637892

URL: http://svn.apache.org/r1637892
Log:
Add a utility method that will make it easier to get the StringManager for a given class.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java?rev=1637892&r1=1637891&r2=1637892&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Mon Nov 10 15:39:46 2014
@@ -180,6 +180,19 @@ public class StringManager {
 
 
     /**
+     * Get the StringManager for a given class. The StringManager will be
+     * returned for the package in which the class is located. If a manager for
+     * that package already exists, it will be reused, else a new
+     * StringManager will be created and returned.
+     *
+     * @param clazz The class for which to retrieve the StringManager
+     */
+    public static final StringManager getManager(Class<?> clazz) {
+        return getManager(clazz.getPackage().getName());
+    }
+
+
+    /**
      * Get the StringManager for a particular package. If a manager for
      * a package already exists, it will be reused, else a new
      * StringManager will be created and returned.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message