Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java @ 367:6431b7efe240
Cosmetics.
artifacts/trunk@3680 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 16 Jan 2012 08:58:36 +0000 |
parents | 1d11a0531242 |
children | 71ff234713a6 |
comparison
equal
deleted
inserted
replaced
366:1f51f3c46efe | 367:6431b7efe240 |
---|---|
58 this.name = name; | 58 this.name = name; |
59 this.description = description; | 59 this.description = description; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 /** | 63 /** Get index. */ |
64 * Copies name, index and description of other facet. | |
65 */ | |
66 public void set(Facet other) { | |
67 index = other.getIndex(); | |
68 name = other.getName(); | |
69 description = other.getDescription(); | |
70 } | |
71 | |
72 | |
73 public Facet deepCopy() { | |
74 DefaultFacet copy = new DefaultFacet(); | |
75 copy.set(this); | |
76 return copy; | |
77 } | |
78 | |
79 | |
80 public int getIndex() { | 64 public int getIndex() { |
81 return index; | 65 return index; |
82 } | 66 } |
83 | 67 |
84 | 68 |
69 /** Returns the name ('type'). */ | |
85 public String getName() { | 70 public String getName() { |
86 return name; | 71 return name; |
87 } | 72 } |
88 | 73 |
89 | 74 |
75 /** Returns the description (e.g. displayed in gui). */ | |
90 public String getDescription() { | 76 public String getDescription() { |
91 return description; | 77 return description; |
92 } | 78 } |
93 | 79 |
94 | 80 |
123 public List getDataProviderKeys(Artifact artifact) { | 109 public List getDataProviderKeys(Artifact artifact) { |
124 return null; | 110 return null; |
125 } | 111 } |
126 | 112 |
127 | 113 |
128 public String toString() { | 114 /** Create a xml represantation. */ |
129 return new StringBuilder("name = '") | |
130 .append(name).append("', index = ") | |
131 .append(index).append(", description = '") | |
132 .append(description).append("'") | |
133 .toString(); | |
134 } | |
135 | |
136 | |
137 public Node toXML(Document doc) { | 115 public Node toXML(Document doc) { |
138 ElementCreator ec = new ElementCreator( | 116 ElementCreator ec = new ElementCreator( |
139 doc, | 117 doc, |
140 ArtifactNamespaceContext.NAMESPACE_URI, | 118 ArtifactNamespaceContext.NAMESPACE_URI, |
141 ArtifactNamespaceContext.NAMESPACE_PREFIX); | 119 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
145 ec.addAttr(facet, "name", name, true); | 123 ec.addAttr(facet, "name", name, true); |
146 ec.addAttr(facet, "index", String.valueOf(index), true); | 124 ec.addAttr(facet, "index", String.valueOf(index), true); |
147 | 125 |
148 return facet; | 126 return facet; |
149 } | 127 } |
128 | |
129 | |
130 /** Create a string representation. */ | |
131 public String toString() { | |
132 return new StringBuilder("name = '") | |
133 .append(name).append("', index = ") | |
134 .append(index).append(", description = '") | |
135 .append(description).append("'") | |
136 .toString(); | |
137 } | |
138 | |
139 | |
140 /** | |
141 * Copies name, index and description of other facet. | |
142 */ | |
143 public void set(Facet other) { | |
144 index = other.getIndex(); | |
145 name = other.getName(); | |
146 description = other.getDescription(); | |
147 } | |
148 | |
149 | |
150 /** Create a deep copy of this facet. */ | |
151 public Facet deepCopy() { | |
152 DefaultFacet copy = new DefaultFacet(); | |
153 copy.set(this); | |
154 return copy; | |
155 } | |
150 } | 156 } |
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 157 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |