svn-gvsig-desktop / branches / v02_desarrollo / libraries / sld / temp / org.gvsig.sldsupport.lib.impl / src / main / java / org / gvsig / sldsupport / impl / sld1_0_0 / parsing / filteroperator / logic / UnaryLogicOperatorElement.java @ 40794
History | View | Annotate | Download (1.46 KB)
1 |
package org.gvsig.sldsupport.impl.sld1_0_0.parsing.filteroperator.logic; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
|
5 |
import org.gvsig.sldsupport.exception.SLDReadException; |
6 |
import org.gvsig.sldsupport.impl.sld1_0_0.parsing.filteroperator.FilterOperatorElement; |
7 |
import org.gvsig.sldsupport.impl.util.SLDUtils; |
8 |
import org.gvsig.sldsupport.sld.SLDTags; |
9 |
import org.gvsig.sldsupport.sld.filter.FilterTags; |
10 |
import org.gvsig.sldsupport.sld.filter.SLDFilterOperator; |
11 |
import org.gvsig.sldsupport.sld.filter.operator.logic.SLDUnaryLogicOperator; |
12 |
import org.gvsig.sldsupport.sld.filter.operator.spatial.GMLEnvelope; |
13 |
import org.gvsig.sldsupport.sld.filter.operator.spatial.SLDBinarySpatialOperator; |
14 |
import org.kxml2.io.KXmlParser; |
15 |
import org.xmlpull.v1.XmlPullParser; |
16 |
import org.xmlpull.v1.XmlPullParserException; |
17 |
|
18 |
public class UnaryLogicOperatorElement { |
19 |
|
20 |
public static SLDUnaryLogicOperator parse(XmlPullParser parser , String version) |
21 |
throws XmlPullParserException, IOException, SLDReadException { |
22 |
|
23 |
SLDUnaryLogicOperator resp = new SLDUnaryLogicOperator();
|
24 |
String op_type = parser.getName();
|
25 |
if (SLDUtils.isStr(op_type, FilterTags.NOT)) {
|
26 |
resp.setIsNot(true);
|
27 |
} else {
|
28 |
throw new SLDReadException("Unknwon unary operator: " + op_type); |
29 |
} |
30 |
|
31 |
parser.next(); |
32 |
SLDFilterOperator foper = FilterOperatorElement.parse(parser, version); |
33 |
resp.setOperator(foper); |
34 |
parser.require(KXmlParser.END_TAG, null, FilterTags.NOT);
|
35 |
parser.next(); |
36 |
return resp;
|
37 |
} |
38 |
} |