Revision 21693
trunk/libraries/libMetadata/src-test/extended/manager/ExtendedMDManagerImplTest.java | ||
---|---|---|
69 | 69 |
ExtendedMDManager emdm = new ExtendedMDManagerImpl(); |
70 | 70 |
MDElement mde = emdm.createMDElement("prueba"); |
71 | 71 |
MDElementDefinition mded = new MDElementDefinition("prueba", null, null, null, null); |
72 |
assertEquals(new MDElementImpl(null, null, mded, null).getClass(), mde.getClass());
|
|
72 |
assertEquals(new MDElementImpl(mded, null, null).getClass(), mde.getClass());
|
|
73 | 73 |
assertEquals("prueba", mde.getType().getName()); |
74 | 74 |
} |
75 | 75 |
|
trunk/libraries/libMetadata/src-test/extended/manager/ExtendedMetadataImplTest.java | ||
---|---|---|
40 | 40 |
import org.gvsig.metadata.extended.manager.ExtendedMetadataImpl; |
41 | 41 |
import org.gvsig.metadata.extended.manager.MDElementImpl; |
42 | 42 |
import org.gvsig.metadata.extended.registry.objects.MDDefinition; |
43 |
import org.gvsig.metadata.extended.registry.objects.MDElementDefinition; |
|
43 | 44 |
|
44 | 45 |
|
45 | 46 |
public class ExtendedMetadataImplTest extends TestCase { |
... | ... | |
122 | 123 |
|
123 | 124 |
public void testGetElement() throws ClassCastException, NamedMetadataNotFoundException { |
124 | 125 |
ExtendedMetadata md = new ExtendedMetadataImpl("prueba"); |
125 |
MDElement mde = new MDElementImpl("elem", null, null, null);
|
|
126 |
MDElement mde = new MDElementImpl(new MDElementDefinition("elem", null, null, null, null), "Hola", null);
|
|
126 | 127 |
md.setElement(mde); |
127 | 128 |
assertEquals(mde, md.getElement("elem")); |
128 | 129 |
} |
trunk/libraries/libMetadata/src/org/gvsig/metadata/simple/SimpleMetadata.java | ||
---|---|---|
40 | 40 |
public class SimpleMetadata implements Metadata { |
41 | 41 |
|
42 | 42 |
private Map elements = new HashMap(); |
43 |
private String definitionName;
|
|
43 |
private String name;
|
|
44 | 44 |
|
45 | 45 |
public SimpleMetadata(String definitionName) { |
46 |
this.definitionName = definitionName;
|
|
46 |
this.name = definitionName;
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
public Object get(String name) throws NamedMetadataNotFoundException { |
... | ... | |
114 | 114 |
return elements.isEmpty(); |
115 | 115 |
} |
116 | 116 |
|
117 |
public String getName() { |
|
118 |
return this.name; |
|
119 |
} |
|
120 |
|
|
121 |
public void setName(String name) { |
|
122 |
this.name = name; |
|
123 |
} |
|
124 |
|
|
117 | 125 |
} |
trunk/libraries/libMetadata/src/org/gvsig/metadata/Metadata.java | ||
---|---|---|
145 | 145 |
* @return a boolean value which indicates if the Object has any value |
146 | 146 |
*/ |
147 | 147 |
public boolean isEmpty(); |
148 |
|
|
149 |
/** |
|
150 |
* Retrieves the name of the Metadata object |
|
151 |
* @return a String containing the common name of the Metadata object |
|
152 |
*/ |
|
153 |
public String getName(); |
|
154 |
|
|
155 |
/** |
|
156 |
* Set the name of the Metadata object |
|
157 |
*/ |
|
158 |
public void setName(String name); |
|
148 | 159 |
} |
trunk/libraries/libMetadata/src/org/gvsig/metadata/extended/manager/MDElementImpl.java | ||
---|---|---|
51 | 51 |
|
52 | 52 |
public MDElementImpl() {} |
53 | 53 |
|
54 |
public MDElementImpl(String id, Object value, MDElementDefinition type, Locale locale) {
|
|
55 |
this.id = id; |
|
54 |
public MDElementImpl(MDElementDefinition type, Object value, Locale locale) {
|
|
55 |
//this.id = id;
|
|
56 | 56 |
this.value = value; |
57 | 57 |
this.type = type; |
58 | 58 |
this.locale = locale; |
trunk/libraries/libMetadata/src/org/gvsig/metadata/extended/manager/ExtendedMDManagerImpl.java | ||
---|---|---|
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
public MDElement createMDElement(String mded) { |
56 |
return new MDElementImpl(null, null, new MDElementDefinition(mded, null, null, null, null), null);
|
|
56 |
return new MDElementImpl(new MDElementDefinition(mded, null, null, null, null), null, null);
|
|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
public String exportMD(Metadata md, String format) { |
trunk/libraries/libMetadata/src/org/gvsig/metadata/extended/manager/ExtendedMetadataImpl.java | ||
---|---|---|
42 | 42 |
import org.gvsig.metadata.extended.MDElement; |
43 | 43 |
import org.gvsig.metadata.extended.registry.objects.MDDefinition; |
44 | 44 |
|
45 |
import sun.reflect.generics.reflectiveObjects.NotImplementedException; |
|
46 |
|
|
47 | 45 |
// A?adir implements Iterator |
48 | 46 |
public class ExtendedMetadataImpl implements ExtendedMetadata { |
49 | 47 |
|
... | ... | |
182 | 180 |
elem.setFather(this); |
183 | 181 |
} |
184 | 182 |
|
185 |
public void setId(String id) {
|
|
183 |
protected void setId(String id) {
|
|
186 | 184 |
this.id = id; |
187 | 185 |
setChangeDate(); |
188 | 186 |
} |
... | ... | |
195 | 193 |
this.type.setDescription(desc); |
196 | 194 |
} |
197 | 195 |
|
198 |
public void setChangeDate() {
|
|
196 |
protected void setChangeDate() {
|
|
199 | 197 |
this.changeDate = new Date(); |
200 | 198 |
} |
201 | 199 |
|
202 |
public void setType(MDDefinition type) {
|
|
200 |
protected void setType(MDDefinition type) {
|
|
203 | 201 |
this.type = type; |
204 | 202 |
setChangeDate(); |
205 | 203 |
} |
trunk/libraries/libMetadata/src/org/gvsig/metadata/extended/ExtendedMetadata.java | ||
---|---|---|
64 | 64 |
public String getId(); |
65 | 65 |
|
66 | 66 |
/** |
67 |
* Retrieves the name of the ExtendedMetadata object |
|
68 |
* @return a String containing the common name of the ExtendedMetadata object |
|
69 |
*/ |
|
70 |
public String getName(); |
|
71 |
|
|
72 |
/** |
|
73 | 67 |
* Retrieves the description of the ExtendedMetadata object |
74 | 68 |
* @return a String containing the description of the ExtendedMetadata object |
75 | 69 |
*/ |
76 | 70 |
public String getDescription(); |
77 | 71 |
|
78 | 72 |
/** |
73 |
* Set the description of the ExtendedMetadata object |
|
74 |
*/ |
|
75 |
public void setDescription(String desc); |
|
76 |
|
|
77 |
/** |
|
79 | 78 |
* Retrieves the date of creation of the object |
80 | 79 |
* @return a Date object containing the system date when the ExtendedMetadata object was created |
81 | 80 |
*/ |
trunk/libraries/libMetadata/build.xml | ||
---|---|---|
1 |
<project name="libMetadata" default="generate-without-source" basedir="."> |
|
2 |
<description> |
|
3 |
Instala la libreria de Metadatos (temporalmente sobre la extensión). |
|
4 |
</description> |
|
5 |
<!-- set global properties for this build --> |
|
6 |
<property name="src" location="src"/> |
|
7 |
<property name="build" location="bin"/> |
|
8 |
<property name="dist" location="dist"/> |
|
9 |
<property name="plugin" value="libMetadata"/> |
|
10 |
<property name="extension-dir" location="../extMetadata"/> |
|
11 |
|
|
12 |
<target name="init"> |
|
13 |
<!-- Create the time stamp --> |
|
14 |
<tstamp/> |
|
15 |
<!-- Create the build directory structure used by compile --> |
|
16 |
<mkdir dir="${build}"/> |
|
17 |
<mkdir dir="${dist}"/> |
|
18 |
<!-- Creamos un fichero con el timeStamp para que lo lea el FPanelAbout --> |
|
19 |
<buildnumber/> |
|
20 |
|
|
21 |
</target> |
|
22 |
|
|
23 |
<target name="generate-without-source" description="generate the distribution without the source file" > |
|
24 |
<!-- Create the distribution directory --> |
|
25 |
<mkdir dir="${dist}"/> |
|
26 |
|
|
27 |
<jar jarfile="${dist}/${plugin}.jar" basedir="${build}"/> |
|
28 |
|
|
29 |
<move todir="${extension-dir}/lib"> |
|
30 |
<fileset dir="${dist}" includes="**/**"/> |
|
31 |
</move> |
|
32 |
</target> |
|
33 |
</project> |
trunk/libraries/libMetadata/.classpath | ||
---|---|---|
3 | 3 |
<classpathentry kind="src" path="src"/> |
4 | 4 |
<classpathentry kind="src" path="src-test"/> |
5 | 5 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
6 |
<classpathentry kind="lib" path="lib/org.gvsig.exceptions.jar"/> |
|
7 | 6 |
<classpathentry kind="lib" path="lib/junit-4.4.jar"/> |
7 |
<classpathentry kind="lib" path="C:/gvSIG_2.0/bin/lib/org.gvsig.exceptions.jar"/> |
|
8 | 8 |
<classpathentry kind="output" path="bin"/> |
9 | 9 |
</classpath> |
Also available in: Unified diff