Revision: 1020
          http://stripes.svn.sourceforge.net/stripes/?rev=1020&view=rev
Author:   bengunter
Date:     2008-12-23 16:26:31 +0000 (Tue, 23 Dec 2008)

Log Message:
-----------
Applied fix for STS-597 from trunk

Modified Paths:
--------------
    
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java

Modified: 
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
===================================================================
--- 
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
        2008-12-23 16:24:56 UTC (rev 1019)
+++ 
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
        2008-12-23 16:26:31 UTC (rev 1020)
@@ -522,21 +522,35 @@
     }
 
     /**
-     * Parse a binding pattern and create a {...@link UrlBinding} object.
+     * Look for a binding pattern for the given {...@link ActionBean} class, 
specified by the
+     * {...@link net.sourceforge.stripes.action.UrlBinding} annotation. If the 
annotation is found,
+     * create and return a {...@link UrlBinding} object for the class. 
Otherwise, return null.
      * 
-     * @param beanType the {...@link ActionBean} type whose binding is to be 
parsed
-     * @return a {...@link UrlBinding}
-     * @throws ParseException if the pattern cannot be parsed
+     * @param beanType The {...@link ActionBean} type whose binding is to be 
parsed
+     * @return A {...@link UrlBinding} if one is specified, or null if not.
+     * @throws ParseException If the pattern cannot be parsed
      */
-    protected static UrlBinding parseUrlBinding(Class<? extends ActionBean> 
beanType) {
+    public static UrlBinding parseUrlBinding(Class<? extends ActionBean> 
beanType) {
         // check that class is annotated
         net.sourceforge.stripes.action.UrlBinding annotation = beanType
                 
.getAnnotation(net.sourceforge.stripes.action.UrlBinding.class);
         if (annotation == null)
             return null;
+        else
+            return parseUrlBinding(beanType, annotation.value());
+    }
 
+    /**
+     * Parse the binding pattern and create a {...@link UrlBinding} object for 
the {...@link ActionBean}
+     * class. If pattern is null or zero-length, then return null.
+     * 
+     * @param beanType The {...@link ActionBean} type to be mapped to the 
pattern.
+     * @param pattern The URL binding pattern to parse.
+     * @return A {...@link UrlBinding} or null if the pattern is null or 
zero-length
+     * @throws ParseException If the pattern cannot be parsed
+     */
+    public static UrlBinding parseUrlBinding(Class<? extends ActionBean> 
beanType, String pattern) {
         // check that value is not null or empty
-        String pattern = annotation.value();
         if (pattern == null || pattern.length() < 1)
             return null;
 
@@ -624,7 +638,7 @@
      * @return a parameter object
      * @throws ParseException if the pattern cannot be parsed
      */
-    protected static UrlBindingParameter parseUrlBindingParameter(
+    public static UrlBindingParameter parseUrlBindingParameter(
             Class<? extends ActionBean> beanClass, String string) {
         char[] chars = string.toCharArray();
         char c = 0;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to