Statistics
| Revision:

svn-gvsig-desktop / tags / Root_v06 / libraries / libRemoteServices / src / org / gvsig / remoteClient / wms / wms_1_1_1 / WMSStyle1_1_1.java @ 4811

History | View | Annotate | Download (1.61 KB)

1

    
2
package org.gvsig.remoteClient.wms.wms_1_1_1;
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.1</p>
12
 * 
13
 */
14
public class WMSStyle1_1_1 extends org.gvsig.remoteClient.wms.WMSStyle {
15

    
16
/**
17
 * <p>Parses the STYLE TAG according with the OGC Specifications for the WMS 1.1.1</p>
18
 */
19
    public void parse(KXmlParser parser) throws IOException, XmlPullParserException
20
    {        
21
            int currentTag;
22
            boolean end = false;
23
            
24
            parser.require(KXmlParser.START_TAG, null, CapabilitiesTags.STYLE);
25
            currentTag = parser.nextTag();
26
            
27
            while (!end) 
28
            {
29
                         switch(currentTag)
30
                         {
31
                                case KXmlParser.START_TAG:
32
                                        if (parser.getName().compareTo(CapabilitiesTags.NAME)==0)
33
                                        {                                                
34
                                                setName(parser.nextText());                                                
35
                                        }        
36
                                        else if (parser.getName().compareTo(CapabilitiesTags.TITLE)==0)
37
                                        {
38
                                                setTitle(parser.nextText());
39
                                        }
40
                                        else if (parser.getName().compareTo(CapabilitiesTags.ABSTRACT)==0)
41
                                        {
42
                                                setAbstract(parser.nextText());
43
                                        }        
44
                                        else if (parser.getName().compareTo(CapabilitiesTags.LEGENDURL)==0)
45
                                        {
46
                                                parseLegendURL(parser);
47
                                        }
48
                                        break;
49
                                case KXmlParser.END_TAG:
50
                                        if (parser.getName().compareTo(CapabilitiesTags.STYLE) == 0)
51
                                                end = true;
52
                                        break;
53
                                case KXmlParser.TEXT:                                        
54
                                        break;
55
                         }
56
                         if (!end)
57
                         {
58
                                 currentTag = parser.nextTag();
59
                         }
60
            }
61
            parser.require(KXmlParser.END_TAG, null, CapabilitiesTags.STYLE);
62
    } 
63
 }