Ik heb een class AccountManager, waar een aantal object Account in kunnen zitten. Om deze op te slaan dacht ik xml te gebruiken, maar de sun site maakt me ook niet echt veel wijzer.
Dit is m'n eerste contact met xml trouwens.
Dit is het bestand dat ik zou willen bekomen:
Dit is m'n eerste contact met xml trouwens.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| public class Account {
// server information
String alias;
String incoming;
String outgoing;
String account;
String password;
// personal information
String name;
String email;
String replyTo;
String signature;
public Account(String alias, String incoming, String outgoing, String account, String password,
String name, String email, String replyTo, String signature) {
this.alias = alias;
this.incoming = incoming;
this.outgoing = outgoing;
this.account = account;
this.password = password;
this.name = name;
this.email = email;
this.replyTo = replyTo;
this.signature = signature;
}
public Account(String alias) {
this.alias = alias;
this.incoming = "";
this.outgoing = "";
this.account = "";
this.password = "";
this.name = "";
this.email = "";
this.replyTo = "";
this.signature = "";
}
public String toString() {
return " " + this.alias;
}
} |
Dit is het bestand dat ik zou willen bekomen:
code:
1
2
3
4
5
6
7
8
9
10
11
12
| <?xml version='1.0' encoding='utf-8'?>
<account>
<alias>Nephilim</alias>
<incoming>mail.nephilimco.com</incoming>
<outgoing>mail-out.telenet.be</outgoing>
<account>junk@nephilimco.com</account>
<password>junk</password>
<name>Nephilim</name>
<email>nephilim@nephilimco.com</email>
<replyTo></replyTo>
<signature></signature>
</account> |