KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > core > dm > ddf > Ext


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.framework.core.dm.ddf;
20
21 import java.util.Hashtable JavaDoc;
22 import java.util.Map JavaDoc;
23 import java.util.HashMap JavaDoc;
24 import java.beans.XMLEncoder JavaDoc;
25
26
27 /**
28  * Corresponds to the <PX> interior node in the management tree
29  *
30  * @author Stefano Nichele @ Funambol
31  *
32  * @version $Id: Ext.java,v 1.1 2005/05/16 17:32:55 nichele Exp $
33  */

34 public class Ext {
35
36     // --------------------------------------------------------------- Constants
37

38     // ------------------------------------------------------------ Private data
39

40     // contains the nodes
41
private Map JavaDoc nodes;
42
43     private String JavaDoc nome;
44
45     // ------------------------------------------------------------ Constructors
46
/** For serialization purposes */
47     public Ext() {
48         this.nodes = new HashMap JavaDoc();
49     }
50
51     /**
52      * Sets a node
53      * @param name String
54      * @param value String
55      */

56     public void setNode(String JavaDoc name, String JavaDoc value) {
57         nodes.put(name, value);
58     }
59
60     /**
61      * Sets a node
62      * @param name String
63      * @param value String
64      */

65     public void getNode(String JavaDoc name, String JavaDoc value) {
66
67     }
68
69     public void setNome(String JavaDoc nome) {
70         this.nome = nome;
71     }
72
73     public String JavaDoc getNome() {
74         return nome;
75     }
76
77     /**
78      * Returns the nodes
79      * @return the nodes
80      */

81     public Map JavaDoc getNodes() {
82         return nodes;
83     }
84
85     // ---------------------------------------------------------- Public methods
86

87     public static void main(String JavaDoc[] args) {
88
89         Ext ext = new Ext();
90         ext.setNode("service", "5");
91         ext.setNome("pippo");
92         XMLEncoder JavaDoc enc = new XMLEncoder JavaDoc(System.out);
93         enc.writeObject(ext);
94         enc.flush();
95         enc.close();
96     }
97 }
Popular Tags