Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / struct / WMTSBaseStruct.java @ 38531

History | View | Annotate | Download (2.81 KB)

1 34236 nbrodin
/* 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.struct;
23
24
import java.io.IOException;
25
26
import org.gvsig.remoteclient.utils.CapabilitiesTags;
27
import org.kxml2.io.KXmlParser;
28
import org.xmlpull.v1.XmlPullParserException;
29
30
/**
31
 * Base class for WMTS structures
32
 * @author Nacho Brodin (nachobrodin@gmail.com)
33
 */
34
public abstract class WMTSBaseStruct {
35 37802 nbrodin
        public  static String        gmlTag              = CapabilitiesTags.WMTS_GMLTAG;
36
        private String               identifier          = null;
37
        private String               title               = null;
38
    private String               abstractObj         = null;
39 34236 nbrodin
40
    /**
41
     * Parses this service ID
42
     * @param parser
43
     * @param content
44
     * @throws IOException
45
     * @throws XmlPullParserException
46
     */
47
    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException;
48
49
50
    public String getIdentifier() {
51
                return identifier;
52
        }
53
54
        public void setIdentifier(String identifier) {
55
                this.identifier = identifier;
56
        }
57
58
        public String getTitle() {
59
                return title;
60
        }
61
62
        public void setTitle(String title) {
63
                this.title = title;
64
        }
65
66
        public String getAbstract() {
67
                return abstractObj;
68
        }
69
70
        public void setAbstract(String abstr) {
71
                this.abstractObj = abstr;
72
        }
73
74
    /**
75
     * Compares the next name in the selected parser with the string passed
76
     * by value.
77
     * @param parser
78
     * @param name
79
     * @return
80
     */
81
    public boolean compareName(KXmlParser parser, String name) {
82
            String s = parser.getName();
83
            if(s.compareTo(name) == 0 || s.compareTo(gmlTag + name) == 0)
84
                    return true;
85
            return false;
86
    }
87 35468 nbrodin
88
    /**
89
     * Gets the next text from the parser if this exists
90
     * @param parser
91
     * @return
92
     * @throws XmlPullParserException
93
     * @throws IOException
94
     */
95
    public String nextText(KXmlParser parser) throws XmlPullParserException, IOException {
96
            return !parser.isEmptyElementTag() ? parser.nextText() : "";
97
    }
98 34236 nbrodin
}