Renamed org.springframework.ui.format package to simply org.springframework.format package; 'ui' is not adding any value - it makes the package name longer and also discourages use of formatters outside in other "non ui" environments where localized formatting of field values is needed.

This commit is contained in:
Keith Donald 2009-11-05 15:21:22 +00:00
parent f0de1c3069
commit a62b413be4
41 changed files with 80 additions and 76 deletions

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format; package org.springframework.format;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.util.Set; import java.util.Set;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format; package org.springframework.format;
/** /**
* Formats objects of type T. * Formats objects of type T.

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format; package org.springframework.format;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format; package org.springframework.format;
import java.text.ParseException; import java.text.ParseException;
import java.util.Locale; import java.util.Locale;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format; package org.springframework.format;
import java.util.Locale; import java.util.Locale;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.annotation; package org.springframework.format.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.annotation; package org.springframework.format.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,4 +1,4 @@
/** /**
* Annotations for declaratively configuring field formatting rules. * Annotations for declaratively configuring field formatting rules.
*/ */
package org.springframework.ui.format.annotation; package org.springframework.format.annotation;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.date; package org.springframework.format.datetime;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
@ -23,7 +23,7 @@ import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
import org.springframework.ui.format.Formatter; import org.springframework.format.Formatter;
/** /**
* A formatter for {@link java.util.Date} types. * A formatter for {@link java.util.Date} types.

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.util.Calendar; import java.util.Calendar;
@ -30,9 +30,9 @@ import org.joda.time.LocalTime;
import org.joda.time.ReadableInstant; import org.joda.time.ReadableInstant;
import org.joda.time.ReadablePartial; import org.joda.time.ReadablePartial;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.AnnotationFormatterFactory; import org.springframework.format.AnnotationFormatterFactory;
import org.springframework.ui.format.Parser; import org.springframework.format.Parser;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* Base class for annotation-based Joda DateTime formatters. * Base class for annotation-based Joda DateTime formatters.

View File

@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.ui.format.annotation.DateTimeFormat.Style; import org.springframework.format.annotation.DateTimeFormat.Style;
/** /**
* Formats properties annotated with the {@link DateTimeFormat} annotation. * Formats properties annotated with the {@link DateTimeFormat} annotation.

View File

@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.text.ParseException; import java.text.ParseException;
import java.util.Locale; import java.util.Locale;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.Parser; import org.springframework.format.Parser;
/** /**
* Parses Joda Time {@link DateTime} instances using a {@link DateTimeFormatter}. * Parses Joda Time {@link DateTime} instances using a {@link DateTimeFormatter}.

View File

@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.annotation.ISODateTimeFormat; import org.springframework.format.annotation.ISODateTimeFormat;
import org.springframework.ui.format.annotation.ISODateTimeFormat.Style; import org.springframework.format.annotation.ISODateTimeFormat.Style;
/** /**
* Formats properties annotated with the {@link ISODateTimeFormat} annotation. * Formats properties annotated with the {@link ISODateTimeFormat} annotation.

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import org.joda.time.Chronology; import org.joda.time.Chronology;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Locale; import java.util.Locale;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -26,9 +26,9 @@ import org.joda.time.ReadableInstant;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat; import org.joda.time.format.ISODateTimeFormat;
import org.springframework.ui.format.FormatterRegistry; import org.springframework.format.FormatterRegistry;
import org.springframework.ui.format.Parser; import org.springframework.format.Parser;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* Configures Joda Time's Formatting system for use with Spring. * Configures Joda Time's Formatting system for use with Spring.

View File

@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Locale; import java.util.Locale;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* Prints Long instances using a {@link DateTimeFormatter}. * Prints Long instances using a {@link DateTimeFormatter}.

View File

@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Locale; import java.util.Locale;
import org.joda.time.ReadableInstant; import org.joda.time.ReadableInstant;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* Prints Joda Time {@link ReadableInstant} instances using a {@link DateTimeFormatter}. * Prints Joda Time {@link ReadableInstant} instances using a {@link DateTimeFormatter}.

View File

@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import java.util.Locale; import java.util.Locale;
import org.joda.time.ReadablePartial; import org.joda.time.ReadablePartial;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* Prints Joda Time {@link ReadablePartial} instances using a {@link DateTimeFormatter}. * Prints Joda Time {@link ReadablePartial} instances using a {@link DateTimeFormatter}.

View File

@ -1,4 +1,4 @@
/** /**
* Integration with the Joda Time for formatting Joda types as well as standard JDK Date types. * Integration with the Joda Time for formatting Joda types as well as standard JDK Date types.
*/ */
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;

View File

@ -1,4 +1,4 @@
/** /**
* Formatters for <code>java.util.Date</code> properties. * Formatters for <code>java.util.Date</code> properties.
*/ */
package org.springframework.ui.format.date; package org.springframework.format.datetime;

View File

