Statistics
| Revision:

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 / comparison / BinaryComparisonOperatorElement.java @ 40799

History | View | Annotate | Download (1.47 KB)

1 40794 jldominguez
package org.gvsig.sldsupport.impl.sld1_0_0.parsing.filteroperator.comparison;
2 40793 jldominguez
3
import java.io.IOException;
4
5
import org.gvsig.sldsupport.exception.SLDReadException;
6 40794 jldominguez
import org.gvsig.sldsupport.impl.sld1_0_0.parsing.expression.ExpressionElement;
7 40793 jldominguez
import org.gvsig.sldsupport.impl.util.SLDUtils;
8 40799 jldominguez
import org.gvsig.sldsupport.sld.SLDTags;
9
import org.gvsig.sldsupport.sld.filter.FilterTags;
10 40794 jldominguez
import org.gvsig.sldsupport.sld.filter.expression.SLDExpression;
11
import org.gvsig.sldsupport.sld.filter.operator.comparison.SLDBinaryComparisonOperator;
12 40793 jldominguez
import org.kxml2.io.KXmlParser;
13
import org.xmlpull.v1.XmlPullParser;
14
import org.xmlpull.v1.XmlPullParserException;
15
16
public class BinaryComparisonOperatorElement {
17
18 40794 jldominguez
        public static SLDBinaryComparisonOperator parse(XmlPullParser parser , String version)
19 40793 jldominguez
                        throws XmlPullParserException, IOException, SLDReadException {
20
21 40794 jldominguez
                SLDBinaryComparisonOperator resp = new SLDBinaryComparisonOperator();
22
                String op_name = parser.getName();
23 40793 jldominguez
24 40799 jldominguez
                String mcase = parser.getAttributeValue(null, FilterTags.MATCHCASE_ATT);
25 40794 jldominguez
                resp.setIsCaseSensitive(SLDUtils.isStr(mcase, "true"));
26 40793 jldominguez
27 40794 jldominguez
                resp.setComparisonOperator(op_name);
28 40796 jldominguez
                parser.nextTag();
29 40793 jldominguez
30 40794 jldominguez
                SLDExpression expre = null;
31
                expre = ExpressionElement.parse(parser, version);
32
                resp.setFirstExpression(expre);
33
                expre = ExpressionElement.parse(parser, version);
34
                resp.setSecondExpression(expre);
35
36
                parser.require(KXmlParser.END_TAG, null, op_name);
37 40796 jldominguez
                parser.nextTag();
38 40793 jldominguez
                return resp;
39 40794 jldominguez
40 40793 jldominguez
        }
41
}