AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

load properties from xml into objects

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Petterson Mikael
Guest





PostPosted: Wed Oct 25, 2006 7:11 pm    Post subject: load properties from xml into objects Reply with quote



Hi,

I have an xml file with properties:

<?xml version="1.0" encoding="UTF-8"?>
<plugins>
<plugin>
<featureid>org.eclipse.platform</featureid>
<version>3.0.0</version>
<actiontype>install</actiontype>
<description></description>
<url>http://update.eclipse.org/updates/3.0</url>
</plugin>

<plugin>
<featureid>org.eclipse.check</featureid>
<version>3.1.0</version>
<actiontype>update</actiontype>
<description></description>
<url>http://update.eclipse.org/updates/3.1</url>
</plugin>
</plugins>

Plugin class
------------

ublic class Plugin {
private String featureId = null;
public Plugin(String featureId, String version, String actionType,
String description, String url){

}

//Then apply get and set methods.


}

I need to read this file and create plugin objects containing this
information. Any hints on how I can do this easily?



cheers,

//mikael
Back to top
Bart Cremers
Guest





PostPosted: Wed Oct 25, 2006 7:27 pm    Post subject: Re: load properties from xml into objects Reply with quote



Petterson Mikael wrote:
Quote:
Hi,

snip

I need to read this file and create plugin objects containing this
information. Any hints on how I can do this easily?



cheers,

//mikael

Use a SAX parser to read the xml file.

Store the tag data in fields in the handler by correctly writing the
startTag handling code. On the endTag for a Plugin tag you can create
instances of the Plugin class using the collected data.

Regards,

Bart
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.