title: How to override PropertiesFactoryBean in spring?
body: <p>I would like to override the getProperty() method in java.util.Properties class ,Please advise.</p>
  
  <p>1.Spring Context file </p>
  
  <pre><code>spring-context.xml
  
      &lt;bean id="myproperty" class="org.springframework.beans.factory.config.PropertiesFactoryBean"&gt;
              &lt;property name="locations" value="classpath:myproperties.properties" /&gt;
  
  &lt;/bean&gt; 
  </code></pre>
  
  <p>2.  Java Class</p>
  
  <pre><code>public class MyClass{
  
        @Autowired
          public void setMyproperty(Properties myproperty) {
               this.url=myproperty.getProperty("url");
           }
  
      }
  </code></pre>
  
  <p>3.Config file</p>
  
  <pre><code>myproperties.properties
  url=http://stackoverflow.com
  </code></pre>
  
  <p>Fyi : I am pulling out lot values from config file and i would like to invoke trim() once i get the value from .properties, to avoid code redundancy trying to  override the getProperty() method.  </p>
  
  <p>Using :Spring 4.0</p>