File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Suggest me good design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Suggest me good design pattern" Watch "Suggest me good design pattern" New topic
Author

Suggest me good design pattern

Nagesh Gummadivalli
Greenhorn

Joined: Oct 27, 2003
Posts: 1
Hi,
I have a configuration file which stores all the implementation class names. Snippet of xml if like below.

AccountManager name="AccountManager" type="java" namespace="com.managers.AccountManager">
AccountComponent name="AccountComponent" type="java" namespace="com.managers.AccountComponent">
/AccountComponent>
AdapterManager name="OracleAdapterManager" type="java" namespace="com.adapters.OracleAdapterManager">
/AdapterManager>
/AccountManager>


I am using xml beans so generated jar files using xml beans compiler.
Now, My question is, I need to write a generic method which instantiates the class by taking input by name( like instantiating com.adapters.OracleAdapterManager" when we pass OracleAdapterManager).
I am struggling to write generic code using XMLBeans API.
Any pointers?
[ September 25, 2006: Message edited by: Nagesh Gummadivalli ]
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Moving this to the "XML and Related Technologies forum" as you are using the XML Beans API.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Suggest me good design pattern