svn-gvsig-desktop / branches / v02_desarrollo / libraries / sld / temp / org.gvsig.sldsupport.lib.impl / src / main / java / org / gvsig / sldsupport / impl / sld1_0_0 / SLDFeatureTypeConstraint1_0_0.java @ 40787
History | View | Annotate | Download (3.56 KB)
1 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib��ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package org.gvsig.sldsupport.impl.sld1_0_0; |
42 |
|
43 |
import java.io.IOException; |
44 |
|
45 |
import org.gvsig.sldsupport.exception.SLDReadException; |
46 |
import org.gvsig.sldsupport.feature.SLDFeatureTypeConstraint; |
47 |
import org.gvsig.sldsupport.filterencoding.Filter; |
48 |
import org.gvsig.sldsupport.util.SLDTags; |
49 |
import org.xmlpull.v1.XmlPullParser; |
50 |
import org.xmlpull.v1.XmlPullParserException; |
51 |
|
52 |
/**
|
53 |
* Implements the FeatureTypeConstraint element of an SLD implementation
|
54 |
* specification (version 1.0.0).<p>
|
55 |
* A FeatureTypeConstraint element is used to identify a feature type by a
|
56 |
* well-known name, using the FeatureTypeName element. Any positive number of
|
57 |
* FeatureTypeConstraints may be used to define the features of a layer, though
|
58 |
* all FeatureTypeConstraints in a UserLayer must come from the same WFS source.
|
59 |
*
|
60 |
* @see SLDExtent1_0_0
|
61 |
* @see http://portal.opengeospatial.org/files/?artifact_id=1188
|
62 |
*
|
63 |
* @author pepe vidal salvador - jose.vidal.salvador@iver.es
|
64 |
*/
|
65 |
public class SLDFeatureTypeConstraint1_0_0 extends SLDFeatureTypeConstraint{ |
66 |
|
67 |
|
68 |
public void parse(XmlPullParser parser, int cuTag, String expressionType) |
69 |
throws IOException, XmlPullParserException, SLDReadException { |
70 |
int currentTag;
|
71 |
boolean end = false; |
72 |
|
73 |
parser.require(XmlPullParser.START_TAG, null, SLDTags.FEATURETYPECONSTRAINT);
|
74 |
currentTag = parser.next(); |
75 |
|
76 |
while (!end)
|
77 |
{ |
78 |
switch(currentTag)
|
79 |
{ |
80 |
case XmlPullParser.START_TAG:
|
81 |
if (parser.getName().compareTo(SLDTags.FEATURETYPENAME)==0) { |
82 |
setFeatureTypeName(parser.nextText()); |
83 |
} |
84 |
else if (parser.getName().compareTo(SLDTags.FILTER)==0) { |
85 |
Filter filter = new Filter(); |
86 |
filter.parse(parser); |
87 |
setFilter(filter); |
88 |
} |
89 |
else if (parser.getName().compareTo(SLDTags.EXTENT)==0) { |
90 |
SLDExtent1_0_0 extent = new SLDExtent1_0_0();
|
91 |
extent.parse(parser,currentTag,null);
|
92 |
addSldExtent(extent); |
93 |
} |
94 |
break;
|
95 |
case XmlPullParser.END_TAG:
|
96 |
if (parser.getName().compareTo(SLDTags.FEATURETYPECONSTRAINT) == 0) |
97 |
end = true;
|
98 |
break;
|
99 |
case XmlPullParser.TEXT:
|
100 |
break;
|
101 |
} |
102 |
if (!end)
|
103 |
currentTag = parser.next(); |
104 |
} |
105 |
|
106 |
parser.require(XmlPullParser.END_TAG, null, SLDTags.FEATURETYPECONSTRAINT);
|
107 |
|
108 |
|
109 |
} |
110 |
|
111 |
|
112 |
public String toXML() { |
113 |
// TODO Auto-generated method stub
|
114 |
throw new Error ("Not yet implemented"); |
115 |
} |
116 |
} |