@ -14,14 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.util.Locale; import java.util.Locale;
import org.springframework.ui.format.Formatter; import org.springframework.format.Formatter;
/** /**
* Abstract formatter for Numbers, * Abstract formatter for Numbers,

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.Locale; import java.util.Locale;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;

View File

@ -1,4 +1,4 @@
/** /**
* Formatters for <code>java.lang.Number</code> properties. * Formatters for <code>java.lang.Number</code> properties.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;

View File

@ -1,4 +1,4 @@
/** /**
* An API for defining Formatters to format field model values for display in a UI. * An API for defining Formatters to format field model values for display in a UI.
*/ */
package org.springframework.ui.format; package org.springframework.format;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.support; package org.springframework.format.support;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.text.ParseException; import java.text.ParseException;
@ -29,11 +29,11 @@ import org.springframework.core.convert.support.ConditionalGenericConverter;
import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.convert.support.GenericConversionService; import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.core.convert.support.GenericConverter; import org.springframework.core.convert.support.GenericConverter;
import org.springframework.ui.format.AnnotationFormatterFactory; import org.springframework.format.AnnotationFormatterFactory;
import org.springframework.ui.format.Formatter; import org.springframework.format.Formatter;
import org.springframework.ui.format.FormatterRegistry; import org.springframework.format.FormatterRegistry;
import org.springframework.ui.format.Parser; import org.springframework.format.Parser;
import org.springframework.ui.format.Printer; import org.springframework.format.Printer;
/** /**
* A ConversionService implementation designed to be configured as a {@link FormatterRegistry}.. * A ConversionService implementation designed to be configured as a {@link FormatterRegistry}..

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.support; package org.springframework.format.support;
import java.beans.PropertyEditorSupport; import java.beans.PropertyEditorSupport;
@ -23,7 +23,7 @@ import org.springframework.util.Assert;
/** /**
* Adapter that exposes a {@link java.beans.PropertyEditor} for any given * Adapter that exposes a {@link java.beans.PropertyEditor} for any given
* {@link org.springframework.ui.format.Formatter}, retrieving the current * {@link org.springframework.format.Formatter}, retrieving the current
* Locale from {@link org.springframework.context.i18n.LocaleContextHolder}. * Locale from {@link org.springframework.context.i18n.LocaleContextHolder}.
* *
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -2,4 +2,4 @@
* Support classes for the formatting package, * Support classes for the formatting package,
* providing common implementations as well as adapters. * providing common implementations as well as adapters.
*/ */
package org.springframework.ui.format.support; package org.springframework.format.support;

View File

@ -24,7 +24,7 @@ import org.springframework.beans.PropertyAccessorUtils;
import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.TypeDescriptor;
import org.springframework.ui.format.support.FormattingPropertyEditorAdapter; import org.springframework.format.support.FormattingPropertyEditorAdapter;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.date; package org.springframework.format.datetime;
import java.text.ParseException; import java.text.ParseException;
import java.util.Calendar; import java.util.Calendar;
@ -22,6 +22,7 @@ import java.util.Locale;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import org.junit.Test; import org.junit.Test;
import org.springframework.format.datetime.DateFormatter;
/** /**
* @author Keith Donald * @author Keith Donald

View File

@ -1,4 +1,4 @@
package org.springframework.ui.format.jodatime; package org.springframework.format.datetime.joda;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -15,9 +15,10 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.ui.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.ui.format.annotation.DateTimeFormat.Style; import org.springframework.format.annotation.DateTimeFormat.Style;
import org.springframework.ui.format.support.FormattingConversionService; import org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.validation.DataBinder; import org.springframework.validation.DataBinder;
public class JodaTimeFormattingTests { public class JodaTimeFormattingTests {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -24,6 +24,7 @@ import java.text.ParseException;
import java.util.Locale; import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.springframework.format.number.CurrencyFormatter;
/** /**
* @author Keith Donald * @author Keith Donald

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -23,7 +23,7 @@ import java.text.ParseException;
import java.util.Locale; import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.springframework.ui.format.number.DecimalFormatter; import org.springframework.format.number.DecimalFormatter;
/** /**
* @author Keith Donald * @author Keith Donald

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -22,7 +22,7 @@ import java.text.ParseException;
import java.util.Locale; import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.springframework.ui.format.number.IntegerFormatter; import org.springframework.format.number.IntegerFormatter;
/** /**
* @author Keith Donald * @author Keith Donald

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.number; package org.springframework.format.number;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -23,7 +23,7 @@ import java.text.ParseException;
import java.util.Locale; import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.springframework.ui.format.number.PercentFormatter; import org.springframework.format.number.PercentFormatter;
/** /**
* @author Keith Donald * @author Keith Donald

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.ui.format.support; package org.springframework.format.support;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -31,11 +31,12 @@ import org.junit.Test;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import org.springframework.ui.format.annotation.DateTimeFormat.Style; import org.springframework.format.annotation.DateTimeFormat.Style;
import org.springframework.ui.format.jodatime.DateTimeFormatAnnotationFormatterFactory; import org.springframework.format.datetime.joda.DateTimeFormatAnnotationFormatterFactory;
import org.springframework.ui.format.jodatime.DateTimeParser; import org.springframework.format.datetime.joda.DateTimeParser;
import org.springframework.ui.format.jodatime.ReadablePartialPrinter; import org.springframework.format.datetime.joda.ReadablePartialPrinter;
import org.springframework.ui.format.number.IntegerFormatter; import org.springframework.format.number.IntegerFormatter;
import org.springframework.format.support.FormattingConversionService;
/** /**
* @author Keith Donald * @author Keith Donald
@ -105,7 +106,7 @@ public class FormattingConversionServiceTests {
private static class Model { private static class Model {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@org.springframework.ui.format.annotation.DateTimeFormat(dateStyle = Style.SHORT) @org.springframework.format.annotation.DateTimeFormat(dateStyle = Style.SHORT)
public Date date; public Date date;
} }

View File

@ -44,8 +44,8 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.context.support.StaticMessageSource; import org.springframework.context.support.StaticMessageSource;
import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.ui.format.number.DecimalFormatter; import org.springframework.format.number.DecimalFormatter;
import org.springframework.ui.format.support.FormattingConversionService; import org.springframework.format.support.FormattingConversionService;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**