gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.ogc / org.gvsig.raster.wmts.ogc.impl / src / main / java / org / gvsig / raster / wmts / ogc / impl / wmts_1_0_0 / struct / WMTSDimension_1_0_0.java @ 2613
History | View | Annotate | Download (2.91 KB)
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 |
package org.gvsig.raster.wmts.ogc.impl.wmts_1_0_0.struct; |
23 |
|
24 |
import java.io.IOException; |
25 |
|
26 |
import org.gvsig.raster.wmts.ogc.impl.Tags; |
27 |
import org.gvsig.raster.wmts.ogc.impl.struct.WMTSDimensionImpl; |
28 |
import org.kxml2.io.KXmlParser; |
29 |
import org.xmlpull.v1.XmlPullParserException; |
30 |
|
31 |
/**
|
32 |
* Description of an image that represents the legend of the map
|
33 |
*
|
34 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
35 |
*/
|
36 |
public class WMTSDimension_1_0_0 extends WMTSDimensionImpl { |
37 |
/**
|
38 |
* Parses the dimension section
|
39 |
* @param parser
|
40 |
* @throws IOException
|
41 |
* @throws XmlPullParserException
|
42 |
*/
|
43 |
public void parse(KXmlParser parser) throws IOException, XmlPullParserException { |
44 |
int currentTag;
|
45 |
boolean end = false; |
46 |
|
47 |
//parser.require(KXmlParser.START_TAG, null, Tags.WMTS_DIMENSIONS);
|
48 |
currentTag = parser.next(); |
49 |
|
50 |
while (!end) {
|
51 |
switch(currentTag) {
|
52 |
case KXmlParser.START_TAG:
|
53 |
if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
|
54 |
setIdentifier(nextText(parser)); |
55 |
} else if (compareName(parser, Tags.WMTS_TITLE)) { |
56 |
setTitle(nextText(parser)); |
57 |
} else if (compareName(parser, Tags.WMTS_ABSTRACT)) { |
58 |
setAbstract(nextText(parser)); |
59 |
} else if (compareName(parser, Tags.WMTS_KEYWORDS)) { |
60 |
parser.skipSubTree(); |
61 |
} else if (compareName(parser, Tags.WMTS_UNITSYMBOL)) { |
62 |
setUnitSymbol(nextText(parser)); |
63 |
} else if (compareName(parser, Tags.WMTS_DEFAULTVALUE)) { |
64 |
setDefaultValue(nextText(parser)); |
65 |
} else if (compareName(parser, Tags.WMTS_CURRENT)) { |
66 |
Boolean b = new Boolean(nextText(parser)); |
67 |
setCurrent(b.booleanValue()); |
68 |
} else if (compareName(parser, Tags.WMTS_AVAILABLEVALUE)) { |
69 |
addAvailableValue(nextText(parser)); |
70 |
} else if (compareName(parser, Tags.WMTS_UOM)) { |
71 |
setUOM(nextText(parser)); |
72 |
} |
73 |
break;
|
74 |
case KXmlParser.END_TAG:
|
75 |
if (compareName(parser, Tags.WMTS_DIMENSION))
|
76 |
end = true;
|
77 |
break;
|
78 |
case KXmlParser.TEXT:
|
79 |
break;
|
80 |
} |
81 |
if (!end)
|
82 |
currentTag = parser.next(); |
83 |
} |
84 |
} |
85 |
} |