Statistics
| Revision:

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

History | View | Annotate | Download (2.29 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
import java.util.ArrayList;
26

    
27
import org.gvsig.remoteclient.utils.CapabilitiesTags;
28
import org.gvsig.remoteclient.wmts.struct.WMTSBaseStruct;
29
import org.kxml2.io.KXmlParser;
30
import org.xmlpull.v1.XmlPullParserException;
31

    
32
/**
33
 * <p>Keywords for a WMTS Layer</p>
34
 *
35
 * @author Nacho Brodin (nachobrodin@gmail.com)
36
 */
37
public class WMTSKeywords_1_0_0 extends WMTSBaseStruct {
38
        private ArrayList    keywords            = null;
39
        
40
        public ArrayList getKeywords() {
41
                return keywords;
42
        }
43

    
44
        public void addKeyword(String k) {
45
                if(keywords == null)
46
                        keywords = new ArrayList();
47
                keywords.add(k);
48
        }
49
        
50
        /**
51
     * Parses the layer's style
52
     * @param parser
53
     * @param style
54
     * @throws IOException
55
     * @throws XmlPullParserException
56
     */
57
    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
58
            int currentTag;
59
            boolean end = false;
60
            
61
            currentTag = parser.next();
62
            
63
            while (!end) {
64
                         switch(currentTag) {
65
                                case KXmlParser.START_TAG:
66
                                        if (compareName(parser, CapabilitiesTags.WMTS_KEYWORD)) {
67
                                                addKeyword(nextText(parser));
68
                                        }
69
                                        break;
70
                                case KXmlParser.END_TAG:
71
                                        if (compareName(parser, CapabilitiesTags.WMTS_KEYWORDS))
72
                                                end = true;
73
                                        break;
74
                                case KXmlParser.TEXT:                                        
75
                                break;
76
                         }
77
             if (!end)
78
                 currentTag = parser.next();
79
            }
80
    }
81
}