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 / WMTSServiceIdentification_1_0_0.java @ 1961
History | View | Annotate | Download (2.94 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.WMTSServiceIdentificationImpl; |
28 |
import org.kxml2.io.KXmlParser; |
29 |
import org.xmlpull.v1.XmlPullParserException; |
30 |
|
31 |
/**
|
32 |
* General information about this server
|
33 |
*
|
34 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
35 |
*/
|
36 |
public class WMTSServiceIdentification_1_0_0 extends WMTSServiceIdentificationImpl { |
37 |
/**
|
38 |
* Parses a theme
|
39 |
* @param parser
|
40 |
* @param content
|
41 |
* @throws IOException
|
42 |
* @throws XmlPullParserException
|
43 |
*/
|
44 |
public void parse(KXmlParser parser) throws IOException, XmlPullParserException { |
45 |
int currentTag;
|
46 |
boolean end = false; |
47 |
|
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 |
WMTSKeywords_1_0_0 keywords = new WMTSKeywords_1_0_0();
|
61 |
keywords.parse(parser); |
62 |
setKeywords(keywords.getKeywords()); |
63 |
} else if (compareName(parser, Tags.WMTS_SERVICETYPE)) { |
64 |
setServiceType(nextText(parser)); |
65 |
} else if (compareName(parser, Tags.WMTS_SERVICETYPEVERSION)) { |
66 |
setServiceTypeVersion(nextText(parser)); |
67 |
} else if (compareName(parser, Tags.WMTS_PROFILE)) { |
68 |
setProfile(nextText(parser)); |
69 |
} else if (compareName(parser, Tags.WMTS_FEES)) { |
70 |
setFees(nextText(parser)); |
71 |
} else if (compareName(parser, Tags.WMTS_ACCESSCONSTRAINTS)) { |
72 |
setAccessConstraints(nextText(parser)); |
73 |
} |
74 |
break;
|
75 |
case KXmlParser.END_TAG:
|
76 |
if (compareName(parser, Tags.WMTS_SERVICEID))
|
77 |
end = true;
|
78 |
break;
|
79 |
case KXmlParser.TEXT:
|
80 |
break;
|
81 |
} |
82 |
if (!end)
|
83 |
currentTag = parser.next(); |
84 |
} |
85 |
} |
86 |
} |