Commit Graph

152 Commits

Author SHA1 Message Date
Andy Clement 2a04e8c444 SPR-8211: property accessor ordering correction and removal of unnecessary duplicates
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4298 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 16:40:44 +00:00
Andy Clement 96160448ac SFW-8228
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4293 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 23:41:30 +00:00
Andy Clement c399e1e033 SFW-8224: distance can be used when computing method matches in ReflectiveMethodResolver
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4292 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 21:44:24 +00:00
Chris Beams 0b1f42ef66 Update MockEnvironment / MockPropertySource types
Reflecting signature changes in getProperty() methods

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4245 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-06 18:57:41 +00:00
Andy Clement 3b666f9897 SPR-8174: varargs and primitive handling in SpEL
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4157 50f2f4bb-b051-0410-bef5-90022cba6387
2011-04-01 21:59:25 +00:00
Andy Clement 5b07305e7d SPR-7840: comparator dealing with nulls
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4156 50f2f4bb-b051-0410-bef5-90022cba6387
2011-04-01 18:51:35 +00:00
Juergen Hoeller 4bd265f0a4 removed ConversionService/TypeConverter convenience methods in order to restore 3.0's SPI (for backwards compatibility with implementers)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3983 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-10 01:24:08 +00:00
Chris Beams dc22760978 Introduce FeatureSpecification support
Introduce FeatureSpecification interface and implementations

    FeatureSpecification objects decouple the configuration of
    spring container features from the concern of parsing XML
    namespaces, allowing for reuse in code-based configuration
    (see @Feature* annotations below).

    * ComponentScanSpec
    * TxAnnotationDriven
    * MvcAnnotationDriven
    * MvcDefaultServletHandler
    * MvcResources
    * MvcViewControllers

Refactor associated BeanDefinitionParsers to delegate to new impls above

    The following BeanDefinitionParser implementations now deal only
    with the concern of XML parsing.  Validation is handled by their
    corresponding FeatureSpecification object.  Bean definition creation
    and registration is handled by their corresponding
    FeatureSpecificationExecutor type.

    * ComponentScanBeanDefinitionParser
    * AnnotationDrivenBeanDefinitionParser (tx)
    * AnnotationDrivenBeanDefinitionParser (mvc)
    * DefaultServletHandlerBeanDefinitionParser
    * ResourcesBeanDefinitionParser
    * ViewControllerBeanDefinitionParser

Update AopNamespaceUtils to decouple from XML (DOM API)

    Methods necessary for executing TxAnnotationDriven specification
    (and eventually, the AspectJAutoProxy specification) have been
    added that accept boolean arguments for whether to proxy
    target classes and whether to expose the proxy via threadlocal.

    Methods that accepted and introspected DOM Element objects still
    exist but have been deprecated.

Introduce @FeatureConfiguration classes and @Feature methods

    Allow for creation and configuration of FeatureSpecification objects
    at the user level.  A companion for @Configuration classes allowing
    for completely code-driven configuration of the Spring container.

    See changes in ConfigurationClassPostProcessor for implementation
    details.

    See Feature*Tests for usage examples.

    FeatureTestSuite in .integration-tests is a JUnit test suite designed
    to aggregate all BDP and Feature* related tests for a convenient way
    to confirm that Feature-related changes don't break anything.
    Uncomment this test and execute from Eclipse / IDEA. Due to classpath
    issues, this cannot be compiled by Ant/Ivy at the command line.

Introduce @FeatureAnnotation meta-annotation and @ComponentScan impl

    @FeatureAnnotation provides an alternate mechanism for creating
    and executing FeatureSpecification objects.  See @ComponentScan
    and its corresponding ComponentScanAnnotationParser implementation
    for details.  See ComponentScanAnnotationIntegrationTests for usage
    examples

Introduce Default[Formatting]ConversionService implementations

    Allows for convenient instantiation of ConversionService objects
    containing defaults appropriate for most environments.  Replaces
    similar support originally in ConversionServiceFactory (which is now
    deprecated). This change was justified by the need to avoid use
    of FactoryBeans in @Configuration classes (such as
    FormattingConversionServiceFactoryBean). It is strongly preferred
    that users simply instantiate and configure the objects that underlie
    our FactoryBeans. In the case of the ConversionService types, the
    easiest way to do this is to create Default* subtypes. This also
    follows convention with the rest of the framework.

