Statistics
| Revision:

svn-gvsig-desktop / tags / Root_v061 / libraries / libRemoteServices / src / org / gvsig / remoteClient / wms / wms_1_1_0 / WMSStyle1_1_0.java @ 4812

History | View | Annotate | Download (1.64 KB)

1 3687 ldiaz
2
package org.gvsig.remoteClient.wms.wms_1_1_0;
3
4
import java.io.IOException;
5
6
import org.gvsig.remoteClient.utils.CapabilitiesTags;
7
import org.kxml2.io.KXmlParser;
8
import org.xmlpull.v1.XmlPullParserException;
9
10
/**
11
 * <p>Represents the layer style defined by the OGC Specifications for WMS 1.1.0</p>
12
 *
13
 */
14
public class WMSStyle1_1_0 extends org.gvsig.remoteClient.wms.WMSStyle {
15
16
/**
17
 * <p>URL pointing to the legend for a layer with this style</p>
18
 */
19
20
/**
21
 * <p>Parses the STYLE TAG according with the OGC Specifications for the WMS 1.1.1</p>
22
 */
23
    public void parse(KXmlParser parser) throws IOException, XmlPullParserException
24
    {
25
            int currentTag;
26
            boolean end = false;
27
28
            parser.require(KXmlParser.START_TAG, null, CapabilitiesTags.STYLE);
29
            currentTag = parser.nextTag();
30
31
            while (!end)
32
            {
33
                         switch(currentTag)
34
                         {
35
                                case KXmlParser.START_TAG:
36
                                        if (parser.getName().compareTo(CapabilitiesTags.NAME)==0)
37
                                        {
38
                                                setName(parser.nextText());
39
                                        }
40
                                        else if (parser.getName().compareTo(CapabilitiesTags.TITLE)==0)
41
                                        {
42
                                                setTitle(parser.nextText());
43
                                        }
44
                                        else if (parser.getName().compareTo(CapabilitiesTags.ABSTRACT)==0)
45
                                        {
46
                                                setAbstract(parser.nextText());
47
                                        }
48
                                        else if (parser.getName().compareTo(CapabilitiesTags.LEGENDURL)==0)
49
                                        break;
50
                                case KXmlParser.END_TAG:
51
                                        if (parser.getName().compareTo(CapabilitiesTags.STYLE) == 0)
52
                                                end = true;
53
                                        break;
54
                                case KXmlParser.TEXT:
55
                                        break;
56
                         }
57
                         if (!end)
58
                         {
59
                                 currentTag = parser.next();
60
                         }
61
            }
62
            parser.require(KXmlParser.END_TAG, null, CapabilitiesTags.STYLE);
63
    }
64
 }