Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wms / wms_1_1_1 / WMSStyle1_1_1.java @ 33738

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.kxml2.io.KXmlParser;
7
import org.xmlpull.v1.XmlPullParserException;
8

    
9
import org.gvsig.remoteclient.utils.CapabilitiesTags;
10

    
11
/**
12
 * <p>Represents the layer style defined by the OGC Specifications for WMS 1.1.1</p>
13
 * 
14
 */
15
public class WMSStyle1_1_1 extends org.gvsig.remoteclient.wms.WMSStyle {
16

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