Minor updates to util classes

    All in service of changes above. See diffs for self-explanatory
    details.

    * BeanUtils
    * ObjectUtils
    * ReflectionUtils

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3954 50f2f4bb-b051-0410-bef5-90022cba6387
2011-02-08 14:42:33 +00:00
Andy Clement fb2e3af50c more projection tests - verifying the typedescriptor changes made by Keith
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3891 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-07 19:14:42 +00:00
Keith Donald 61d54ae436 Favor convertValue(Object, TypeDescriptor) where possible and TypedValue(Object); check with Andy on Selection and Projection TypedValue usage
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3881 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-07 06:32:21 +00:00
Keith Donald 97033d66fb switched to better encapsulated convert(Object, TypeDescriptor) where possible
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3880 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-07 05:57:25 +00:00
Chris Beams 835a3f8d64 Refactor Environment and PropertySource
* Environment now extends PropertyResolver
* Environment no longer exposes resolver and sources
* PropertySource is String,Object instead of String,String
* PropertySource no longer assumes enumerability of property names
* Introduced EnumerablePropertySource for those that do have enumerable property names

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3862 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-05 22:24:14 +00:00
Keith Donald 1e2a8083a1 TypeDescriptor cleanup and general polishing; fixed a number of bugs related to TypeDescriptor usage in client code across beans and spel packages
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3846 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-05 05:49:33 +00:00
Chris Beams 1ac7b56caf M1 cut of environment, profiles and property work (SPR-7508)
Decomposed Environment interface into PropertySources, PropertyResolver
objects

    Environment interface and implementations are still present, but
    simpler.

    PropertySources container aggregates PropertySource objects;
    PropertyResolver provides search, conversion, placeholder
    replacement. Single implementation for now is
    PropertySourcesPlaceholderResolver

Renamed EnvironmentAwarePropertyPlaceholderConfigurer to
PropertySourcesPlaceholderConfigurer

    <context:property-placeholder/> now registers PSPC by default, else
    PPC if systemPropertiesMode* settings are involved

Refined configuration and behavior of default profiles

    See Environment interface Javadoc for details

Added Portlet implementations of relevant interfaces:

    * DefaultPortletEnvironment
    * PortletConfigPropertySource, PortletContextPropertySource
    * Integrated each appropriately throughout Portlet app contexts

Added protected 'createEnvironment()' method to AbstractApplicationContext

    Subclasses can override at will to supply a custom Environment
    implementation.  In practice throughout the framework, this is how
    Web- and Portlet-related ApplicationContexts override use of the
    DefaultEnvironment and swap in DefaultWebEnvironment or
    DefaultPortletEnvironment as appropriate.

Introduced "stub-and-replace" behavior for Servlet- and Portlet-based
PropertySource implementations

    Allows for early registration and ordering of the stub, then
    replacement with actual backing object at refresh() time.

    Added AbstractApplicationContext.initPropertySources() method to
    support stub-and-replace behavior. Called from within existing
    prepareRefresh() method so as to avoid impact with
    ApplicationContext implementations that copy and modify AAC's
    refresh() method (e.g.: Spring DM).

    Added methods to WebApplicationContextUtils and
    PortletApplicationContextUtils to support stub-and-replace behavior

Added comprehensive Javadoc for all new or modified types and members

Added XSD documentation for all new or modified elements and attributes

    Including nested <beans>, <beans profile="..."/>, and changes for
    certain attributes type from xsd:IDREF to xsd:string

Improved fix for detecting non-file based Resources in
PropertiesLoaderSupport (SPR-7547, SPR-7552)

    Technically unrelated to environment work, but grouped in with
    this changeset for convenience.

Deprecated (removed) context:property-placeholder
'system-properties-mode' attribute from spring-context-3.1.xsd

    Functionality is preserved for those using schemas up to and including
    spring-context-3.0.  For 3.1, system-properties-mode is no longer
    supported as it conflicts with the idea of managing a set of property
    sources within the context's Environment object. See Javadoc in
    PropertyPlaceholderConfigurer, AbstractPropertyPlaceholderConfigurer
    and PropertySourcesPlaceholderConfigurer for details.

