Filling Java Vector using XML Config file

H

homi

Hi All,

I am writing a Java code that uses a XML Config file to configure
itself. Sample of the XML file has shown below. I want to have a peace
of java code to reads that config file and import all the data to a
class structure that I have designed before. In this case I will have
a class name AppGroup and the whole config file will be stored in
array of AppGroup objects. What is the best was of doing such a thing.
I’ve already looked at Castor but seem to complicate to me.
Thanks in advance for your help.


<?xml version="1.0"?>

<FConfig>
<ExtraConf>
<Name>TEST</Name>
<Timeout>100</Timeout>
</ExtraConf>
<AppGroup>
<Other>
<AppName>BILL5</AppName>
<FileSequenceIn>aaabbb</FileSequenceIn>
<TransferAlarm>transAlarmCall</TransferAlarm>
</Other>
<TransConf>
<Direction>INPUT</Direction>
<SourceDir>/client/home/ttt</SourceDir>
<FilePattern>aaavvv</FilePattern>
<TargetDir>/home/rrr</TargetDir>
<StateFile>auditState</StateFile>
</TransConf>
<TransConf>
<Direction>OUTPUT</Direction>
<SourceDir>/client/home/ggg</SourceDir>
<FilePattern>aaaeee</FilePattern>
<TargetDir>/home/yyy</TargetDir>
<StateFile>auditState2</StateFile>
</TransConf>
</AppGroup>
<AppGroup>
………………………..
</AppGroup>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top