Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.config.java.valuesource
Class CompositeValueResolver

    java.lang.Object
      org.springframework.config.java.valuesource.CompositeValueResolver

All Implemented Interfaces:
  ValueResolver

    public class CompositeValueResolver

extends java.lang.Object
implements ValueResolver

Aggregates one or more `ValueResolver` instances, delegating calls to `resolve(String, Class)`.

Author:
  Rod Johnson, Chris Beams

Constructor Summary
`CompositeValueResolver(java.util.Map<java.lang.String,ValueResolver> resolvers)` Creates a new `CompositeValueResolver` instance based on a map of `ValueResolver` instances.

Method Summary
`void` | `add(ValueResolver resolver)`
`static CompositeValueResolver` | `forMember(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, java.lang.reflect.Field field)` Aggregates any `ValueResolver` beans from beanFactory into a new `CompositeValueResolver` instance.
`static CompositeValueResolver` | `forMember(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, java.lang.reflect.Method method)` Aggregates any `ValueResolver` beans from beanFactory into a new `CompositeValueResolver` instance.
`
`<T> T`
` | `resolve(java.lang.String name, java.lang.Class<?> requiredType)` Resolves name against underlying value source, returning type specified by requiredType.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CompositeValueResolver

    public CompositeValueResolver(java.util.Map<java.lang.String,ValueResolver> resolvers)

  Creates a new `CompositeValueResolver` instance based on a map of `ValueResolver` instances.

  Instances are sorted in reverse-order of the names of their keys in the map.

  Parameters:
    `resolvers` - resolvers to aggregate into one composite

Method Detail

### add

    public void add(ValueResolver resolver)

### resolve

    public <T> T resolve(java.lang.String name,
                         java.lang.Class<?> requiredType)

  Description copied from interface: `ValueResolver`
  Resolves name against underlying value source, returning type specified by requiredType.

  Specified by:
    `resolve` in interface `ValueResolver`
  Parameters:
    `name` - name of the value to resolve
    `requiredType` - work around Java type erasure

### forMember

    public static CompositeValueResolver forMember(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory,
                                                   java.lang.reflect.Field field)

  Aggregates any `ValueResolver` beans from beanFactory into a new `CompositeValueResolver` instance.

  Parameters:
    `beanFactory` - enclosing bean factory containing one or more ValueResolver beans
    `field` - supplied for error-reporting purposes
  Returns:
    `CompositeValueResolver` instance
  Throws:
    `java.lang.IllegalStateException` - if no ValueResolver instances can be found in beanFactory

### forMember

    public static CompositeValueResolver forMember(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory,
                                                   java.lang.reflect.Method method)

  Aggregates any `ValueResolver` beans from beanFactory into a new `CompositeValueResolver` instance.

  Parameters:
    `beanFactory` - enclosing bean factory containing one or more ValueResolver beans
    `method` - supplied for error-reporting purposes
  Returns:
    `CompositeValueResolver` instance
  Throws:
    `java.lang.IllegalStateException` - if no ValueResolver instances can be found in beanFactory

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD