Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / wmts_1_0_0 / struct / WMTSDimension_1_0_0.java @ 37808

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.remoteclient.wmts.wmts_1_0_0.struct;
23

    
24
import java.io.IOException;
25

    
26
import org.gvsig.remoteclient.utils.CapabilitiesTags;
27
import org.gvsig.remoteclient.wmts.struct.WMTSDimension;
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 WMTSDimension {
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, CapabilitiesTags.WMTS_DIMENSIONS);
48
            currentTag = parser.next();
49
            
50
            while (!end) {
51
                         switch(currentTag) {
52
                                case KXmlParser.START_TAG:
53
                                        if (compareName(parser, CapabilitiesTags.WMTS_IDENTIFIER)) {
54
                                                setIdentifier(nextText(parser));
55
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_TITLE)) {
56
                                                setTitle(nextText(parser));
57
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_ABSTRACT)) {
58
                                                setAbstract(nextText(parser));
59
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_KEYWORDS)) {
60
                                                parser.skipSubTree();
61
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_UNITSYMBOL)) {
62
                                                setUnitSymbol(nextText(parser));
63
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_DEFAULTVALUE)) {
64
                                                setDefaultValue(nextText(parser));
65
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_CURRENT)) {
66
                                                Boolean b = new Boolean(nextText(parser));
67
                                                setCurrent(b.booleanValue());
68
                                        } else if (compareName(parser, CapabilitiesTags.WMTS_AVAILABLEVALUE)) {
69
                                                setDimensionAvailable(nextText(parser));
70
                                        }
71
                                        break;
72
                                case KXmlParser.END_TAG:
73
                                        if (compareName(parser, CapabilitiesTags.WMTS_DIMENSION))
74
                                                end = true;
75
                                        break;
76
                                case KXmlParser.TEXT:                                        
77
                                break;
78
                         }
79
             if (!end)
80
                 currentTag = parser.next();
81
            }
82
    }
83
}