Revision 28171
tags/tmp_build/libraries/libMetadata/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>libMetadata</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
</buildSpec> |
|
19 |
<natures> |
|
20 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
21 |
</natures> |
|
22 |
</projectDescription> |
tags/tmp_build/libraries/libMetadata/src-test/org/gvsig/metadata/MDLibraryTest.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
import junit.framework.TestCase; |
|
34 |
|
|
35 |
import org.gvsig.tools.locator.Library; |
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
public class MDLibraryTest extends TestCase { |
|
40 |
/** |
|
41 |
* Test method for {@link org.gvsig.metadata.MDLibrary#initialize()}. |
|
42 |
*/ |
|
43 |
public void testInitialize() { |
|
44 |
Library api = new MDLibrary(); |
|
45 |
|
|
46 |
// 1: Initialize the Library |
|
47 |
api.initialize(); |
|
48 |
|
|
49 |
// 2: postInitialize them |
|
50 |
// as we don't initialize an implementation library, |
|
51 |
// the postInitialization must throw an Exception |
|
52 |
try { |
|
53 |
api.postInitialize(); |
|
54 |
fail("Library postInitialization is not checking " |
|
55 |
+ "for implementation availability"); |
|
56 |
} catch (Exception ex) { |
|
57 |
// Good |
|
58 |
} |
|
59 |
} |
|
60 |
} |
tags/tmp_build/libraries/libMetadata/src-test/org/gvsig/metadata/simple/SimpleMDManagerTest.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import junit.framework.TestCase; |
|
34 |
|
|
35 |
import org.gvsig.metadata.MDManager; |
|
36 |
import org.gvsig.metadata.Metadata; |
|
37 |
import org.gvsig.metadata.simple.SimpleMDManager; |
|
38 |
import org.gvsig.metadata.simple.SimpleMetadata; |
|
39 |
|
|
40 |
|
|
41 |
public class SimpleMDManagerTest extends TestCase{ |
|
42 |
|
|
43 |
//@BeforeClass |
|
44 |
public static void setUpBeforeClass() throws Exception { |
|
45 |
} |
|
46 |
|
|
47 |
//@AfterClass |
|
48 |
public static void tearDownAfterClass() throws Exception { |
|
49 |
} |
|
50 |
|
|
51 |
//@Before |
|
52 |
public void setUp() throws Exception { |
|
53 |
} |
|
54 |
|
|
55 |
//@After |
|
56 |
public void tearDown() throws Exception { |
|
57 |
} |
|
58 |
|
|
59 |
//@Test |
|
60 |
public void testCreateMD() { |
|
61 |
MDManager mdm = new SimpleMDManager(); |
|
62 |
Metadata md = mdm.createMD("prueba"); |
|
63 |
assertEquals(new SimpleMetadata("prueba").getClass(), md.getClass()); |
|
64 |
} |
|
65 |
|
|
66 |
} |
tags/tmp_build/libraries/libMetadata/src-test/org/gvsig/metadata/simple/SimpleMetadataTest.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import java.util.Date; |
|
34 |
|
|
35 |
import junit.framework.TestCase; |
|
36 |
|
|
37 |
import org.gvsig.metadata.Metadata; |
|
38 |
import org.gvsig.metadata.exceptions.NamedMetadataNotFoundException; |
|
39 |
import org.gvsig.metadata.simple.SimpleMetadata; |
|
40 |
|
|
41 |
public class SimpleMetadataTest extends TestCase{ |
|
42 |
|
|
43 |
//@BeforeClass |
|
44 |
public static void setUpBeforeClass() throws Exception { |
|
45 |
} |
|
46 |
|
|
47 |
//@AfterClass |
|
48 |
public static void tearDownAfterClass() throws Exception { |
|
49 |
} |
|
50 |
|
|
51 |
//@Before |
|
52 |
public void setUp() throws Exception { |
|
53 |
} |
|
54 |
|
|
55 |
//@After |
|
56 |
public void tearDown() throws Exception { |
|
57 |
} |
|
58 |
|
|
59 |
|
|
60 |
//@Test |
|
61 |
public void testGet() throws NamedMetadataNotFoundException { |
|
62 |
Metadata md = new SimpleMetadata("prueba"); |
|
63 |
md.set("Author", "Alejandro Llaves"); |
|
64 |
assertEquals("Alejandro Llaves", md.get("Author")); |
|
65 |
} |
|
66 |
|
|
67 |
public void testNamedMetadataNotFoundException() { |
|
68 |
Metadata md = new SimpleMetadata("prueba"); |
|
69 |
try { |
|
70 |
md.get("Topic"); |
|
71 |
fail("get() should have thrown a NamedMetadataNotFoundException!"); |
|
72 |
} |
|
73 |
catch (NamedMetadataNotFoundException ex) { |
|
74 |
} |
|
75 |
} |
|
76 |
|
|
77 |
public void testGetBoolean() throws ClassCastException, NamedMetadataNotFoundException { |
|
78 |
Metadata md = new SimpleMetadata("prueba"); |
|
79 |
md.setBoolean("Available", true); |
|
80 |
assertEquals(true, md.getBoolean("Available")); |
|
81 |
} |
|
82 |
|
|
83 |
public void testGetDouble() throws ClassCastException, NamedMetadataNotFoundException { |
|
84 |
Metadata md = new SimpleMetadata("prueba"); |
|
85 |
md.setDouble("Area", (double) 500); |
|
86 |
assertEquals((double) 500, md.getDouble("Area"), 0); |
|
87 |
} |
|
88 |
|
|
89 |
public void testGetInt() throws ClassCastException, NamedMetadataNotFoundException { |
|
90 |
Metadata md = new SimpleMetadata("prueba"); |
|
91 |
md.setInt("Number", 5); |
|
92 |
assertEquals(5, md.getInt("Number")); |
|
93 |
} |
|
94 |
|
|
95 |
public void testGetString() throws ClassCastException, NamedMetadataNotFoundException { |
|
96 |
Metadata md = new SimpleMetadata("prueba"); |
|
97 |
md.setString("Author", "Alejandro Llaves"); |
|
98 |
assertEquals("Alejandro Llaves", md.getString("Author")); |
|
99 |
} |
|
100 |
|
|
101 |
public void testGetDate() throws ClassCastException, NamedMetadataNotFoundException { |
|
102 |
Metadata md = new SimpleMetadata("prueba"); |
|
103 |
md.setDate("Date", new Date(0L)); |
|
104 |
assertEquals(new Date(0l), md.getDate("Date")); |
|
105 |
} |
|
106 |
|
|
107 |
//@Test |
|
108 |
public void testHasValue() { |
|
109 |
SimpleMetadata md = new SimpleMetadata("prueba"); |
|
110 |
assertEquals(md.hasValue("Author"), false); |
|
111 |
md.set("Author", "Alejandro Llaves"); |
|
112 |
assertEquals(md.hasValue("Author"), true); |
|
113 |
} |
|
114 |
|
|
115 |
//@Test |
|
116 |
public void testIsEmpty() { |
|
117 |
SimpleMetadata md = new SimpleMetadata("prueba"); |
|
118 |
assertEquals(md.isEmpty(), true); |
|
119 |
md.set("Author", "Alejandro Llaves"); |
|
120 |
assertEquals(md.isEmpty(), false); |
|
121 |
} |
|
122 |
|
|
123 |
} |
tags/tmp_build/libraries/libMetadata/src-test/org/gvsig/metadata/simple/SimpleMDLibraryTest.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import junit.framework.TestCase; |
|
34 |
|
|
35 |
import org.gvsig.metadata.MDLibrary; |
|
36 |
import org.gvsig.metadata.MDLocator; |
|
37 |
import org.gvsig.tools.locator.Library; |
|
38 |
|
|
39 |
public class SimpleMDLibraryTest extends TestCase { |
|
40 |
|
|
41 |
/** |
|
42 |
* Test method for {@link org.gvsig.metadata.simple.SimpleMDLibrary#initialize()}. |
|
43 |
*/ |
|
44 |
public void testInitialize() { |
|
45 |
Library api = new MDLibrary(); |
|
46 |
Library impl = new SimpleMDLibrary(); |
|
47 |
|
|
48 |
// 1: Initialize the Libraries |
|
49 |
api.initialize(); |
|
50 |
impl.initialize(); |
|
51 |
|
|
52 |
// 2: postInitialize them |
|
53 |
// if the library is not correctly initialized, |
|
54 |
// an Exception will be thrown |
|
55 |
api.postInitialize(); |
|
56 |
impl.postInitialize(); |
|
57 |
|
|
58 |
// Check if the correct implementation is returned |
|
59 |
assertEquals(SimpleMDManager.class, MDLocator.getMDManager() |
|
60 |
.getClass()); |
|
61 |
} |
|
62 |
|
|
63 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/simple/SimpleMDManager.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import org.gvsig.metadata.MDManager; |
|
34 |
import org.gvsig.metadata.Metadata; |
|
35 |
import org.gvsig.metadata.simple.SimpleMetadata; |
|
36 |
|
|
37 |
public class SimpleMDManager implements MDManager { |
|
38 |
|
|
39 |
public SimpleMDManager() {} |
|
40 |
|
|
41 |
public Metadata createMD(String mdd) { |
|
42 |
return new SimpleMetadata(mdd); |
|
43 |
} |
|
44 |
|
|
45 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/simple/SimpleMetadata.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import java.util.Date; |
|
34 |
import java.util.HashMap; |
|
35 |
import java.util.Map; |
|
36 |
|
|
37 |
import org.gvsig.metadata.Metadata; |
|
38 |
import org.gvsig.metadata.exceptions.NamedMetadataNotFoundException; |
|
39 |
|
|
40 |
public class SimpleMetadata implements Metadata { |
|
41 |
|
|
42 |
private Map elements = new HashMap(); |
|
43 |
private String name; |
|
44 |
|
|
45 |
public SimpleMetadata(String definitionName) { |
|
46 |
this.name = definitionName; |
|
47 |
} |
|
48 |
|
|
49 |
public Object get(String name) throws NamedMetadataNotFoundException { |
|
50 |
if(!hasValue(name)) |
|
51 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
52 |
return elements.get(name); |
|
53 |
} |
|
54 |
|
|
55 |
public boolean getBoolean(String name) throws ClassCastException, NamedMetadataNotFoundException { |
|
56 |
if(!hasValue(name)) |
|
57 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
58 |
return ((Boolean)elements.get(name)).booleanValue(); |
|
59 |
} |
|
60 |
|
|
61 |
public double getDouble(String name) throws ClassCastException, NamedMetadataNotFoundException { |
|
62 |
if(!hasValue(name)) |
|
63 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
64 |
return ((Double)elements.get(name)).doubleValue(); |
|
65 |
} |
|
66 |
|
|
67 |
public int getInt(String name) throws ClassCastException, NamedMetadataNotFoundException { |
|
68 |
if(!hasValue(name)) |
|
69 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
70 |
return ((Integer)elements.get(name)).intValue(); |
|
71 |
} |
|
72 |
|
|
73 |
public String getString(String name) throws ClassCastException, NamedMetadataNotFoundException { |
|
74 |
if(!hasValue(name)) |
|
75 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
76 |
return (String)elements.get(name).toString(); |
|
77 |
} |
|
78 |
|
|
79 |
public Date getDate(String name) throws ClassCastException, NamedMetadataNotFoundException { |
|
80 |
if(!hasValue(name)) |
|
81 |
throw new NamedMetadataNotFoundException(this.getClass()); |
|
82 |
return (Date)elements.get(name); |
|
83 |
} |
|
84 |
|
|
85 |
public void set(String name, Object value) { |
|
86 |
elements.put(name, value); |
|
87 |
} |
|
88 |
|
|
89 |
public void setBoolean(String name, boolean value) { |
|
90 |
elements.put(name, Boolean.valueOf(value)); |
|
91 |
} |
|
92 |
|
|
93 |
public void setDouble(String name, double value) { |
|
94 |
elements.put(name, Double.valueOf(value)); |
|
95 |
} |
|
96 |
|
|
97 |
public void setInt(String name, int value) { |
|
98 |
elements.put(name, Integer.valueOf(value)); |
|
99 |
} |
|
100 |
|
|
101 |
public void setString(String name, String value) { |
|
102 |
elements.put(name, String.valueOf(value)); |
|
103 |
} |
|
104 |
|
|
105 |
public void setDate(String name, Date value) { |
|
106 |
elements.put(name, value); |
|
107 |
} |
|
108 |
|
|
109 |
public boolean hasValue(String name) { |
|
110 |
return elements.containsKey(name); |
|
111 |
} |
|
112 |
|
|
113 |
public boolean isEmpty() { |
|
114 |
return elements.isEmpty(); |
|
115 |
} |
|
116 |
|
|
117 |
public String getName() { |
|
118 |
return this.name; |
|
119 |
} |
|
120 |
|
|
121 |
public void setName(String name) { |
|
122 |
this.name = name; |
|
123 |
} |
|
124 |
|
|
125 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/simple/SimpleMDLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.simple; |
|
32 |
|
|
33 |
import org.gvsig.metadata.MDLocator; |
|
34 |
import org.gvsig.tools.locator.BaseLibrary; |
|
35 |
|
|
36 |
public class SimpleMDLibrary extends BaseLibrary { |
|
37 |
|
|
38 |
public void initialize() { |
|
39 |
super.initialize(); |
|
40 |
MDLocator.registerMDManager(SimpleMDManager.class); |
|
41 |
} |
|
42 |
|
|
43 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/MDManager.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
public interface MDManager { |
|
34 |
|
|
35 |
/** |
|
36 |
* Creates a Metadata object |
|
37 |
* @param mdd the name of the new object |
|
38 |
* @return an object which implements the Metadata interface |
|
39 |
*/ |
|
40 |
public Metadata createMD(String mdd); |
|
41 |
|
|
42 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/Metadata.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
import java.util.Date; |
|
34 |
|
|
35 |
import org.gvsig.metadata.exceptions.NamedMetadataNotFoundException; |
|
36 |
|
|
37 |
public interface Metadata { |
|
38 |
|
|
39 |
/** |
|
40 |
* Retrieves an object from the Metadata Object |
|
41 |
* @param name the name which identifies the object to return |
|
42 |
* @return the object referenced by 'name' in the Metadata Object |
|
43 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
44 |
*/ |
|
45 |
public Object get(String name) throws NamedMetadataNotFoundException; |
|
46 |
|
|
47 |
/** |
|
48 |
* Retrieves a boolean value from the Metadata Object |
|
49 |
* @param name the name which identifies the value to return |
|
50 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
51 |
* @return the boolean value referenced by 'name' in the Metadata Object |
|
52 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
53 |
*/ |
|
54 |
public boolean getBoolean(String name) throws ClassCastException, NamedMetadataNotFoundException; |
|
55 |
|
|
56 |
/** |
|
57 |
* Retrieves a double value from the Metadata Object |
|
58 |
* @param name the name which identifies the value to return |
|
59 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
60 |
* @return the double value referenced by 'name' in the Metadata Object |
|
61 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
62 |
*/ |
|
63 |
public double getDouble(String name) throws ClassCastException, NamedMetadataNotFoundException; |
|
64 |
|
|
65 |
/** |
|
66 |
* Retrieves an integer value from the Metadata Object |
|
67 |
* @param name the name which identifies the value to return |
|
68 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
69 |
* @return the integer value referenced by 'name' in the Metadata Object |
|
70 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
71 |
*/ |
|
72 |
public int getInt(String name) throws ClassCastException, NamedMetadataNotFoundException; |
|
73 |
|
|
74 |
/** |
|
75 |
* Retrieves a String from the Metadata Object |
|
76 |
* @param name the name which identifies the object to return |
|
77 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
78 |
* @return the String object referenced by 'name' in the Metadata Object |
|
79 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
80 |
*/ |
|
81 |
public String getString(String name) throws ClassCastException, NamedMetadataNotFoundException; |
|
82 |
|
|
83 |
/** |
|
84 |
* Retrieves a Date object from the Metadata Object |
|
85 |
* @param name the name which identifies the value to return |
|
86 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
87 |
* @return the Date object referenced by 'name' in the Metadata Object |
|
88 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
89 |
*/ |
|
90 |
public Date getDate(String name) throws ClassCastException, NamedMetadataNotFoundException; |
|
91 |
|
|
92 |
/** |
|
93 |
* Puts an object in the Metadata Object |
|
94 |
* @param name the name which identifies the object to put in the Metadata Object |
|
95 |
* @param value the object to put in the Object |
|
96 |
* @throws ClassCastException thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance |
|
97 |
* @throws NamedMetadataNotFoundException if not Metadata with the 'name' is found |
|
98 |
*/ |
|
99 |
public void set(String name, Object value); |
|
100 |
|
|
101 |
/** |
|
102 |
* Puts a boolean value in the Metadata Object |
|
103 |
* @param name the name which identifies the value to put in the Metadata Object |
|
104 |
* @param value the value to put in the Object |
|
105 |
*/ |
|
106 |
public void setBoolean(String name, boolean value); |
|
107 |
|
|
108 |
/** |
|
109 |
* Puts a double value in the Metadata Object |
|
110 |
* @param name the name which identifies the value to put in the Metadata Object |
|
111 |
* @param value the value to put in the Object |
|
112 |
*/ |
|
113 |
public void setDouble(String name, double value); |
|
114 |
|
|
115 |
/** |
|
116 |
* Puts an integer value in the Metadata Object |
|
117 |
* @param name the name which identifies the value to put in the Metadata Object |
|
118 |
* @param value the value to put in the Object |
|
119 |
*/ |
|
120 |
public void setInt(String name, int value); |
|
121 |
|
|
122 |
/** |
|
123 |
* Puts a String in the Metadata Object |
|
124 |
* @param name the name which identifies the value to put in the Metadata Object |
|
125 |
* @param value the value to put in the Object |
|
126 |
*/ |
|
127 |
public void setString(String name, String value); |
|
128 |
|
|
129 |
/** |
|
130 |
* Puts a Date object in the Metadata Object |
|
131 |
* @param name the name which identifies the value to put in the Metadata Object |
|
132 |
* @param value the value to put in the Object |
|
133 |
*/ |
|
134 |
public void setDate(String name, Date value); |
|
135 |
|
|
136 |
/** |
|
137 |
* Checks if the Metadata Object has a specific value |
|
138 |
* @param name the name which identifies the value to check |
|
139 |
* @return a boolean value which indicates if there is a value in the Object referenced by 'name' |
|
140 |
*/ |
|
141 |
public boolean hasValue(String name); |
|
142 |
|
|
143 |
/** |
|
144 |
* Checks if the Metadata Object is empty |
|
145 |
* @return a boolean value which indicates if the Object has any value |
|
146 |
*/ |
|
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); |
|
159 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/exceptions/MetadataNotFoundException.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.exceptions; |
|
32 |
|
|
33 |
import java.util.HashMap; |
|
34 |
import java.util.Map; |
|
35 |
|
|
36 |
import org.gvsig.tools.exception.BaseException; |
|
37 |
|
|
38 |
public abstract class MetadataNotFoundException extends BaseException { |
|
39 |
|
|
40 |
private static final long serialVersionUID = 1L; |
|
41 |
private String className = null; |
|
42 |
|
|
43 |
public MetadataNotFoundException(Class md){ |
|
44 |
if (md != null) { |
|
45 |
this.className = md.getName(); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* Initializes some values |
|
51 |
*/ |
|
52 |
public void init() { |
|
53 |
messageKey = "metadata_not_found_exception"; |
|
54 |
formatString = "Metadata can't be found."; |
|
55 |
code = serialVersionUID; |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
protected Map values() { |
|
60 |
HashMap map = new HashMap(); |
|
61 |
map.put("className", className); |
|
62 |
return map; |
|
63 |
} |
|
64 |
|
|
65 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/exceptions/NamedMetadataNotFoundException.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata.exceptions; |
|
32 |
|
|
33 |
import java.util.HashMap; |
|
34 |
import java.util.Map; |
|
35 |
|
|
36 |
import org.gvsig.tools.exception.BaseException; |
|
37 |
|
|
38 |
public class NamedMetadataNotFoundException extends BaseException { |
|
39 |
|
|
40 |
private static final long serialVersionUID = 1L; |
|
41 |
private String className = null; |
|
42 |
|
|
43 |
public NamedMetadataNotFoundException(Class md){ |
|
44 |
if (md != null) { |
|
45 |
this.className = md.getName(); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* Initializes some values |
|
51 |
*/ |
|
52 |
public void init() { |
|
53 |
messageKey = "named_metadata_not_found_exception"; |
|
54 |
formatString = "Named Metadata can't be found."; |
|
55 |
code = serialVersionUID; |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
protected Map values() { |
|
60 |
HashMap map = new HashMap(); |
|
61 |
map.put("className", className); |
|
62 |
return map; |
|
63 |
} |
|
64 |
|
|
65 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/Metadatable.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
import org.gvsig.metadata.exceptions.MetadataNotFoundException; |
|
34 |
|
|
35 |
public interface Metadatable { |
|
36 |
|
|
37 |
/** |
|
38 |
* Retrieves the metadata of the object |
|
39 |
* @return Returns an object which implements the Metadata interface |
|
40 |
* @throws Throws MetadataNotFoudException when an object can't return its Metadata |
|
41 |
*/ |
|
42 |
public Metadata getMD() throws MetadataNotFoundException; |
|
43 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/MDLocator.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
import org.gvsig.tools.locator.AbstractLocator; |
|
34 |
import org.gvsig.tools.locator.LocatorException; |
|
35 |
|
|
36 |
|
|
37 |
public class MDLocator extends AbstractLocator { |
|
38 |
|
|
39 |
public static final String METADATA_MANAGER_NAME = "MDManager"; |
|
40 |
|
|
41 |
private static final String LOCATOR_NAME = "MDLocator"; |
|
42 |
|
|
43 |
private static final String METADATA_MANAGER_DESCRIPTION = "Compatible implementation for MDManager"; |
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
/** |
|
48 |
* Unique instance. |
|
49 |
*/ |
|
50 |
private static final MDLocator instance = new MDLocator(); |
|
51 |
|
|
52 |
/** |
|
53 |
* Return the singleton instance. |
|
54 |
* |
|
55 |
* @return the singleton instance |
|
56 |
*/ |
|
57 |
public static MDLocator getInstance() { |
|
58 |
return instance; |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* Return a reference to MDManager. |
|
63 |
* |
|
64 |
* @return a reference to MDManager |
|
65 |
* @throws LocatorException |
|
66 |
* if there is no access to the class or the class cannot be |
|
67 |
* instantiated |
|
68 |
* @see Locator#get(String) |
|
69 |
*/ |
|
70 |
public static MDManager getMDManager() throws LocatorException { |
|
71 |
return (MDManager) getInstance().get(METADATA_MANAGER_NAME); |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Registers the Class implementing the MDManager interface. |
|
76 |
* |
|
77 |
* @param clazz |
|
78 |
* implementing the MDManager interface |
|
79 |
*/ |
|
80 |
public static void registerMDManager(Class clazz) { |
|
81 |
getInstance().register(METADATA_MANAGER_NAME, METADATA_MANAGER_DESCRIPTION, clazz); |
|
82 |
} |
|
83 |
|
|
84 |
public String getLocatorName() { |
|
85 |
return LOCATOR_NAME; |
|
86 |
} |
|
87 |
|
|
88 |
} |
tags/tmp_build/libraries/libMetadata/src/org/gvsig/metadata/MDLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es |
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI) |
|
27 |
* Universitat Jaume I |
|
28 |
* {{Task}} |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.metadata; |
|
32 |
|
|
33 |
import org.gvsig.metadata.MDLocator; |
|
34 |
import org.gvsig.metadata.MDManager; |
|
35 |
import org.gvsig.tools.locator.BaseLibrary; |
|
36 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
37 |
|
|
38 |
public class MDLibrary extends BaseLibrary { |
|
39 |
|
|
40 |
public void postInitialize() { |
|
41 |
super.postInitialize(); |
|
42 |
|
|
43 |
// Validate there is any implementation registered. |
|
44 |
MDManager manager = MDLocator.getMDManager(); |
|
45 |
|
|
46 |
if (manager == null) { |
|
47 |
throw new ReferenceNotRegisteredException( |
|
48 |
MDLocator.METADATA_MANAGER_NAME, MDLocator.getInstance()); |
|
49 |
} |
|
50 |
} |
|
51 |
|
|
52 |
} |
tags/tmp_build/libraries/libMetadata/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|
2 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<groupId>org.gvsig</groupId> |
|
6 |
<artifactId>libMetadata</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<version>1.0-SNAPSHOT</version> |
|
9 |
<name>libMetadata</name> |
|
10 |
<url>http://gvsig.org</url> |
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>gvsig-library-base-pom</artifactId> |
|
14 |
<version>1.0-SNAPSHOT</version> |
|
15 |
</parent> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>org.gvsig</groupId> |
|
19 |
<artifactId>libExceptions</artifactId> |
|
20 |
<version>1.0-SNAPSHOT</version> |
|
21 |
</dependency> |
|
22 |
</dependencies> |
|
23 |
<build> |
|
24 |
<sourceDirectory>src</sourceDirectory> |
|
25 |
<testSourceDirectory>src-test</testSourceDirectory> |
|
26 |
<plugins> |
|
27 |
<plugin> |
|
28 |
<groupId>org.apache.maven.plugins</groupId> |
|
29 |
<artifactId>maven-jar-plugin</artifactId> |
|
30 |
<executions> |
|
31 |
<!-- |
|
32 |
Generates a jar file only with the simple Metadata |
|
33 |
implementation. |
|
34 |
--> |
|
35 |
<execution> |
|
36 |
<id>simple</id> |
|
37 |
<phase>package</phase> |
|
38 |
<goals> |
|
39 |
<goal>jar</goal> |
|
40 |
</goals> |
|
41 |
<configuration> |
|
42 |
<classifier>simple</classifier> |
|
43 |
<excludes> |
|
44 |
<exclude>**/extended/**</exclude> |
|
45 |
</excludes> |
|
46 |
</configuration> |
|
47 |
</execution> |
|
48 |
<!-- |
|
49 |
Generates a jar file only with the extended Metadata |
|
50 |
implementation. |
|
51 |
--> |
|
52 |
<execution> |
|
53 |
<id>extended</id> |
|
54 |
<phase>package</phase> |
|
55 |
<goals> |
|
56 |
<goal>jar</goal> |
|
57 |
</goals> |
|
58 |
<configuration> |
|
59 |
<classifier>extended</classifier> |
|
60 |
<excludes> |
|
61 |
<exclude>**/simple/**</exclude> |
|
62 |
</excludes> |
|
63 |
</configuration> |
|
64 |
</execution> |
|
65 |
</executions> |
|
66 |
</plugin> |
|
67 |
</plugins> |
|
68 |
</build> |
|
69 |
</project> |
tags/tmp_build/libraries/libMetadata/.settings/org.eclipse.jdt.core.prefs | ||
---|---|---|
1 |
#Fri Oct 03 10:28:48 CEST 2008 |
|
2 |
eclipse.preferences.version=1 |
|
3 |
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
|
4 |
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 |
|
5 |
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
|
6 |
org.eclipse.jdt.core.compiler.compliance=1.6 |
|
7 |
org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
|
8 |
org.eclipse.jdt.core.compiler.debug.localVariable=generate |
|
9 |
org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
|
10 |
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
|
11 |
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
|
12 |
org.eclipse.jdt.core.compiler.source=1.4 |
tags/tmp_build/libraries/libMetadata/.settings/org.eclipse.jdt.ui.prefs | ||
---|---|---|
1 |
#Wed Apr 16 11:26:02 CEST 2008 |
|
2 |
eclipse.preferences.version=1 |
|
3 |
internal.default.compliance=user |
tags/tmp_build/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="org.gvsig.metadata"/> |
|
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> |
tags/tmp_build/libraries/libMetadata/.classpath | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="src" path="src"/> |
|
4 |
<classpathentry kind="src" path="src-test"/> |
|
5 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
|
6 |
<classpathentry kind="lib" path="lib/junit-4.4.jar"/> |
|
7 |
<classpathentry kind="var" path="GVSIG_INSTALL_DIR/bin/lib/org.gvsig.tools.jar" sourcepath="/libToolsDIR"/> |
|
8 |
<classpathentry kind="output" path="bin"/> |
|
9 |
</classpath> |
|
0 | 10 |
tags/tmp_build/libraries/libDwg/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>libDwg</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
<project>libFMap</project> |
|
7 |
</projects> |
|
8 |
<buildSpec> |
|
9 |
<buildCommand> |
|
10 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
11 |
<arguments> |
|
12 |
</arguments> |
|
13 |
</buildCommand> |
|
14 |
<buildCommand> |
|
15 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
16 |
<arguments> |
|
17 |
</arguments> |
|
18 |
</buildCommand> |
|
19 |
</buildSpec> |
|
20 |
<natures> |
|
21 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
22 |
</natures> |
|
23 |
</projectDescription> |
|
0 | 24 |
tags/tmp_build/libraries/libDwg/src-test/com/iver/cit/jdwglib/dwg/AllTests.java | ||
---|---|---|
1 |
package com.iver.cit.jdwglib.dwg; |
|
2 |
|
|
3 |
import junit.framework.Test; |
|
4 |
import junit.framework.TestSuite; |
|
5 |
|
|
6 |
public class AllTests { |
|
7 |
|
|
8 |
public static Test suite() { |
|
9 |
TestSuite suite = new TestSuite("Test for com.iver.cit.jdwglib.dwg"); |
|
10 |
//$JUnit-BEGIN$ |
|
11 |
suite.addTestSuite(DwgFileTest.class); |
|
12 |
//$JUnit-END$ |
|
13 |
return suite; |
|
14 |
} |
|
15 |
|
|
16 |
} |
|
0 | 17 |
tags/tmp_build/libraries/libDwg/src-test/com/iver/cit/jdwglib/dwg/DwgTestSuite.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 08-feb-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id$ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2007-02-08 20:27:57 azabala |
|
49 |
* *** empty log message *** |
|
50 |
* |
|
51 |
* |
|
52 |
*/ |
|
53 |
package com.iver.cit.jdwglib.dwg; |
|
54 |
|
|
55 |
import junit.framework.Test; |
|
56 |
import junit.framework.TestSuite; |
|
57 |
|
|
58 |
public class DwgTestSuite { |
|
59 |
|
|
60 |
public static Test suite() { |
|
61 |
TestSuite suite = new TestSuite("Test for com.iver.cit.jdwglib.dwg"); |
|
62 |
//$JUnit-BEGIN$ |
|
63 |
suite.addTestSuite(DwgFileTest.class); |
|
64 |
//$JUnit-END$ |
|
65 |
return suite; |
|
66 |
} |
|
67 |
|
|
68 |
} |
|
69 |
|
|
0 | 70 |
tags/tmp_build/libraries/libDwg/src-test/com/iver/cit/jdwglib/dwg/DwgFileTest.java | ||
---|---|---|
1 |
package com.iver.cit.jdwglib.dwg; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.IOException; |
|
5 |
import java.net.URL; |
|
6 |
import java.util.List; |
|
7 |
|
|
8 |
import junit.framework.TestCase; |
|
9 |
|
Also available in: Unified diff