You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ni...@apache.org on 2007/07/13 02:27:20 UTC
svn commit: r555824 [3/3] - in /jakarta/commons/proper/beanutils/trunk: ./
optional/bean-collections/src/java/
optional/bean-collections/src/java/org/apache/commons/beanutils/ src/java/
src/java/org/apache/commons/beanutils/ src/java/org/apache/commons...
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleBeanUtilsBean.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleBeanUtilsBean.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleBeanUtilsBean.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleBeanUtilsBean.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale;
@@ -49,25 +49,31 @@
* Contains <code>LocaleBeanUtilsBean</code> instances indexed by context classloader.
*/
private static final ContextClassLoaderLocal
- localeBeansByClassLoader = new ContextClassLoaderLocal() {
+ LOCALE_BEANS_BY_CLASSLOADER = new ContextClassLoaderLocal() {
// Creates the default instance used when the context classloader is unavailable
protected Object initialValue() {
return new LocaleBeanUtilsBean();
}
};
- /** Gets singleton instance */
+ /**
+ * Gets singleton instance
+ *
+ * @return the singleton instance
+ */
public static LocaleBeanUtilsBean getLocaleBeanUtilsInstance() {
- return (LocaleBeanUtilsBean)localeBeansByClassLoader.get();
+ return (LocaleBeanUtilsBean)LOCALE_BEANS_BY_CLASSLOADER.get();
}
/**
* Sets the instance which provides the functionality for {@link LocaleBeanUtils}.
* This is a pseudo-singleton - an single instance is provided per (thread) context classloader.
- * This mechanism provides isolation for web apps deployed in the same container.
+ * This mechanism provides isolation for web apps deployed in the same container.
+ *
+ * @param newInstance a new singleton instance
*/
public static void setInstance(LocaleBeanUtilsBean newInstance) {
- localeBeansByClassLoader.set(newInstance);
+ LOCALE_BEANS_BY_CLASSLOADER.set(newInstance);
}
/** All logging goes through this logger */
@@ -113,13 +119,18 @@
// --------------------------------------------------------- Public Methods
- /** Gets the bean instance used for conversions */
+ /**
+ * Gets the bean instance used for conversions
+ *
+ * @return the locale converter bean instance
+ */
public LocaleConvertUtilsBean getLocaleConvertUtils() {
return localeConvertUtils;
}
/**
* Gets the default Locale
+ * @return the default locale
*/
public Locale getDefaultLocale() {
@@ -128,7 +139,9 @@
/**
- * Sets the default Locale
+ * Sets the default Locale.
+ *
+ * @param locale the default locale
*/
public void setDefaultLocale(Locale locale) {
@@ -138,6 +151,9 @@
/**
* Is the pattern to be applied localized
* (Indicate whether the pattern is localized or not)
+ *
+ * @return <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
*/
public boolean getApplyLocalized() {
@@ -147,6 +163,9 @@
/**
* Sets whether the pattern is applied localized
* (Indicate whether the pattern is localized or not)
+ *
+ * @param newApplyLocalized <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
*/
public void setApplyLocalized(boolean newApplyLocalized) {
@@ -166,7 +185,8 @@
* @param bean Bean whose property is to be extracted
* @param name <code>propertyname[index]</code> of the property value
* to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The indexed property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -190,7 +210,7 @@
/**
* Return the value of the specified locale-sensitive indexed property
- * of the specified bean, as a String using the default convertion pattern of
+ * of the specified bean, as a String using the default conversion pattern of
* the corresponding {@link LocaleConverter}. The zero-relative index
* of the required value must be included (in square brackets) as a suffix
* to the property name, or <code>IllegalArgumentException</code> will be thrown.
@@ -198,6 +218,7 @@
* @param bean Bean whose property is to be extracted
* @param name <code>propertyname[index]</code> of the property value
* to be extracted
+ * @return The indexed property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -219,14 +240,15 @@
/**
* Return the value of the specified locale-sensetive indexed property
- * of the specified bean, as a String using the specified convertion pattern.
+ * of the specified bean, as a String using the specified conversion pattern.
* The index is specified as a method parameter and
* must *not* be included in the property name expression
*
* @param bean Bean whose property is to be extracted
* @param name Simple property name of the property value to be extracted
* @param index Index of the property value to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The indexed property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -246,7 +268,7 @@
/**
* Return the value of the specified locale-sensetive indexed property
- * of the specified bean, as a String using the default convertion pattern of
+ * of the specified bean, as a String using the default conversion pattern of
* the corresponding {@link LocaleConverter}.
* The index is specified as a method parameter and
* must *not* be included in the property name expression
@@ -254,6 +276,7 @@
* @param bean Bean whose property is to be extracted
* @param name Simple property name of the property value to be extracted
* @param index Index of the property value to be extracted
+ * @return The indexed property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -272,11 +295,12 @@
/**
* Return the value of the specified simple locale-sensitive property
* of the specified bean, converted to a String using the specified
- * convertion pattern.
+ * conversion pattern.
*
* @param bean Bean whose property is to be extracted
* @param name Name of the property to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -296,10 +320,11 @@
/**
* Return the value of the specified simple locale-sensitive property
* of the specified bean, converted to a String using the default
- * convertion pattern of the corresponding {@link LocaleConverter}.
+ * conversion pattern of the corresponding {@link LocaleConverter}.
*
* @param bean Bean whose property is to be extracted
* @param name Name of the property to be extracted
+ * @return The property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -317,14 +342,15 @@
/**
* Return the value of the specified mapped locale-sensitive property
- * of the specified bean, as a String using the specified convertion pattern.
+ * of the specified bean, as a String using the specified conversion pattern.
* The key is specified as a method parameter and must *not* be included in
* the property name expression.
*
* @param bean Bean whose property is to be extracted
* @param name Simple property name of the property value to be extracted
* @param key Lookup key of the property value to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The mapped property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -356,6 +382,7 @@
* @param bean Bean whose property is to be extracted
* @param name Simple property name of the property value to be extracted
* @param key Lookup key of the property value to be extracted
+ * @return The mapped property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -384,7 +411,8 @@
* @param bean Bean whose property is to be extracted
* @param name <code>propertyname(index)</code> of the property value
* to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The mapped property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -410,7 +438,7 @@
/**
* Return the value of the specified locale-sensitive mapped property
* of the specified bean, as a String using the default
- * convertion pattern of the corresponding {@link LocaleConverter}.
+ * conversion pattern of the corresponding {@link LocaleConverter}.
* The String-valued key of the required value
* must be included (in parentheses) as a suffix to
* the property name, or <code>IllegalArgumentException</code> will be
@@ -419,6 +447,7 @@
* @param bean Bean whose property is to be extracted
* @param name <code>propertyname(index)</code> of the property value
* to be extracted
+ * @return The mapped property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -443,7 +472,8 @@
*
* @param bean Bean whose property is to be extracted
* @param name Possibly nested name of the property to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The nested property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -470,10 +500,11 @@
/**
* Return the value of the (possibly nested) locale-sensitive property
* of the specified name, for the specified bean, as a String using the default
- * convertion pattern of the corresponding {@link LocaleConverter}.
+ * conversion pattern of the corresponding {@link LocaleConverter}.
*
* @param bean Bean whose property is to be extracted
* @param name Possibly nested name of the property to be extracted
+ * @return The nested property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -496,12 +527,13 @@
/**
* Return the value of the specified locale-sensitive property
* of the specified bean, no matter which property reference
- * format is used, as a String using the specified convertion pattern.
+ * format is used, as a String using the specified conversion pattern.
*
* @param bean Bean whose property is to be extracted
* @param name Possibly indexed and/or nested name of the property
* to be extracted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The nested property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -523,11 +555,12 @@
* Return the value of the specified locale-sensitive property
* of the specified bean, no matter which property reference
* format is used, as a String using the default
- * convertion pattern of the corresponding {@link LocaleConverter}.
+ * conversion pattern of the corresponding {@link LocaleConverter}.
*
* @param bean Bean whose property is to be extracted
* @param name Possibly indexed and/or nested name of the property
* to be extracted
+ * @return The property's value, converted to a String
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -548,7 +581,7 @@
/**
* Set the specified locale-sensitive property value, performing type
* conversions as required to conform to the type of the destination property
- * using the default convertion pattern of the corresponding {@link LocaleConverter}.
+ * using the default conversion pattern of the corresponding {@link LocaleConverter}.
*
* @param bean Bean on which setting is to be performed
* @param name Property name (can be nested/indexed/mapped/combo)
@@ -570,12 +603,12 @@
/**
* Set the specified locale-sensitive property value, performing type
* conversions as required to conform to the type of the destination
- * property using the specified convertion pattern.
+ * property using the specified conversion pattern.
*
* @param bean Bean on which setting is to be performed
* @param name Property name (can be nested/indexed/mapped/combo)
* @param value Value to be set
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -656,6 +689,7 @@
* @param target The bean
* @param name The property name
* @param propName The Simple name of target property
+ * @return The property's type
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -704,12 +738,13 @@
/**
* Convert the specified value to the required type using the
- * specified convertion pattern.
+ * specified conversion pattern.
*
* @param type The Java type of target property
* @param index The indexed subscript value (if any)
* @param value The value to be converted
- * @param pattern The convertion pattern
+ * @param pattern The conversion pattern
+ * @return The converted value
*/
protected Object convert(Class type, int index, Object value, String pattern) {
@@ -766,6 +801,7 @@
* @param type The Java type of target property
* @param index The indexed subscript value (if any)
* @param value The value to be converted
+ * @return The converted value
*/
protected Object convert(Class type, int index, Object value) {
@@ -849,10 +885,11 @@
}
/**
- * Resolve any nested expression to get the actual target bean.
+ * Resolve any nested expression to get the actual target property.
*
* @param bean The bean
* @param name The property name
+ * @return The property's descriptor
*
* @exception IllegalAccessException if the caller does not have
* access to the property accessor method
@@ -902,6 +939,15 @@
private String key; // Mapped key value (if any)
private Object target;
+ /**
+ * Construct a descriptor instance for the target bean and property.
+ *
+ * @param target The target bean
+ * @param name The property name (includes indexed/mapped expr)
+ * @param propName The property name
+ * @param key The mapped property key (if any)
+ * @param index The indexed property index (if any)
+ */
public Descriptor(Object target, String name, String propName, String key, int index) {
setTarget(target);
@@ -911,42 +957,92 @@
setIndex(index);
}
+ /**
+ * Return the target bean.
+ *
+ * @return The descriptors target bean
+ */
public Object getTarget() {
return target;
}
+ /**
+ * Set the target bean.
+ *
+ * @param target The target bean
+ */
public void setTarget(Object target) {
this.target = target;
}
+ /**
+ * Return the mapped property key.
+ *
+ * @return the mapped property key (if any)
+ */
public String getKey() {
return key;
}
+ /**
+ * Set the mapped property key.
+ *
+ * @param key The mapped property key (if any)
+ */
public void setKey(String key) {
this.key = key;
}
+ /**
+ * Return indexed property index.
+ *
+ * @return indexed property index (if any)
+ */
public int getIndex() {
return index;
}
+ /**
+ * Set the indexed property index.
+ *
+ * @param index The indexed property index (if any)
+ */
public void setIndex(int index) {
this.index = index;
}
+ /**
+ * Return property name (includes indexed/mapped expr).
+ *
+ * @return The property name (includes indexed/mapped expr)
+ */
public String getName() {
return name;
}
+ /**
+ * Set the property name (includes indexed/mapped expr).
+ *
+ * @param name The property name (includes indexed/mapped expr)
+ */
public void setName(String name) {
this.name = name;
}
+ /**
+ * Return the property name.
+ *
+ * @return The property name
+ */
public String getPropName() {
return propName;
}
+ /**
+ * Set the property name.
+ *
+ * @param propName The property name
+ */
public void setPropName(String propName) {
this.propName = propName;
}
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtils.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtils.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtils.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale;
@@ -41,7 +41,7 @@
* no <code>Locale</code> is passed to a method.</p>
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
- *
+ * @return the default locale
* @see LocaleConvertUtilsBean#getDefaultLocale()
*/
public static Locale getDefaultLocale() {
@@ -55,6 +55,7 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param locale the default locale
* @see LocaleConvertUtilsBean#setDefaultLocale(Locale)
*/
public static void setDefaultLocale(Locale locale) {
@@ -67,6 +68,8 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @return <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
* @see LocaleConvertUtilsBean#getApplyLocalized()
*/
public static boolean getApplyLocalized() {
@@ -78,6 +81,8 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param newApplyLocalized <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
* @see LocaleConvertUtilsBean#setApplyLocalized(boolean)
*/
public static void setApplyLocalized(boolean newApplyLocalized) {
@@ -91,6 +96,8 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The Value to be converted
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(Object)
*/
public static String convert(Object value) {
@@ -99,10 +106,13 @@
/**
* <p>Convert the specified locale-sensitive value into a String
- * using the convertion pattern.</p>
+ * using the conversion pattern.</p>
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The Value to be converted
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(Object, String)
*/
public static String convert(Object value, String pattern) {
@@ -115,6 +125,10 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The Value to be converted
+ * @param locale The locale
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(Object, Locale, String)
*/
public static String convert(Object value, Locale locale, String pattern) {
@@ -128,6 +142,9 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The String scalar value to be converted
+ * @param clazz The Data type to which this value should be converted.
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String, Class)
*/
public static Object convert(String value, Class clazz) {
@@ -142,6 +159,10 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The String scalar value to be converted
+ * @param clazz The Data type to which this value should be converted.
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String, Class, String)
*/
public static Object convert(String value, Class clazz, String pattern) {
@@ -156,6 +177,11 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param value The String scalar value to be converted
+ * @param clazz The Data type to which this value should be converted.
+ * @param locale The locale
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String, Class, Locale, String)
*/
public static Object convert(String value, Class clazz, Locale locale, String pattern) {
@@ -169,6 +195,10 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param values Value to be converted (may be null)
+ * @param clazz Java array or element class to be converted to
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String[], Class, String)
*/
public static Object convert(String values[], Class clazz, String pattern) {
@@ -182,6 +212,9 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param values Value to be converted (may be null)
+ * @param clazz Java array or element class to be converted to
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String[], Class)
*/
public static Object convert(String values[], Class clazz) {
@@ -195,6 +228,11 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param values Value to be converted (may be null)
+ * @param clazz Java array or element class to be converted to
+ * @param locale The locale
+ * @param pattern The convertion pattern
+ * @return the converted value
* @see LocaleConvertUtilsBean#convert(String[], Class, Locale, String)
*/
public static Object convert(String values[], Class clazz, Locale locale, String pattern) {
@@ -208,6 +246,10 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param converter The LocaleConverter to be registered
+ * @param clazz The Destination class for conversions performed by this
+ * Converter
+ * @param locale The locale
* @see LocaleConvertUtilsBean#register(LocaleConverter, Class, Locale)
*/
public static void register(LocaleConverter converter, Class clazz, Locale locale) {
@@ -233,6 +275,7 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param locale The locale
* @see LocaleConvertUtilsBean#deregister(Locale)
*/
public static void deregister(Locale locale) {
@@ -246,6 +289,8 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param clazz Class for which to remove a registered Converter
+ * @param locale The locale
* @see LocaleConvertUtilsBean#deregister(Class, Locale)
*/
public static void deregister(Class clazz, Locale locale) {
@@ -260,6 +305,9 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param clazz Class for which to return a registered Converter
+ * @param locale The Locale
+ * @return The registered locale Converter, if any
* @see LocaleConvertUtilsBean#lookup(Class, Locale)
*/
public static LocaleConverter lookup(Class clazz, Locale locale) {
@@ -272,6 +320,9 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param locale The Locale
+ * @return The FastHashMap instance contains the all {@link LocaleConverter} types for
+ * the specified locale.
* @see LocaleConvertUtilsBean#lookup(Locale)
*/
protected static FastHashMap lookup(Locale locale) {
@@ -283,6 +334,9 @@
*
* <p>For more details see <code>LocaleConvertUtilsBean</code></p>
*
+ * @param locale The Locale
+ * @return The FastHashMap instance contains the all {@link LocaleConverter} types
+ * for the specified locale.
* @see LocaleConvertUtilsBean#create(Locale)
*/
protected static FastHashMap create(Locale locale) {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale;
@@ -85,6 +85,7 @@
/**
* Gets singleton instance.
* This is the same as the instance used by the default {@link LocaleBeanUtilsBean} singleton.
+ * @return the singleton instance
*/
public static LocaleConvertUtilsBean getInstance() {
return LocaleBeanUtilsBean.getLocaleBeanUtilsInstance().getLocaleConvertUtils();
@@ -120,7 +121,8 @@
// --------------------------------------------------------- Properties
/**
- * getter for defaultLocale
+ * getter for defaultLocale.
+ * @return the default locale
*/
public Locale getDefaultLocale() {
@@ -128,7 +130,8 @@
}
/**
- * setter for defaultLocale
+ * setter for defaultLocale.
+ * @param locale the default locale
*/
public void setDefaultLocale(Locale locale) {
@@ -142,6 +145,9 @@
/**
* getter for applyLocalized
+ *
+ * @return <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
*/
public boolean getApplyLocalized() {
return applyLocalized;
@@ -149,6 +155,9 @@
/**
* setter for applyLocalized
+ *
+ * @param newApplyLocalized <code>true</code> if pattern is localized,
+ * otherwise <code>false</code>
*/
public void setApplyLocalized(boolean newApplyLocalized) {
applyLocalized = newApplyLocalized;
@@ -160,6 +169,7 @@
* Convert the specified locale-sensitive value into a String.
*
* @param value The Value to be converted
+ * @return the converted value
*
* @exception org.apache.commons.beanutils.ConversionException if thrown by an underlying Converter
*/
@@ -169,10 +179,11 @@
/**
* Convert the specified locale-sensitive value into a String
- * using the convertion pattern.
+ * using the conversion pattern.
*
* @param value The Value to be converted
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -187,13 +198,14 @@
* @param value The Value to be converted
* @param locale The locale
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
public String convert(Object value, Locale locale, String pattern) {
LocaleConverter converter = lookup(String.class, locale);
-
+
return (String) converter.convert(String.class, value, pattern);
}
@@ -203,6 +215,7 @@
*
* @param value The String scalar value to be converted
* @param clazz The Data type to which this value should be converted.
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -219,6 +232,7 @@
* @param value The String scalar value to be converted
* @param clazz The Data type to which this value should be converted.
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -236,6 +250,7 @@
* @param clazz The Data type to which this value should be converted.
* @param locale The locale
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -266,6 +281,7 @@
* @param values Value to be converted (may be null)
* @param clazz Java array or element class to be converted to
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -280,6 +296,7 @@
*
* @param values Value to be converted (may be null)
* @param clazz Java array or element class to be converted to
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -296,6 +313,7 @@
* @param clazz Java array or element class to be converted to
* @param locale The locale
* @param pattern The convertion pattern
+ * @return the converted value
*
* @exception ConversionException if thrown by an underlying Converter
*/
@@ -378,6 +396,7 @@
*
* @param clazz Class for which to return a registered Converter
* @param locale The Locale
+ * @return The registered locale Converter, if any
*/
public LocaleConverter lookup(Class clazz, Locale locale) {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/LocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale;
@@ -38,6 +38,7 @@
* @param type Data type to which this value should be converted
* @param value The input value to be converted
* @param pattern The user-defined pattern is used for the input object formatting.
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigDecimalLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigDecimalLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigDecimalLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigDecimalLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -205,9 +205,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigIntegerLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigIntegerLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigIntegerLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/BigIntegerLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -206,9 +206,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ByteLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ByteLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ByteLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ByteLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -207,9 +207,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
final Number parsed = (Number) super.parse(value, pattern);
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -56,7 +56,7 @@
* Default Pattern Characters
*
*/
- private static final String defaultChars = initDefaultChars();
+ private static final String DEFAULT_PATTERN_CHARS = DateLocaleConverter.initDefaultChars();
// ----------------------------------------------------------- Constructors
@@ -243,7 +243,7 @@
*/
public void setLenient(boolean lenient) {
isLenient = lenient;
- }
+ }
// --------------------------------------------------------- Methods
@@ -253,9 +253,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return the converted Date value
*
* @exception org.apache.commons.beanutils.ConversionException
* if conversion cannot be performed successfully
+ * @throws ParseException if an error occurs parsing
*/
protected Object parse(Object value, String pattern) throws ParseException {
@@ -313,7 +315,7 @@
DateFormatSymbols localizedSymbols = new DateFormatSymbols(locale);
String localChars = localizedSymbols.getLocalPatternChars();
- if (defaultChars.equals(localChars)) {
+ if (DEFAULT_PATTERN_CHARS.equals(localChars)) {
return localizedPattern;
}
@@ -322,7 +324,7 @@
try {
convertedPattern = convertPattern(localizedPattern,
localChars,
- defaultChars);
+ DEFAULT_PATTERN_CHARS);
} catch (Exception ex) {
log.info("Converting pattern '" + localizedPattern + "' for " + locale, ex);
}
@@ -367,7 +369,7 @@
/**
* This method is called at class initialization time to define the
- * value for constant member defaultChars. All other methods needing
+ * value for constant member DEFAULT_PATTERN_CHARS. All other methods needing
* this data should just read that constant.
*/
private static String initDefaultChars() {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -209,7 +209,7 @@
public DecimalLocaleConverter(Object defaultValue, Locale locale, String pattern, boolean locPattern) {
super(defaultValue, locale, pattern, locPattern);
-
+
}
// --------------------------------------------------------- Methods
@@ -220,9 +220,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DoubleLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DoubleLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DoubleLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DoubleLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -200,6 +200,18 @@
super(defaultValue, locale, pattern, locPattern);
}
+ /**
+ * Convert the specified locale-sensitive input object into an output object of the
+ * specified type. This method will return Double type.
+ *
+ * @param value The input object to be converted
+ * @param pattern The pattern is used for the convertion
+ * @return The converted value
+ *
+ * @throws org.apache.commons.beanutils.ConversionException if conversion cannot be performed
+ * successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
+ */
protected Object parse(Object value, String pattern) throws ParseException {
Number result = (Number) super.parse(value, pattern);
if (result instanceof Long) {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/FloatLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/FloatLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/FloatLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/FloatLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -208,9 +208,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
final Number parsed = (Number) super.parse(value, pattern);
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/IntegerLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/IntegerLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/IntegerLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/IntegerLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -208,9 +208,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
final Number parsed = (Number) super.parse(value, pattern);
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/LongLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/LongLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/LongLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/LongLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -205,9 +205,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ShortLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ShortLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ShortLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/ShortLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -205,9 +205,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlDateLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlDateLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlDateLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlDateLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -208,9 +208,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimeLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimeLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimeLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimeLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -207,9 +207,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimestampLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimestampLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimestampLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/SqlTimestampLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -206,9 +206,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
protected Object parse(Object value, String pattern) throws ParseException {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/StringLocaleConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/StringLocaleConverter.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/StringLocaleConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/StringLocaleConverter.java Thu Jul 12 17:27:15 2007
@@ -5,15 +5,15 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.commons.beanutils.locale.converters;
@@ -222,9 +222,11 @@
*
* @param value The input object to be converted
* @param pattern The pattern is used for the convertion
+ * @return The converted value
*
* @exception org.apache.commons.beanutils.ConversionException if conversion
* cannot be performed successfully
+ * @throws ParseException if an error occurs
*/
protected Object parse(Object value, String pattern) throws ParseException {
@@ -263,9 +265,11 @@
*
* @param locale The locale
* @param pattern The pattern is used for the convertion
+ * @return The format for the locale and pattern
*
* @exception ConversionException if conversion cannot be performed
* successfully
+ * @throws ParseException if an error occurs parsing a String to a Number
*/
private DecimalFormat getDecimalFormat(Locale locale, String pattern) {
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/package.html
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/package.html?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/package.html (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/package.html Thu Jul 12 17:27:15 2007
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<html>
<head>
<title>Package Documentation for org.apache.commons.beanutils.locale.converters</title>
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/package.html
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/package.html?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/package.html (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/package.html Thu Jul 12 17:27:15 2007
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<html>
<head>
<title>Package Documentation for org.apache.commons.beanutils.locale Package</title>
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/package.html
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/package.html?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/package.html (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/package.html Thu Jul 12 17:27:15 2007
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<html>
<head>
<title>Package Documentation for org.apache.commons.beanutils Package</title>
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/ArrayStack.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/ArrayStack.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/ArrayStack.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/ArrayStack.java Thu Jul 12 17:27:15 2007
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/Buffer.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/Buffer.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/Buffer.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/Buffer.java Thu Jul 12 17:27:15 2007
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/BufferUnderflowException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/BufferUnderflowException.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/BufferUnderflowException.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/BufferUnderflowException.java Thu Jul 12 17:27:15 2007
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/FastHashMap.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/FastHashMap.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/FastHashMap.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/FastHashMap.java Thu Jul 12 17:27:15 2007
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -435,6 +435,7 @@
/**
* Return a collection view of the mappings contained in this map. Each
* element in the returned collection is a <code>Map.Entry</code>.
+ * @return the set of map Map entries
*/
public Set entrySet() {
return new EntrySet();
@@ -442,6 +443,7 @@
/**
* Return a set view of the keys contained in this map.
+ * @return the set of the Map's keys
*/
public Set keySet() {
return new KeySet();
@@ -449,6 +451,7 @@
/**
* Return a collection view of the values contained in this map.
+ * @return the set of the Map's values
*/
public Collection values() {
return new Values();
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/package.html
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/package.html?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/package.html (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/collections/package.html Thu Jul 12 17:27:15 2007
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<html>
<head>
<title>Package Documentation for org.apache.commons.collections Package</title>
Modified: jakarta/commons/proper/beanutils/trunk/src/java/overview.html
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/overview.html?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/overview.html (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/overview.html Thu Jul 12 17:27:15 2007
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<html>
<head>
<title>Overview Documentation for COMMONS-BEANUTILS</title>
Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropsFirstPropertyUtilsBean.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropsFirstPropertyUtilsBean.java?view=diff&rev=555824&r1=555823&r2=555824
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropsFirstPropertyUtilsBean.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropsFirstPropertyUtilsBean.java Thu Jul 12 17:27:15 2007
@@ -1,60 +1,70 @@
-/*
- * Created on 29/05/2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.apache.commons.beanutils;
-
-import java.util.Map;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * A PropertyUtilsBean which customises the behaviour of the
- * setNestedProperty and getNestedProperty methods to look for
- * simple properties in preference to map entries.
- */
-public class PropsFirstPropertyUtilsBean extends PropertyUtilsBean {
-
- public PropsFirstPropertyUtilsBean() {
- super();
- }
-
- /**
- * Note: this is a *very rough* override of this method. In particular,
- * it does not handle MAPPED_DELIM and INDEXED_DELIM chars in the
- * propertyName, so propertyNames like "a(b)" or "a[3]" will not
- * be correctly handled.
- */
- protected Object getPropertyOfMapBean(Map bean, String propertyName)
- throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
-
- PropertyDescriptor descriptor = getPropertyDescriptor(bean, propertyName);
- if (descriptor == null) {
- // no simple property exists so return the value from the map
- return bean.get(propertyName);
- } else {
- // a simple property exists so return its value instead.
- return getSimpleProperty(bean, propertyName);
- }
- }
-
- /**
- * Note: this is a *very rough* override of this method. In particular,
- * it does not handle MAPPED_DELIM and INDEXED_DELIM chars in the
- * propertyName, so propertyNames like "a(b)" or "a[3]" will not
- * be correctly handled.
- */
- protected void setPropertyOfMapBean(Map bean, String propertyName, Object value)
- throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
- PropertyDescriptor descriptor = getPropertyDescriptor(bean, propertyName);
- if (descriptor == null) {
- // no simple property exists so put the value into the map
- bean.put(propertyName, value);
- } else {
- // a simple property exists so set that instead.
- setSimpleProperty(bean, propertyName, value);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.beanutils;
+
+import java.util.Map;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * A PropertyUtilsBean which customises the behaviour of the
+ * setNestedProperty and getNestedProperty methods to look for
+ * simple properties in preference to map entries.
+ */
+public class PropsFirstPropertyUtilsBean extends PropertyUtilsBean {
+
+ public PropsFirstPropertyUtilsBean() {
+ super();
+ }
+
+ /**
+ * Note: this is a *very rough* override of this method. In particular,
+ * it does not handle MAPPED_DELIM and INDEXED_DELIM chars in the
+ * propertyName, so propertyNames like "a(b)" or "a[3]" will not
+ * be correctly handled.
+ */
+ protected Object getPropertyOfMapBean(Map bean, String propertyName)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
+
+ PropertyDescriptor descriptor = getPropertyDescriptor(bean, propertyName);
+ if (descriptor == null) {
+ // no simple property exists so return the value from the map
+ return bean.get(propertyName);
+ } else {
+ // a simple property exists so return its value instead.
+ return getSimpleProperty(bean, propertyName);
+ }
+ }
+
+ /**
+ * Note: this is a *very rough* override of this method. In particular,
+ * it does not handle MAPPED_DELIM and INDEXED_DELIM chars in the
+ * propertyName, so propertyNames like "a(b)" or "a[3]" will not
+ * be correctly handled.
+ */
+ protected void setPropertyOfMapBean(Map bean, String propertyName, Object value)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
+ PropertyDescriptor descriptor = getPropertyDescriptor(bean, propertyName);
+ if (descriptor == null) {
+ // no simple property exists so put the value into the map
+ bean.put(propertyName, value);
+ } else {
+ // a simple property exists so set that instead.
+ setSimpleProperty(bean, propertyName, value);
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org