Author: niallp
Date: Mon May 21 15:34:43 2007
New Revision: 540328

URL: http://svn.apache.org/viewvc?view=rev&rev=540328
Log:
Add getters for properties to Date and Number converters

Modified:
    
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
    
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java

Modified: 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java?view=diff&rev=540328&r1=540327&r2=540328
==============================================================================
--- 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
 (original)
+++ 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
 Mon May 21 15:34:43 2007
@@ -126,6 +126,16 @@
     }
 
     /**
+     * Return the Time Zone to use when converting dates
+     * (or <code>null</code> if none specified.
+     *
+     * @return The Time Zone.
+     */
+    public TimeZone getTimeZone() {
+        return timeZone;
+    }
+
+    /**
      * Set the Time Zone to use when converting dates.
      *
      * @param timeZone The Time Zone.
@@ -135,6 +145,16 @@
     }
 
     /**
+     * Return the Locale for the <i>Converter</i>
+     * (or <code>null</code> if none specified).
+     *
+     * @return The locale to use for conversion
+     */
+    public Locale getLocale() {
+        return locale;
+    }
+
+    /**
      * Set the Locale for the <i>Converter</i>.
      *
      * @param locale The Locale.
@@ -153,6 +173,18 @@
      */
     public void setPattern(String pattern) {
         setPatterns(new String[] {pattern});
+    }
+
+    /**
+     * Return the date format patterns used to convert
+     * dates to/from a <code>java.lang.String</code>
+     * (or <code>null</code> if none specified).
+     *
+     * @see SimpleDateFormat
+     * @return Array of format patterns.
+     */
+    public String[] getPatterns() {
+        return patterns; 
     }
 
     /**

Modified: 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java?view=diff&rev=540328&r1=540327&r2=540328
==============================================================================
--- 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java
 (original)
+++ 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java
 Mon May 21 15:34:43 2007
@@ -125,6 +125,15 @@
     // --------------------------------------------------------- Public Methods
 
     /**
+     * Return whether decimals are allowed in the number.
+     *
+     * @return Whether decimals are allowed in the number
+     */
+    public boolean isAllowDecimals() {
+        return allowDecimals;
+    }
+
+    /**
      * Set whether a format should be used to convert
      * the Number.
      *
@@ -136,6 +145,20 @@
     }
 
     /**
+     * Return the number format pattern used to convert
+     * Numbers to/from a <code>java.lang.String</code>
+     * (or <code>null</code> if none specified).
+     * <p>
+     * See <code>java.text.SimpleDateFormat</code> for details
+     * of how to specify the pattern.
+     *
+     * @return The format pattern.
+     */
+    public String getPattern() {
+        return pattern;
+    }
+
+    /**
      * Set a number format pattern to use to convert
      * Numbers to/from a <code>java.lang.String</code>.
      * <p>
@@ -150,9 +173,19 @@
     }
 
     /**
+     * Return the Locale for the <i>Converter</i>
+     * (or <code>null</code> if none specified).
+     *
+     * @return The locale to use for conversion
+     */
+    public Locale getLocale() {
+        return locale;
+    }
+
+    /**
      * Set the Locale for the <i>Converter</i>.
      *
-     * @param locale The default Locale.
+     * @param locale The locale to use for conversion
      */
     public void setLocale(Locale locale) {
         this.locale = locale;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to