Revision 40799 branches/v02_desarrollo/libraries/sld/temp/org.gvsig.sldsupport.lib.impl/src/main/java/org/gvsig/sldsupport/impl/sld1_0_0/parsing/filteroperator/comparison/IsLikeComparisonElement.java
IsLikeComparisonElement.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
parser.require(KXmlParser.START_TAG, null, FilterTags.PROPERTYISLIKE); |
19 | 19 |
int tag = 0; |
20 |
|
|
21 | 20 |
SLDIsLikeOperator resp = new SLDIsLikeOperator(); |
22 |
|
|
21 |
// ------------------------------------------------------- |
|
22 |
String att = parser.getAttributeValue(null, FilterTags.WILDCHAR); |
|
23 |
if (att == null) { |
|
24 |
throw new SLDReadException("Attribute required in IsLike operator: 'wildCard' "); |
|
25 |
} else { |
|
26 |
resp.setWildCard(att); |
|
27 |
} |
|
28 |
// ------------------------------------------------------- |
|
29 |
att = parser.getAttributeValue(null, FilterTags.SINGLECHAR); |
|
30 |
if (att == null) { |
|
31 |
throw new SLDReadException("Attribute required in IsLike operator: 'singleChar' "); |
|
32 |
} else { |
|
33 |
resp.setSingleChar(att); |
|
34 |
} |
|
35 |
// ------------------------------------------------------- |
|
36 |
att = parser.getAttributeValue(null, FilterTags.ESCAPECHAR); |
|
37 |
if (att == null) { |
|
38 |
throw new SLDReadException("Attribute required in IsLike operator: 'escapeChar' "); |
|
39 |
} else { |
|
40 |
resp.setEscapeChar(att); |
|
41 |
} |
|
42 |
// ------------------------------------------------------- |
|
23 | 43 |
tag = parser.nextTag(); |
24 | 44 |
String name = parser.getName(); |
25 |
|
|
26 |
String att = parser.getAttributeValue(null, "wildCard"); |
|
27 |
resp.setWildCard(att); |
|
28 |
att = parser.getAttributeValue(null, "singleChar"); |
|
29 |
resp.setSingleChar(att); |
|
30 |
att = parser.getAttributeValue(null, "escapeChar"); |
|
31 |
resp.setEscapeChar(att); |
|
32 |
|
|
33 | 45 |
String txt = null; |
34 | 46 |
while (!(SLDUtils.isStr(name, FilterTags.PROPERTYISLIKE) |
35 | 47 |
&& tag == KXmlParser.END_TAG)) { |
... | ... | |
48 | 60 |
parser.nextTag(); |
49 | 61 |
break; |
50 | 62 |
} |
51 |
break; |
|
63 |
|
|
64 |
/* |
|
65 |
* Any other entity causes parsing error |
|
66 |
*/ |
|
67 |
throw new SLDReadException("Bad SLD file. Unexpected entity in IsLikeOperator: " + name); |
|
52 | 68 |
case KXmlParser.END_TAG: |
53 | 69 |
break; |
54 | 70 |
case KXmlParser.TEXT: |
Also available in: Unified diff