From 42cdeb43024d275082a287541436eda959954304 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Sat, 13 Jun 2009 18:25:59 +0000 Subject: [PATCH] since 3.0 --- .../springframework/ui/binding/Binder.java | 2 +- .../springframework/ui/binding/Binding.java | 1 + .../ui/binding/BindingConfiguration.java | 1 + .../ui/binding/BindingResult.java | 1 + .../ui/binding/BindingResults.java | 1 + .../ui/binding/FormatterRegistry.java | 2 +- .../springframework/ui/binding/UserValue.java | 3 +- .../ui/binding/UserValues.java | 19 +++++++- .../ui/binding/support/GenericBinder.java | 3 +- .../support/GenericFormatterRegistry.java | 1 + .../ui/binding/support/WebBinder.java | 1 + .../ui/format/AnnotationFormatterFactory.java | 1 + .../springframework/ui/format/Formatter.java | 1 + .../ui/format/date/DateFormatter.java | 3 +- .../ui/format/number/CurrencyFormatter.java | 1 + .../number/CurrencyNumberFormatFactory.java | 1 + .../ui/format/number/DecimalFormatter.java | 1 + .../number/DefaultNumberFormatFactory.java | 1 + .../ui/format/number/IntegerFormatter.java | 1 + .../number/IntegerNumberFormatFactory.java | 1 + .../ui/format/number/NumberFormatFactory.java | 1 + .../ui/format/number/PercentFormatter.java | 1 + .../number/PercentNumberFormatFactory.java | 1 + .../ui/message/DefaultMessageResolver.java | 2 +- .../springframework/ui/message/Message.java | 1 + .../ui/message/MessageBuilder.java | 1 + .../ui/message/MessageContext.java | 2 + .../message/MessageResolutionException.java | 1 + .../ui/message/MessageResolver.java | 1 + .../springframework/ui/message/Severity.java | 2 +- .../support/DefaultMessageContext.java | 45 ++++--------------- .../ui/validation/ValidationResults.java | 1 - .../ui/validation/Validator.java | 1 - .../AbstractEmbeddedDatabaseConfigurer.java | 1 + .../embedded/CannotReadScriptException.java | 2 +- .../embedded/ConnectionProperties.java | 1 + .../embedded/DataSourceFactory.java | 3 +- .../embedded/DatabasePopulator.java | 1 + .../DerbyEmbeddedDatabaseConfigurer.java | 2 +- .../datasource/embedded/EmbeddedDatabase.java | 1 + .../embedded/EmbeddedDatabaseBuilder.java | 1 + .../embedded/EmbeddedDatabaseConfigurer.java | 1 + .../EmbeddedDatabaseConfigurerFactory.java | 1 + .../embedded/EmbeddedDatabaseFactory.java | 2 +- .../embedded/EmbeddedDatabaseFactoryBean.java | 2 +- .../embedded/EmbeddedDatabaseType.java | 1 + .../H2EmbeddedDatabaseConfigurer.java | 2 +- .../HsqlEmbeddedDatabaseConfigurer.java | 2 +- .../jdbc/datasource/embedded/JdbcUtils.java | 1 + .../embedded/ResourceDatabasePopulator.java | 2 + .../SimpleDriverDataSourceFactory.java | 1 + 51 files changed, 78 insertions(+), 55 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java index 180f975f145..e1d34e21b12 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java @@ -23,7 +23,7 @@ import org.springframework.ui.format.Formatter; /** * Binds user-entered values to properties of a model object. * @author Keith Donald - * + * @since 3.0 * @param The kind of model object this binder binds to * @see #add(BindingConfiguration) * @see #bind(UserValues) diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java index abf899d5ef6..3cf2562e5b2 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java @@ -18,6 +18,7 @@ package org.springframework.ui.binding; /** * A binding between a user interface element and a model property. * @author Keith Donald + * @since 3.0 */ public interface Binding { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java index 2423fb6fd8a..e03881f9cf5 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java @@ -21,6 +21,7 @@ import org.springframework.ui.format.Formatter; /** * Configuration used to create a new {@link Binding} registered with a {@link GenericBinder}. * @author Keith Donald + * @since 3.0 * @see GenericBinder#add(BindingConfiguration) */ public class BindingConfiguration { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResult.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResult.java index ff6c8ae4c28..c758288a11d 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResult.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResult.java @@ -18,6 +18,7 @@ package org.springframework.ui.binding; /** * The result of a bind operation. * @author Keith Donald + * @since 3.0 * @see Binder#bind(UserValues) * @see Binding#setValue(Object) */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResults.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResults.java index 5fa5ecae40a..ac688b43170 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResults.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingResults.java @@ -20,6 +20,7 @@ import java.util.List; /** * The results of a bind operation. * @author Keith Donald + * @since 3.0 * @see Binder#bind(UserValues) */ public interface BindingResults extends Iterable { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/FormatterRegistry.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/FormatterRegistry.java index 64ae12c647e..3d3170836b0 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/FormatterRegistry.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/FormatterRegistry.java @@ -6,8 +6,8 @@ import org.springframework.ui.format.Formatter; /** * A centralized registry of Formatters indexed by property types. - * * @author Keith Donald + * @since 3.0 */ public interface FormatterRegistry { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValue.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValue.java index 6264c100b09..a3ab5f4a0ac 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValue.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValue.java @@ -18,7 +18,8 @@ package org.springframework.ui.binding; /** * Holds a user-entered value to bind to a model property. * @author Keith Donald - * @see Binder#bind(List). + * @since 3.0 + * @see Binder#bind(List) */ public class UserValue { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValues.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValues.java index 9a1989d2943..a2cabbc9970 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValues.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/UserValues.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2009 the original author or authors. + * + * Licensed 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.springframework.ui.binding; import java.util.ArrayList; @@ -6,9 +21,9 @@ import java.util.Iterator; import java.util.List; /** - * A simpler holder for a list of UserValues. - * + * A holder for a list of UserValues. * @author Keith Donald + * @since 3.0 * @see Binder#bind(UserValues) */ public class UserValues implements Iterable { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java index 398309d2f89..a02c3e42319 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java @@ -57,8 +57,9 @@ import org.springframework.ui.format.AnnotationFormatterFactory; import org.springframework.ui.format.Formatter; /** - * A generic {@link Binder binder} suitable for use in most binding environments. + * A generic {@link Binder binder} suitable for use in most environments. * @author Keith Donald + * @since 3.0 * @see #add(BindingConfiguration) * @see #bind(UserValues) */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericFormatterRegistry.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericFormatterRegistry.java index bc65602d5f0..c4b061a34c1 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericFormatterRegistry.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericFormatterRegistry.java @@ -31,6 +31,7 @@ import org.springframework.ui.format.Formatter; /** * A generic implementation of {@link FormatterRegistry} suitable for use in most binding environments. * @author Keith Donald + * @since 3.0 * @see #add(Formatter, Class) * @see #add(AnnotationFormatterFactory) */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/WebBinder.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/WebBinder.java index 9e21432212c..00813b71be8 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/support/WebBinder.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/support/WebBinder.java @@ -24,6 +24,7 @@ import org.springframework.ui.binding.UserValues; * A binder designed for use in HTTP (web) environments. * Suited for binding user-provided HTTP query parameters to model properties. * @author Keith Donald + * @since 3.0 * @see #setDefaultPrefix(String) * @see #setPresentPrefix(String) */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/AnnotationFormatterFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/AnnotationFormatterFactory.java index 67d88ef180f..05bf91ba6ec 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/AnnotationFormatterFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/AnnotationFormatterFactory.java @@ -21,6 +21,7 @@ import java.lang.annotation.Annotation; * A factory that creates {@link Formatter formatters} to format property values on properties annotated with a particular format {@link Annotation}. * For example, a CurrencyAnnotationFormatterFactory might create a Formatter that formats a BigDecimal value set on a property annotated with @CurrencyFormat. * @author Keith Donald + * @since 3.0 * @param The type of Annotation this factory uses to create Formatter instances * @param The type of Object Formatters created by this factory format */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/Formatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/Formatter.java index 012c31e2f63..e9342f6169c 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/Formatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/Formatter.java @@ -21,6 +21,7 @@ import java.util.Locale; /** * Formats objects of type T for display. * @author Keith Donald + * @since 3.0 * @param the type of object this formatter can format */ public interface Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/date/DateFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/date/DateFormatter.java index ffc2134233d..d5c5c152bd8 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/date/DateFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/date/DateFormatter.java @@ -28,8 +28,9 @@ import org.springframework.ui.format.Formatter; /** * A formatter for {@link Date} types. * Allows the configuration of an explicit date pattern and locale. - * @see SimpleDateFormat * @author Keith Donald + * @since 3.0 + * @see SimpleDateFormat */ public class DateFormatter implements Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyFormatter.java index b5ed5c73233..d12e1ea4323 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyFormatter.java @@ -31,6 +31,7 @@ import org.springframework.ui.format.Formatter; * Sets the scale of parsed BigDecimal values to {@link NumberFormat#getMaximumFractionDigits()}. * Applies {@link RoundingMode#DOWN} to parsed values. * @author Keith Donald + * @since 3.0 */ public class CurrencyFormatter implements Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyNumberFormatFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyNumberFormatFactory.java index 1513bef9b08..648feb4ae0c 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyNumberFormatFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/CurrencyNumberFormatFactory.java @@ -23,6 +23,7 @@ import java.util.Locale; /** * Produces NumberFormat instances that format currency values. * @author Keith Donald + * @since 3.0 * @see NumberFormat */ final class CurrencyNumberFormatFactory extends NumberFormatFactory { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java index fa41a4145de..1ba182f5625 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java @@ -29,6 +29,7 @@ import org.springframework.ui.format.Formatter; * Configures BigDecimal parsing so there is no loss in precision. * Allows configuration over the decimal number pattern; see {@link #DecimalFormatter(String)}. * @author Keith Donald + * @since 3.0 */ public class DecimalFormatter implements Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DefaultNumberFormatFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DefaultNumberFormatFactory.java index b10bad3da64..20bfd500822 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DefaultNumberFormatFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DefaultNumberFormatFactory.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.LogFactory; * @author Keith Donald * @see NumberFormat * @see DecimalFormat + * @since 3.0 */ class DefaultNumberFormatFactory extends NumberFormatFactory { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java index 22421b876f2..3535dfc3837 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java @@ -26,6 +26,7 @@ import org.springframework.ui.format.Formatter; * A Long formatter for whole integer values. * Delegates to {@link NumberFormat#getIntegerInstance(Locale)}. * @author Keith Donald + * @since 3.0 */ public class IntegerFormatter implements Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerNumberFormatFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerNumberFormatFactory.java index a7079cfb08c..468c7217250 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerNumberFormatFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerNumberFormatFactory.java @@ -23,6 +23,7 @@ import java.util.Locale; * * @author Keith Donald * @see NumberFormat + * @since 3.0 */ final class IntegerNumberFormatFactory extends NumberFormatFactory { public NumberFormat getNumberFormat(Locale locale) { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/NumberFormatFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/NumberFormatFactory.java index c8135140310..8f696456114 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/NumberFormatFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/NumberFormatFactory.java @@ -23,6 +23,7 @@ import java.util.Locale; * caching number format instances. * * @author Keith Donald + * @since 3.0 */ abstract class NumberFormatFactory { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java index c57c4e92a4a..5044b28464e 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java @@ -28,6 +28,7 @@ import org.springframework.ui.format.Formatter; * Delegates to {@link NumberFormat#getPercentInstance(Locale)}. * Configures BigDecimal parsing so there is no loss in precision. * @author Keith Donald + * @since 3.0 */ public class PercentFormatter implements Formatter { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentNumberFormatFactory.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentNumberFormatFactory.java index 1e2e914aa39..50bf3743268 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentNumberFormatFactory.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentNumberFormatFactory.java @@ -24,6 +24,7 @@ import java.util.Locale; * * @see NumberFormat * @author Keith Donald + * @since 3.0 */ final class PercentNumberFormatFactory extends NumberFormatFactory { public NumberFormat getNumberFormat(Locale locale) { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/DefaultMessageResolver.java b/org.springframework.context/src/main/java/org/springframework/ui/message/DefaultMessageResolver.java index 7bf1eb11e1e..3a91d052198 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/DefaultMessageResolver.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/DefaultMessageResolver.java @@ -33,7 +33,7 @@ import org.springframework.expression.PropertyAccessor; import org.springframework.expression.TypedValue; import org.springframework.expression.spel.support.StandardEvaluationContext; -class DefaultMessageResolver implements MessageResolver, MessageSourceResolvable { +final class DefaultMessageResolver implements MessageResolver, MessageSourceResolvable { private Severity severity; diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java b/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java index c9edd4aa771..5eb465978d6 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java @@ -20,6 +20,7 @@ package org.springframework.ui.message; * For example, a error message may inform a user of a web application a business rule was violated. * TODO - should we introduce summary/detail fields instead of just text * @author Keith Donald + * @since 3.0 */ public interface Message { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageBuilder.java b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageBuilder.java index d0c4fbeb2b0..093f72ad293 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageBuilder.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageBuilder.java @@ -48,6 +48,7 @@ import org.springframework.expression.spel.standard.SpelExpressionParser; * mathForm.decimalField=Decimal Field * * @author Keith Donald + * @since 3.0 * @see MessageContext#add(MessageResolver, String) */ public class MessageBuilder { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageContext.java b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageContext.java index f53d7bd90f1..47f92c5f5a2 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageContext.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageContext.java @@ -20,6 +20,8 @@ import java.util.Map; /** * A context for recording and retrieving messages for display in a user interface. + * @author Keith Donald + * @since 3.0 */ public interface MessageContext { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolutionException.java b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolutionException.java index 39a418575e9..93ed34178cc 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolutionException.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolutionException.java @@ -18,6 +18,7 @@ package org.springframework.ui.message; /** * Runtime exception thrown by a {@link MessageResolver} if a message resolution fails. * @author Keith Donald + * @since 3.0 */ @SuppressWarnings("serial") public class MessageResolutionException extends RuntimeException { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolver.java b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolver.java index 38bebae2125..6746878e105 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolver.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/MessageResolver.java @@ -22,6 +22,7 @@ import org.springframework.context.MessageSource; /** * A factory for a localized Message. * @author Keith Donald + * @since 3.0 * @see Message * @see MessageSource */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/Severity.java b/org.springframework.context/src/main/java/org/springframework/ui/message/Severity.java index 96d989b4d0c..15d6abcfe19 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/Severity.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/Severity.java @@ -19,7 +19,7 @@ package org.springframework.ui.message; * Enum exposing supported message severities. * * @author Keith Donald - * @author Jeremy Grelle + * @since 3.0 * @see Message */ public enum Severity { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/support/DefaultMessageContext.java b/org.springframework.context/src/main/java/org/springframework/ui/message/support/DefaultMessageContext.java index 75f7b19bf62..50b975a0b30 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/support/DefaultMessageContext.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/support/DefaultMessageContext.java @@ -15,56 +15,46 @@ */ package org.springframework.ui.message.support; -import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.context.support.AbstractMessageSource; import org.springframework.core.style.ToStringCreator; import org.springframework.ui.message.Message; import org.springframework.ui.message.MessageContext; import org.springframework.ui.message.MessageResolver; import org.springframework.ui.message.Severity; +import org.springframework.util.Assert; import org.springframework.util.CachingMapDecorator; -import edu.emory.mathcs.backport.java.util.Collections; - /** * The default message context implementation. * Uses a {@link MessageSource} to resolve messages that are added by callers. - * * @author Keith Donald + * @since 3.0 */ public class DefaultMessageContext implements MessageContext { - private MessageSource messageSource; + private final MessageSource messageSource; @SuppressWarnings("serial") - private Map> messagesByElement = new CachingMapDecorator>(new LinkedHashMap>()) { - protected ArrayList create(String element) { + private Map> messagesByElement = new CachingMapDecorator>(new LinkedHashMap>()) { + protected List create(String element) { return new ArrayList(); } }; - /** - * Creates a new default message context. - * Defaults to a message source that simply resolves default text and cannot resolve localized message codes. - */ - public DefaultMessageContext() { - init(null); - } - /** * Creates a new default message context. * @param messageSource the message source to resolve messages added to this context */ public DefaultMessageContext(MessageSource messageSource) { - init(messageSource); + Assert.notNull(messageSource, "The MessageSource is required"); + this.messageSource = messageSource; } /** @@ -77,12 +67,10 @@ public class DefaultMessageContext implements MessageContext { // implementing message context - @SuppressWarnings("unchecked") public Map> getMessages() { return Collections.unmodifiableMap(messagesByElement); } - @SuppressWarnings("unchecked") public List getMessages(String element) { List messages = messagesByElement.get(element); if (messages.isEmpty()) { @@ -102,23 +90,6 @@ public class DefaultMessageContext implements MessageContext { // internal helpers - private void init(MessageSource messageSource) { - setMessageSource(messageSource); - } - - private void setMessageSource(MessageSource messageSource) { - if (messageSource == null) { - messageSource = new DefaultTextFallbackMessageSource(); - } - this.messageSource = messageSource; - } - - private static class DefaultTextFallbackMessageSource extends AbstractMessageSource { - protected MessageFormat resolveCode(String code, Locale locale) { - return null; - } - } - class ResolvableMessage implements Message { private MessageResolver resolver; diff --git a/org.springframework.context/src/main/java/org/springframework/ui/validation/ValidationResults.java b/org.springframework.context/src/main/java/org/springframework/ui/validation/ValidationResults.java index f5f3e6b0a9b..27aab1227e6 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/validation/ValidationResults.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/validation/ValidationResults.java @@ -18,7 +18,6 @@ package org.springframework.ui.validation; /** * TODO Document ValidateResults. - * * @author Keith Donald * @since 3.0 */ diff --git a/org.springframework.context/src/main/java/org/springframework/ui/validation/Validator.java b/org.springframework.context/src/main/java/org/springframework/ui/validation/Validator.java index ddea81bbc8d..a4d7544d271 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/validation/Validator.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/validation/Validator.java @@ -20,7 +20,6 @@ import java.util.List; /** * TODO Document Validator. - * * @author Keith Donald * @since 3.0 */ diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java index 5f71a793dd8..280d5f576b9 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java @@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory; /** * Base class for {@link EmbeddedDatabaseConfigurer} implementations providing common shutdown behaviour. * @author Oliver Gierke + * @since 3.0 */ abstract class AbstractEmbeddedDatabaseConfigurer implements EmbeddedDatabaseConfigurer { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/CannotReadScriptException.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/CannotReadScriptException.java index 31685154f6d..fe0d703beee 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/CannotReadScriptException.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/CannotReadScriptException.java @@ -20,8 +20,8 @@ import org.springframework.core.io.support.EncodedResource; /** * Thrown by {@link ResourceDatabasePopulator} if one of its SQL scripts could * not be read during population. - * * @author Keith Donald + * @since 3.0 */ @SuppressWarnings("serial") public class CannotReadScriptException extends RuntimeException { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java index 272a20d75a5..d4c7ee0a61d 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java @@ -19,6 +19,7 @@ package org.springframework.jdbc.datasource.embedded; * DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently, * independent of the actual DataSource implementation. * @author Keith Donald + * @since 3.0 * @see DataSourceFactory */ public interface ConnectionProperties { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java index ac41fab3942..ea4789b9ece 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java @@ -22,7 +22,8 @@ import org.springframework.jdbc.datasource.SimpleDriverDataSource; /** * Encapsulates the creation of a particular DataSource implementation, such as a {@link SimpleDriverDataSource} or connection pool such as Apache DBCP or c3p0. * Call {@link #getConnectionProperties()} to configure normalized DataSource properties before calling {@link #getDataSource()} to actually get the configured DataSource instance. - * @author Keith Donald + * @author Keith Donald + * @since 3.0 */ public interface DataSourceFactory { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java index c170a2187a3..dfa35940ce8 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java @@ -21,6 +21,7 @@ import java.sql.SQLException; /** * Strategy used to populate an embedded database during initialization. * @author Keith Donald + * @since 3.0 * @see ResourceDatabasePopulator */ public interface DatabasePopulator { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DerbyEmbeddedDatabaseConfigurer.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DerbyEmbeddedDatabaseConfigurer.java index 24db3f29638..d400f7f7d38 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DerbyEmbeddedDatabaseConfigurer.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DerbyEmbeddedDatabaseConfigurer.java @@ -32,8 +32,8 @@ import org.springframework.util.ClassUtils; /** * {@link EmbeddedDatabaseConfigurer} for the Apache Derby database. - * * @author Oliver Gierke + * @since 3.0 */ final class DerbyEmbeddedDatabaseConfigurer implements EmbeddedDatabaseConfigurer { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabase.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabase.java index 075eca8d3ef..6a01632c790 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabase.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabase.java @@ -22,6 +22,7 @@ import javax.sql.DataSource; * Is a {@link DataSource}. * Adds a shutdown operation so the embedded database instance can be shutdown. * @author Keith Donald + * @since 3.0 */ public interface EmbeddedDatabase extends DataSource { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilder.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilder.java index d74bf3a6aca..adfa2252bdb 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilder.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilder.java @@ -29,6 +29,7 @@ import org.springframework.core.io.ResourceLoader; * db.shutdown(); * * @author Keith Donald + * @since 3.0 */ public class EmbeddedDatabaseBuilder { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurer.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurer.java index e99ded5ce90..3b2cea33ada 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurer.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurer.java @@ -21,6 +21,7 @@ import javax.sql.DataSource; * Encapsulates the configuration required to create, connect to, and shutdown a specific type of embedded database such as HSQL or H2. * Create a implementation for each database type you wish to support; for example HSQL, H2, or some other type. * @author Keith Donald + * @since 3.0 */ public interface EmbeddedDatabaseConfigurer { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java index 685a4ac9e46..4c4bbfbd594 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java @@ -22,6 +22,7 @@ import org.springframework.util.Assert; * strategies. * @author Keith Donald * @author Oliver Gierke + * @since 3.0 */ final class EmbeddedDatabaseConfigurerFactory { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java index 9834bab0873..334d806c328 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java @@ -36,8 +36,8 @@ import org.springframework.util.Assert; * Call {@link #setDatabasePopulator(DatabasePopulator)} to change the algorithm used to populate the database.
* Call {@link #setDataSourceFactory(DataSourceFactory)} to change the type of DataSource used to connect to the database.
* Call {@link #getDatabase()} to get the {@link EmbeddedDatabase} instance.
- * * @author Keith Donald + * @since 3.0 */ public class EmbeddedDatabaseFactory { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryBean.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryBean.java index 758bb1c90d9..d22dd1c50c6 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryBean.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryBean.java @@ -26,8 +26,8 @@ import org.springframework.beans.factory.InitializingBean; * Returns the actual {@link DataSource} that provides connectivity to the embedded database to Spring. * The target DataSource is returned instead of a {@link EmbeddedDatabase} proxy since the FactoryBean will manage the initialization and destruction lifecycle of the database instance. * Implements DisposableBean to shutdown the embedded database when the managing Spring container is shutdown. - * * @author Keith Donald + * @since 3.0 */ public class EmbeddedDatabaseFactoryBean extends EmbeddedDatabaseFactory implements FactoryBean, InitializingBean, DisposableBean { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java index 138a4a15daa..68cc204b804 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java @@ -19,6 +19,7 @@ package org.springframework.jdbc.datasource.embedded; * A supported embedded database type. * @author Keith Donald * @author Oliver Gierke + * @since 3.0 */ public enum EmbeddedDatabaseType { HSQL, H2, DERBY; diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/H2EmbeddedDatabaseConfigurer.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/H2EmbeddedDatabaseConfigurer.java index 78b6ad24e4b..af119071456 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/H2EmbeddedDatabaseConfigurer.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/H2EmbeddedDatabaseConfigurer.java @@ -20,8 +20,8 @@ import org.springframework.util.ClassUtils; /** * Initializes an H2 embedded database instance. * Call {@link #getInstance()} to get the singleton instance of this class. - * * @author Oliver Gierke + * @since 3.0 */ final class H2EmbeddedDatabaseConfigurer extends AbstractEmbeddedDatabaseConfigurer { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/HsqlEmbeddedDatabaseConfigurer.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/HsqlEmbeddedDatabaseConfigurer.java index a5911ee3d57..bf2a989e70d 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/HsqlEmbeddedDatabaseConfigurer.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/HsqlEmbeddedDatabaseConfigurer.java @@ -20,9 +20,9 @@ import org.springframework.util.ClassUtils; /** * Initializes an HSQL embedded database instance. * Call {@link #getInstance()} to get the singleton instance of this class. - * * @author Keith Donald * @author Oliver Gierke + * @since 3.0 */ final class HsqlEmbeddedDatabaseConfigurer extends AbstractEmbeddedDatabaseConfigurer { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/JdbcUtils.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/JdbcUtils.java index 6f47739d396..7f9418e3973 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/JdbcUtils.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/JdbcUtils.java @@ -30,6 +30,7 @@ import org.springframework.jdbc.CannotGetJdbcConnectionException; * Note there is some duplication here with JdbcUtils in jdbc.support package. * We may want to consider simply using that at some point. * @author Keith Donald + * @since 3.0 */ final class JdbcUtils { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java index 6c0d6539f3b..5f13320d2d1 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java @@ -36,6 +36,8 @@ import org.springframework.util.StringUtils; *

* Call {@link #addScript(Resource)} to add a SQL script location.
* Call {@link #setSqlScriptEncoding(String)} to set the encoding for all added scripts.
+ * @author Keith Donald + * @since 3.0 */ public class ResourceDatabasePopulator implements DatabasePopulator { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java index bce72df6778..4f065d8f73d 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java @@ -22,6 +22,7 @@ import org.springframework.jdbc.datasource.SimpleDriverDataSource; /** * Creates a {@link SimpleDriverDataSource}. * @author Keith Donald + * @since 3.0 */ final class SimpleDriverDataSourceFactory implements DataSourceFactory {