root / trunk / libraries / libGPE-GML / src / org / gvsig / gpe / gml / parser / v2 / features / NameBinding.java @ 19366
History | View | Annotate | Download (2.46 KB)
1 |
package org.gvsig.gpe.gml.parser.v2.features; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
|
5 |
import org.gvsig.gpe.gml.parser.GPEDefaultGmlParser; |
6 |
import org.xmlpull.v1.XmlPullParser; |
7 |
import org.xmlpull.v1.XmlPullParserException; |
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: NameBinding.java 195 2007-11-26 09:02:22Z jpiera $
|
52 |
* $Log$
|
53 |
* Revision 1.2 2007/05/16 13:00:48 csanchez
|
54 |
* Actualizaci?n de libGPE-GML
|
55 |
*
|
56 |
* Revision 1.1 2007/05/07 12:58:42 jorpiell
|
57 |
* Add some methods to manage the multigeometries
|
58 |
*
|
59 |
*
|
60 |
*/
|
61 |
/**
|
62 |
* This class parses the gml:name tag. Example:
|
63 |
* <p>
|
64 |
* <pre>
|
65 |
* <code>
|
66 |
* <gml:name>GML tag name</gml:name>
|
67 |
* </code>
|
68 |
* </pre>
|
69 |
* </p>
|
70 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
71 |
*/
|
72 |
public class NameBinding { |
73 |
|
74 |
/**
|
75 |
* It parses the gml:name tag
|
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 name
|
83 |
* @throws XmlPullParserException
|
84 |
* @throws IOException
|
85 |
*/
|
86 |
public static String parse(XmlPullParser parser,GPEDefaultGmlParser handler) throws XmlPullParserException, IOException { |
87 |
//Put the pointer into the value tag
|
88 |
parser.next(); |
89 |
//Retrieve the value
|
90 |
String name = parser.getText();
|
91 |
//Put the value into the end tag
|
92 |
parser.next(); |
93 |
return name;
|
94 |
} |
95 |
} |