Help coderanch get a
new server
by contributing to the fundraiser

Rohit Menon

Greenhorn
+ Follow
since Oct 10, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rohit Menon

Thanks Nitesh

For the useful advice.
Right now I can't him directly as I am new,
but will definitely ask when the time will come..

Regards,
Rohit
16 years ago
Thank you Ulf
I will continue as per your saying only.
Thaks a lot..

Regards,
Rohit
16 years ago
Ulf,

Means I have to parse the XML for data
And then use I/O to create Java source code file.
There is no other alternative.
Is that the final verdict?

Regards,
Rohit
16 years ago
Ulf,

I know about parsing XML using JAXP.
But after getting the parameters, do we have to use I/O stream to create a class?

But does that not seem be cumbersome??

Regards,
Rohit

[ October 12, 2007: Message edited by: Rohit Menon ]
[ October 12, 2007: Message edited by: Rohit Menon ]
16 years ago
Hi Ulf and Nitesh,

It's not my requirement.
Actually I am working somewhere and it's requirement from my manager.
And he wants it because he wants it.
Moreover, he told me to use Java Reflection.

But I don't at all need methods in that class.
I just need a class with instane varibles only, with details defined in XML as I have described in code snippet in my earlier post. That's the requirement

Please if any one of you can help me.
Or let me know what I should do as I am just a beginner in this software industry.

Regards,
Rohit
[ October 11, 2007: Message edited by: Rohit Menon ]
16 years ago

Or are you looking to generate the Java source code? In that case there wouldn't be much more to it than parsing the XML and using file I/O to write the source file.



Yes Ulf, I need to generate the source code at runtime using properties from XMl.

And that's too using Java Reflection as being told. That's the main proprblem
I am familier with Reflection for calling methods at run time.
But not such kind of thing in which we have to read data from XML and creat Java source code as per that..

Regards,
Rohit
[ October 11, 2007: Message edited by: Rohit Menon ]
16 years ago
Hi Ulf,

Let's consider my xml contains something like this.


Note: The parameter numbers, types may vary.

And now I want to have a java class like this using Relection at runtime.



Regards,
Rohit
16 years ago
Please Help.. How to create a java class with parame from xml using Reflection.

Actually I have been provided with an XML file and have been told to use Java Reflection to create a java class with parameters whose details are provided in XML file.

I am completely blank what to do?

Regards,
Rohit
[ October 11, 2007: Message edited by: Ulf Dittmer ]
16 years ago