Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

using java reflection to dynamically update properties?

Thread view: 
Elhanan - 06 Mar 2006 21:51 GMT
hi..

for some reason i cannot use java xml blindings but here in xml i have:

<CaseObject TypeId=23>
<AttributeType TypeId=233>
<StringValue Value="Hello"/>
</AttributeType>

<AttributeType TypeId=2323>
<NumericValue Value="2"/>
</AttributeType>

</CaseObject>

what i wanna do is to create a method that given a root of an object
model in POJO as one paramater, and an xml node like the AttributeType
Element, will know to look in a special xml mapping file i will create,
and according to the typeid Attribute specfied in the mapping xml will
update the property of the root object model (or one of its class
propeties) with  the  class (like NumberClass for numberType and
StringClass for StringValue xml)

for example

for typeid=23 get Create CaseObject1 Object with the property
StringValue Property..

oh and vice versa, a function that will circle through all the
properties of the class, and for each property type create an xml node
for it.

is that possible? (don't know if told it correctly)..
Elhanan - 07 Mar 2006 07:29 GMT
ok i'm thinking BeanUtils might to the job here..
if i create this xml file

<Typid=426 class=MyClass.MyProperty>

i can do BeanUtils.setProperty(object,classasttibute,ClassObject)

now i need to think about how can create relationships this way

if have this:

<Relation Fromid=1 to Toid=2/
where fromid presents and id another xml element with this id ,and dido
for the toid attribute..

i need to both elements into classes where one class has a collections
of the other class.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.