dol: create target object folders when generating
[jump.git] / dol / src / dol / datamodel / mapping / Configuration.java
1 /* $Id: Configuration.java 1 2010-02-24 13:03:05Z haidw $ */\r
2 package dol.datamodel.mapping;\r
3 \r
4 import dol.visitor.MapVisitor;\r
5 \r
6 /**\r
7  * This class represents a name-value pair of a configuration tag in XML.\r
8  */\r
9 public class Configuration {\r
10 \r
11     /**\r
12      * Constructor to create a Configuration.\r
13      */\r
14     public Configuration(String name, String value) {\r
15         _name = name;\r
16         _value = value;\r
17     }\r
18 \r
19     /**\r
20      * Accept a Visitor.\r
21      *\r
22      * @param x visitor object\r
23      */\r
24     public void accept(MapVisitor x) {\r
25         x.visitComponent(this);\r
26     }\r
27 \r
28     /**\r
29      * Clone this Configuration.\r
30      *\r
31      * @return new instance of the Configuration.\r
32      */\r
33     public Object clone() {\r
34         try {\r
35             Configuration newObj = (Configuration) super.clone();\r
36             newObj._name = _name;\r
37             newObj._value = _value;\r
38             return (newObj);\r
39         } catch (CloneNotSupportedException e) {\r
40             System.out.println("Error Clone not Supported");\r
41         }\r
42         return null;\r
43     }\r
44 \r
45     /**\r
46      * Get the value of the Configuration.\r
47      *\r
48      * @return the value of the configuration.\r
49      */\r
50     public String getValue() {\r
51         return _value;\r
52     }\r
53 \r
54     /**\r
55      * Get the name of this configuration.\r
56      *\r
57      * @return  the name\r
58      */\r
59     public String getName() {\r
60         return _name;\r
61     }\r
62 \r
63     /**\r
64      * Return a string representation of the Configuration.\r
65      *\r
66      * @return string representation of the Configuration\r
67      */\r
68     public String toString() {\r
69         return "Configuration: " + _name + "/" + _value;\r
70     }\r
71 \r
72     protected String _value = null;\r
73     protected String _name = null;\r
74 \r
75 }