[ http://issues.apache.org/jira/browse/XBEAN-36?page=all ]
Hiram Chirino updated XBEAN-36: ------------------------------- Description: This patch allows you to configure a PropertyEditor for any property. For example, if you annotate a property as follows: /** * Sets the amount of beer remaining in the keg (in ml) * * @org.apache.xbean.Property propertyEditor="org.apache.xbean.spring.example.MilliLittersPropertyEditor" * @param remaining */ public void setRemaining(long remaining) { this.remaining = remaining; } Then when you configure the value of the 'remaining' property in xbean then the MilliLittersPropertyEditor will be used to convert the string value to a long. In the test case, our MilliLittersPropertyEditor can handle converting different units of measurement to ml. For example: <beans xmlns:x="http://xbean.apache.org/schemas/pizza"> <x:keg id="ml1000" remaining="1000 ml"/> <x:keg id="pints5" remaining="5 pints"/> <x:keg id="liter20" remaining="20 liter"/> <x:keg id="empty" remaining="0"/> </beans> > [RTC] Support annotating properties with the ProperyEditor that should be > used when wiring in the value. > -------------------------------------------------------------------------------------------------------- > > Key: XBEAN-36 > URL: http://issues.apache.org/jira/browse/XBEAN-36 > Project: XBean > Issue Type: New Feature > Components: spring > Reporter: Hiram Chirino > Assigned To: Hiram Chirino > Fix For: 2.6 > > Attachments: XBEAN-36.patch > > > This patch allows you to configure a PropertyEditor for any property. For > example, if you annotate a property as follows: > /** > * Sets the amount of beer remaining in the keg (in ml) > * > * @org.apache.xbean.Property > propertyEditor="org.apache.xbean.spring.example.MilliLittersPropertyEditor" > * @param remaining > */ > public void setRemaining(long remaining) { > this.remaining = remaining; > } > Then when you configure the value of the 'remaining' property in xbean then > the MilliLittersPropertyEditor will be used to convert the string value to a > long. In the test case, our MilliLittersPropertyEditor can handle converting > different units of measurement to ml. For example: > <beans xmlns:x="http://xbean.apache.org/schemas/pizza"> > <x:keg id="ml1000" remaining="1000 ml"/> > <x:keg id="pints5" remaining="5 pints"/> > <x:keg id="liter20" remaining="20 liter"/> > <x:keg id="empty" remaining="0"/> > </beans> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira