Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.2
-
Fix Version/s: 1.2
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
I've attached a patch to BeanPropertyComponentAdapter to allow it to handle real objects for parameters (such as Date objects, Calendars, etc).
3 Test Cases attached as well. The main one (for explanation's sake is
public void testSetBeanPropertiesWithValueObjects()
{ BeanPropertyComponentAdapterFactory factory = (BeanPropertyComponentAdapterFactory) createComponentAdapterFactory(); Map properties = new HashMap(); properties.put("lenient", Boolean.FALSE); properties.put("2DigitYearStart", new Date(0)); BeanPropertyComponentAdapter adapter = (BeanPropertyComponentAdapter)factory.createComponentAdapter(SimpleDateFormat.class,SimpleDateFormat.class,null); adapter.setProperties(properties); picoContainer.registerComponent(adapter); SimpleDateFormat dateFormat = (SimpleDateFormat)picoContainer.getComponentInstance(SimpleDateFormat.class); assertNotNull(dateFormat); assertEquals(false, dateFormat.isLenient()); assertEquals(new Date(0), dateFormat.get2DigitYearStart()); }Issue Links
- is related to
-
PICO-267 Using javabeans PropertyEditors with BeanPropertyComponentAdapter
Activity
peter royal
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | BeanPropertyComponentAdapter.diff [ 16386 ] |
peter royal
made changes -
Attachment | BeanPropertyComponentAdapter.diff [ 16399 ] |
peter royal
made changes -
Assignee | peter royal [ proyal ] |
peter royal
made changes -
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.2 [ 11330 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Grégory Joseph
made changes -
Updated patch for current state of the trunk