org.reactive.beans.factory.config
Class ConfigurationPlaceholderProcessor

java.lang.Object
  extended by org.reactive.beans.factory.config.ConfigurationPlaceholderProcessor
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered

public class ConfigurationPlaceholderProcessor
extends java.lang.Object
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.BeanFactoryAware

Allows for configuration of individual bean property values from a configuration resource.

Note: This class is based heavily on the org.springframework.beans.factory.config.PropertyPlaceholderConfigurer by Juergen Hoeller

Since:
16.12.2004
Version:
$Id: ConfigurationPlaceholderProcessor.java,v 1.1 2004/12/26 23:42:29 dan_washusen Exp $
Author:
Dan Washusen

Field Summary
protected  PlaceholderEvaluator placeholderEvaluator
          Used to evaluate placeholders with their actual values
protected  PlaceholderMatcher placeholderMatcher
          Used to determine if the value from the bean factory requires evaluation.
 
Constructor Summary
ConfigurationPlaceholderProcessor()
           
 
Method Summary
 org.springframework.beans.factory.BeanFactory getBeanFactory()
           
 java.lang.String getBeanName()
           
 int getOrder()
           
 PlaceholderEvaluator getPlaceholderEvaluator()
          Returns the implementation of PlaceholderEvaluator used to evaluate placeholder values.
 PlaceholderMatcher getPlaceholderMatcher()
          Returns the implementation of PlaceholderMatcher used to determine if a value requires evalutation.
 void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableListableBeanFactory)
          Processes the bean definitions available in the provided ConfigurableListableBeanFactory.
protected  void processBeanDefinition(org.springframework.beans.factory.config.BeanDefinition beanDefinition)
          Process a single bean definition, processing the property values, indexed argument and generic argument contrsuctor values if there are any.
protected  void processConstructorArgumentValues(java.util.Collection genericArgumentValues)
          Process the constructor argument values.
protected  void processList(java.util.List listValue)
          Parse the given List, resolving its values if necessary.
protected  void processMap(java.util.Map mapValue)
          Parse the given Map, resolving its values if necessary.
protected  void processPropertyValues(org.springframework.beans.MutablePropertyValues mutablePropertyValues)
          Process the property values.
protected  void processSet(java.util.Set setValue)
          Parse the given Set, resolving its values if necessary.
protected  java.lang.Object processString(java.lang.String value)
          This is the root of all parsing.
protected  java.lang.Object processValue(java.lang.Object value)
          Parses the value by delegating to a more appropriate parse method.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setBeanName(java.lang.String beanName)
           
 void setOrder(int order)
           
 void setPlaceholderEvaluator(PlaceholderEvaluator placeholderEvaluator)
          Sets the implementation of PlaceholderEvaluator used to evaluate placeholder values.
 void setPlaceholderMatcher(PlaceholderMatcher placeholderMatcher)
          Sets the implementation of PlaceholderMatcher used to determine if a value requires evalutation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

placeholderEvaluator

protected PlaceholderEvaluator placeholderEvaluator
Used to evaluate placeholders with their actual values


placeholderMatcher

protected PlaceholderMatcher placeholderMatcher
Used to determine if the value from the bean factory requires evaluation. By default DefaultPlaceholderMatcher is used.

Constructor Detail

ConfigurationPlaceholderProcessor

public ConfigurationPlaceholderProcessor()
Method Detail

getOrder

public int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered

setOrder

public void setOrder(int order)

getBeanName

public java.lang.String getBeanName()

setBeanName

public void setBeanName(java.lang.String beanName)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

getBeanFactory

public org.springframework.beans.factory.BeanFactory getBeanFactory()

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

getPlaceholderEvaluator

public PlaceholderEvaluator getPlaceholderEvaluator()
Returns the implementation of PlaceholderEvaluator used to evaluate placeholder values.

Returns:
The place holder eveluator

setPlaceholderEvaluator

public void setPlaceholderEvaluator(PlaceholderEvaluator placeholderEvaluator)
Sets the implementation of PlaceholderEvaluator used to evaluate placeholder values.

Parameters:
placeholderEvaluator - The place holder eveluator

getPlaceholderMatcher

public PlaceholderMatcher getPlaceholderMatcher()
Returns the implementation of PlaceholderMatcher used to determine if a value requires evalutation.

Returns:
The place holder matcher

setPlaceholderMatcher

public void setPlaceholderMatcher(PlaceholderMatcher placeholderMatcher)
Sets the implementation of PlaceholderMatcher used to determine if a value requires evalutation.

Parameters:
placeholderEvaluator - The place holder matcher

postProcessBeanFactory

public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableListableBeanFactory)
                            throws org.springframework.beans.BeansException
Processes the bean definitions available in the provided ConfigurableListableBeanFactory.

This method ensures it does not process itself or other bean factories.

Specified by:
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
Parameters:
configurableListableBeanFactory - The bean factory to process.
Throws:
org.springframework.beans.BeansException - If an error occurrs while processing a bean definition

processBeanDefinition

protected void processBeanDefinition(org.springframework.beans.factory.config.BeanDefinition beanDefinition)
Process a single bean definition, processing the property values, indexed argument and generic argument contrsuctor values if there are any.

Parameters:
beanDefinition - The bean definition to be processed

processPropertyValues

protected void processPropertyValues(org.springframework.beans.MutablePropertyValues mutablePropertyValues)
Process the property values.

Parameters:
mutablePropertyValues - The mutable property values

processConstructorArgumentValues

protected void processConstructorArgumentValues(java.util.Collection genericArgumentValues)
Process the constructor argument values.

Parameters:
genericArgumentValues - the constructor argument values

processValue

protected java.lang.Object processValue(java.lang.Object value)
Parses the value by delegating to a more appropriate parse method.

Parameters:
value - The value to be parsed
Returns:
The parsed value

processString

protected java.lang.Object processString(java.lang.String value)
This is the root of all parsing. In the end everything (should) evaluate down to a String. Here, if the placeholder matcher confirms that value needs evaluating, we look up the value using the evaluator and return the matching object.

Parameters:
value - The value to the evaluated
Returns:
The object returned from the evaluator if the value was evaluated, otherwise the original value

processList

protected void processList(java.util.List listValue)
Parse the given List, resolving its values if necessary.

Parameters:
listValue - The list to be evaluated

processSet

protected void processSet(java.util.Set setValue)
Parse the given Set, resolving its values if necessary.

Parameters:
setValue - The set to be evaluated

processMap

protected void processMap(java.util.Map mapValue)
Parse the given Map, resolving its values if necessary.

Parameters:
mapValue - The map to be evaluated


Copyright © 2004-2005 reactive.org. All Rights Reserved.