Issue Details (XML | Word | Printable)

Key: CONFIGURATION-331
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Oliver Heger
Reporter: Frank Haefemeier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Configuration

Missing factory method in XMLBeanDeclaration.getNestedBeanDeclarations

Created: 15/Jun/08 04:40 PM   Updated: 22/Aug/09 07:36 PM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Not Specified

Resolution Date: 23/Jun/08 08:38 PM


 Description  « Hide
I create a new BeanDeclaration class on base of XMLBeanDeclaration to extend the behaviour to fill up bean properties with pure XML text nodes. But the problem was, that the method getNestedBeanDeclaration create for all nested child new XMLBeanDeclarations and there
is no way to get my own class. I have to implement the whole method getNestedBeanDeclaration as a copy from the parent class.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Oliver Heger added a comment - 15/Jun/08 07:37 PM
So you propose a method like
/**
 * Creates a nested <code>BeanDeclaration</code> for a child node of the current configuration node.
 * @param node the affected child node
 * @return the <code>BeanDeclaration</code> for this child node
 */
protected BeanDeclaration(ConfigurationNode node);

in XMLBeanDeclaration. This seems reasonable to me. Are you fine with this method signature?


Frank Haefemeier added a comment - 15/Jun/08 11:13 PM
IMHO more convenient for the method would be
/**
 * Creates a nested <code>BeanDeclaration</code> for a child node of the current configuration node.
 * @param node the affected child node
 * @return the <code>BeanDeclaration</code> for this child node
 */
protected BeanDeclaration createBeanDeclaration(ConfigurationNode node);

I think, this is what you thought as you wrote it, right? Your proposal looks like a constructor...

Additional the method getNestedBeanDeclaration has to be changed to use this new factory method.


Oliver Heger added a comment - 16/Jun/08 07:41 PM
Yes of course, this was what I had in mind.

I will have a look to integrate this feature into the next release. Thanks for the suggestion.


Oliver Heger made changes - 16/Jun/08 07:42 PM
Field Original Value New Value
Affects Version/s 1.3 [ 12312092 ]
Affects Version/s 1.5 [ 12312239 ]
Fix Version/s 1.6 [ 12312450 ]
Issue Type Bug [ 1 ] Improvement [ 4 ]
Oliver Heger made changes - 23/Jun/08 07:54 PM
Assignee Oliver Heger [ oliver.heger@t-online.de ]
Repository Revision Date User Message
ASF #670739 Mon Jun 23 20:36:37 UTC 2008 oheger CONFIGURATION-331: Added a factory method to XMLBeanDeclaration for creating the declarations for complex nested properties.
Files Changed
MODIFY /commons/proper/configuration/trunk/xdocs/changes.xml
MODIFY /commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/beanutils/TestXMLBeanDeclaration.java
MODIFY /commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/XMLBeanDeclaration.java

Repository Revision Date User Message
ASF #670741 Mon Jun 23 20:37:59 UTC 2008 oheger CONFIGURATION-331: Added a factory method to XMLBeanDeclaration for creating the declarations for complex nested properties. Ported changes from trunk to this branch.
Files Changed
MODIFY /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java
MODIFY /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestXMLBeanDeclaration.java
MODIFY /commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml

Oliver Heger added a comment - 23/Jun/08 08:38 PM
Fixed in subversion. Thanks for this suggestion.

Oliver Heger made changes - 23/Jun/08 08:38 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Oliver Heger made changes - 22/Aug/09 07:36 PM
Status Resolved [ 5 ] Closed [ 6 ]