b370b952325fa83e0ab960a5cd269753d6f12515
[jump.git] / dol / src / dol / datamodel / architecture / Configuration.java
1 /* $Id: Configuration.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.architecture;
3
4
5 /**
6  * This class represents a name-value pair of a configuration tag in XML.
7  */
8 public class Configuration {
9
10     /**
11      * Constructor to create a Configuration.
12      */
13     public Configuration(String name) {
14         _name = name;
15     }
16
17     /**
18      * Accept a Visitor.
19      *
20      * @param x visitor object
21
22     public void accept(PNVisitor x) {
23         x.visitComponent(this);
24     }
25      */
26
27     
28     /**
29      * Clone this Configuration.
30      *
31      * @return new instance of the Configuration.
32      */
33     public Object clone() {
34         try {
35             Configuration newObj = (Configuration) super.clone();
36             newObj.setName(_name);
37             newObj.setValue(_value);
38             return (newObj);
39         } catch (CloneNotSupportedException e) {
40             System.out.println("Error Clone not Supported");
41         }
42         return null;
43     }
44
45     /**
46      * Get the value of the Configuration.
47      *
48      * @return the value of the configuration.
49      */
50     public String getValue() {
51         return _value;
52     }
53
54     /**
55      * Set the value of the Configuration.
56      *
57      * @param value the value of the configuration.
58      */
59     public void setValue(String value) {
60         _value = value;
61     }
62
63     /**
64      * Get the name of this configuration.
65      *
66      * @return  the name
67      */
68     public String getName() {
69         return _name;
70     }
71
72     /**
73      * Set the name of this configuration.
74      *
75      * @param name name of the configuration
76      */
77     public void setName(String name) {
78         _name = name;
79     }
80
81     /**
82      * Get the hierarchical parent of this resource.
83      *
84      * @return parent of this resource
85
86      public Resource getParentResource() {
87         return _parentResource;
88     }
89      */
90     
91     /**
92      * Set the hierarchical parent of this resource.
93      *
94      * @param parentResource new parent
95
96     public void setParentResource(Resource parentResource) {
97         _parentResource = parentResource;
98     }
99      */
100     
101     /**
102      * Return a string representation of the Configuration.
103      *
104      * @return string representation of the Configuration
105      */
106     public String toString() {
107         return "Configuration: " + getName();
108     }
109
110     protected String _value = null;
111     protected String _name = null;
112     protected ArchiResource _parentResource = null;
113 }