title: using spring, can I extract some part of a static method to use to set a property on a bean?
body: <p>I have a static method I have no control over: <code>MyUtils.getServiceURL()</code> which returns a URL. I need to extract just the port from this URL to set a property on a bean:</p>
  
  <pre><code>&lt;bean id="myBean&gt;
     &lt;property name="defaultPort" value="?????"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I can get the string value of the URL as a bean like this:</p>
  
  <pre><code>&lt;bean id="serviceURL" class="MyUtils" factory-method="getServiceURL" /&gt;
  </code></pre>
  
  <p>I'm probably just going to write a method to parse the URL in <code>myBean</code> and extract the port. I was wondering if there was a way to avoid having to do this, and configure this directly in the spring context?</p>