Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / parser / v21 / features / FeatureBinding.java @ 37960

History | View | Annotate | Download (2.74 KB)

1
package org.gvsig.gpe.kml.parser.v21.features;
2

    
3
import org.gvsig.gpe.kml.parser.GPEDefaultKmlParser;
4
import org.gvsig.gpe.kml.utils.Kml2_1_Tags;
5
import org.gvsig.gpe.xml.stream.IXmlStreamReader;
6
import org.gvsig.gpe.xml.stream.XmlStreamException;
7
import org.gvsig.gpe.xml.utils.CompareUtils;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: FeatureBinding.java 357 2008-01-09 17:50:08Z jpiera $
52
 * $Log$
53
 * Revision 1.1  2007/05/11 07:06:29  jorpiell
54
 * Refactoring of some package names
55
 *
56
 * Revision 1.1  2007/05/08 08:22:37  jorpiell
57
 * Add comments to create javadocs
58
 *
59
 * Revision 1.1  2007/04/20 08:38:59  jorpiell
60
 * Tests updating
61
 *
62
 *
63
 */
64
/**
65
 * This is an abstract element and cannot be used 
66
 * directly in a KML file. Document, Folder, NetworkLink,
67
 * Placemark, GroundOverLay and ScreenOverlay inherit from
68
 * it. It parses the common attributes
69
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
70
 * @see http://code.google.com/apis/kml/documentation/kml_tags_21.html#feature
71
 */
72
public class FeatureBinding {
73
        
74
        /**
75
         * It returns the feature id attribute
76
         * @param parser
77
         * The XML parser
78
         * @param handler
79
         * The GPE parser that contains the content handler and
80
         * the error handler
81
         * @return
82
         * The feature id
83
         * @throws XmlStreamException 
84
         */
85
        public  String getID(IXmlStreamReader parser,GPEDefaultKmlParser handler) throws XmlStreamException{
86
                String id = null;
87
                for (int i=0 ; i<parser.getAttributeCount() ; i++){
88
                        if (CompareUtils.compareWithOutNamespace(parser.getAttributeName(i),Kml2_1_Tags.ID)){
89
                                id = parser.getAttributeValue(i);
90
                        }                
91
                }
92
                return id;        
93
        }
94
}