Introduced CollectionUtils.toArray(Enumeration<E>, A[])

Work items remaining for 3.1 M2:

    Consider repackaging PropertySource* types; eliminate internal use
    of SystemPropertyUtils and deprecate

    Further work on composition of Environment interface; consider
    repurposing existing PlaceholderResolver interface to obviate need
    for resolve[Required]Placeholder() methods currently in Environment.

    Ensure configurability of placeholder prefix, suffix, and value
    separator when working against an AbstractPropertyResolver

    Add JNDI-based Environment / PropertySource implementatinos

    Consider support for @Profile at the @Bean level

    Provide consistent logging for the entire property resolution
    lifecycle; consider issuing all such messages against a dedicated
    logger with a single category.

    Add reference documentation to cover the featureset.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3839 50f2f4bb-b051-0410-bef5-90022cba6387
2011-01-03 09:04:34 +00:00
Juergen Hoeller 37957aee1e revised TypedValue toString representation (SPR-7569)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3733 50f2f4bb-b051-0410-bef5-90022cba6387
2010-10-10 21:29:18 +00:00
Juergen Hoeller 73480a5431 pass full TypeDescriptor context through to ConversionService calls (SPR-7519)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3661 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-08 17:26:02 +00:00
Juergen Hoeller 118b0b0b80 SpEL supports projection on any kind of Collection (SPR-7493)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3630 50f2f4bb-b051-0410-bef5-90022cba6387
2010-09-01 21:55:39 +00:00
Juergen Hoeller 425b471694 SpEL passes full collection type context to ConversionService (SPR-7410)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3542 50f2f4bb-b051-0410-bef5-90022cba6387
2010-08-07 17:54:23 +00:00
Andy Clement 3f09b6a313 SPR-7335: support for expression inline lists and array construction
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3473 50f2f4bb-b051-0410-bef5-90022cba6387
2010-07-06 21:00:54 +00:00
Sam Brannen 0a6eb139c4 [SPR-7323] SpEL 'select last' operator now works consistently with maps.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3461 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-26 21:10:20 +00:00
Juergen Hoeller 463cd8e0b0 avoid ConverterNotFoundException if source object is assignable to target type
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3426 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-15 09:35:39 +00:00
Juergen Hoeller ca716a9697 smarter guessing of the element type (SPR-7283)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3418 50f2f4bb-b051-0410-bef5-90022cba6387
2010-06-14 22:58:18 +00:00
Andy Clement d8c51fdf7f SPR-7244: double indexing with a collection of different types of element
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3377 50f2f4bb-b051-0410-bef5-90022cba6387
2010-05-28 20:31:16 +00:00
Andy Clement a276e7c21a SPR-7209: parsing poorly formed Elvis expressions
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3349 50f2f4bb-b051-0410-bef5-90022cba6387
2010-05-18 18:44:40 +00:00
Andy Clement 4e32e896ab SPR-6941
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3314 50f2f4bb-b051-0410-bef5-90022cba6387
2010-05-06 00:26:13 +00:00
Andy Clement dedf6489ac SPR-7173, SPR-7100
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3313 50f2f4bb-b051-0410-bef5-90022cba6387
2010-05-05 23:52:01 +00:00
Keith Donald eca3e5d0b8 improved conversion system logging, collection converter simplification/polish, several optimizations, annotation-driven formatting caching
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3255 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-17 04:43:28 +00:00
Andy Clement efc8a513d1 SPR-7100: '_' supported as first char of identifier
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3254 50f2f4bb-b051-0410-bef5-90022cba6387
2010-04-16 21:10:23 +00:00
Andy Clement 3b8b27e391 SPR-6984: auto grow collections on write through indexer
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3109 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-15 18:15:48 +00:00
Andy Clement 0d3e60e5b7 SPR-6968: indexing via square brackets can now treat the index as an attempt at property access
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3080 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-11 01:09:50 +00:00
Andy Clement e996bd83ff SPR-6941: part (1) correct exception handling when null cachedExecutor
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3071 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-09 17:33:36 +00:00
Andy Clement 43ea572fd5 SPR-6866: unhelpful NPE when expression badly formed
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3064 50f2f4bb-b051-0410-bef5-90022cba6387
2010-03-09 00:55:03 +00:00
Andy Clement 878f937f23 SPR-6745: metadata (annotations) attached to property accessors allowing formatting of values during conversion
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2964 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-12 01:50:52 +00:00
Andy Clement 5024290980 SPR-6763: more methods on StandardEvaluationContext supporting add/remove from resolver/accessor strategies
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2902 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-02 21:38:33 +00:00
Andy Clement 21cb4a0bfc SPR-6764: filtering strategy for SpEL method invocation
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2901 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-02 19:38:44 +00:00
Andy Clement 55f8409ea0 SPR-6610: don't wrap runtime exceptions thrown from methods invoked via an expression
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2899 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-01 20:13:08 +00:00
Andy Clement a8ee8c4cda SPR-6760: method called twice if exits via exception in a 'normal' case
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2897 50f2f4bb-b051-0410-bef5-90022cba6387
2010-02-01 19:53:34 +00:00
Juergen Hoeller 4989bb6379 TypedValue.NULL_TYPED_VALUE -> TypedValue.NULL
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2684 50f2f4bb-b051-0410-bef5-90022cba6387
2009-12-15 20:19:24 +00:00
Keith Donald b34a2ab777 TypeDescriptor.valueOf usage in favor of constants; TypedValue usage simplification
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2681 50f2f4bb-b051-0410-bef5-90022cba6387
2009-12-15 19:41:52 +00:00
Juergen Hoeller 18336e3732 introduced TypeDescriptor.OBJECT and TypeDescriptor.STRING
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2668 50f2f4bb-b051-0410-bef5-90022cba6387
2009-12-15 10:21:16 +00:00
Juergen Hoeller cb9770c11b rearranged spel subpackages in order to avoid package dependency cycle; introduced SpelParserConfiguration object to replace bit flags
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2664 50f2f4bb-b051-0410-bef5-90022cba6387
2009-12-15 02:03:16 +00:00
Andy Clement 1eb653a1b8 SPR-6525: avoid need to use #root for method parameter references
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2585 50f2f4bb-b051-0410-bef5-90022cba6387
2009-12-06 23:21:07 +00:00
Keith Donald 9d1daf3232 found hotspot; added ConverisonServiceFactoryBean
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2473 50f2f4bb-b051-0410-bef5-90022cba6387
2009-11-20 14:43:12 +00:00
Keith Donald 12b6feacac moved generic converter to spi; added entity converter; removed various service impls in favor of service factory
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2447 50f2f4bb-b051-0410-bef5-90022cba6387
2009-11-19 09:10:51 +00:00
Andy Clement 3e5b5b8172 change PlaceOfBirth toString() so round tripping from String > new PlaceOfBirth(String) > String works ok
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2417 50f2f4bb-b051-0410-bef5-90022cba6387
2009-11-12 20:56:21 +00:00
Keith Donald e9b484b20e fixed failing tests due to generic object to object converter fallback being over eager
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2383 50f2f4bb-b051-0410-bef5-90022cba6387
2009-11-12 06:57:51 +00:00
Mark Fisher 3bba4a39cd SPR-6059 Avoiding NPE for OR operator. If the value is null instead of a valid boolean or Boolean, it will now trigger an EvaluationException.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2223 50f2f4bb-b051-0410-bef5-90022cba6387
2009-10-28 23:14:29 +00:00
Mark Fisher 04067a06e0 SPR-6059 Avoiding NPE for unary-not and ternary operators. If the value is null instead of a valid boolean or Boolean, it will now trigger an EvaluationException.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2221 50f2f4bb-b051-0410-bef5-90022cba6387
2009-10-28 21:57:09 +00:00
Mark Fisher 678fc544cf INT-6051 SpEL selection and projection may now be applied to arrays.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2213 50f2f4bb-b051-0410-bef5-90022cba6387
2009-10-28 03:42:36 +00:00
Andy Clement fd15a9a822 SPR-6230: SpEL improvements
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2095 50f2f4bb-b051-0410-bef5-90022cba6387
2009-10-13 18:11:34 +00:00