diff --git a/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/xml/Filter200XMLEncoder.java b/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/xml/Filter200XMLEncoder.java index 296045c594..9a85da357c 100644 --- a/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/xml/Filter200XMLEncoder.java +++ b/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/xml/Filter200XMLEncoder.java @@ -73,6 +73,7 @@ import org.deegree.filter.comparison.PropertyIsLessThan; import org.deegree.filter.comparison.PropertyIsLessThanOrEqualTo; import org.deegree.filter.comparison.PropertyIsLike; +import org.deegree.filter.comparison.PropertyIsNil; import org.deegree.filter.comparison.PropertyIsNotEqualTo; import org.deegree.filter.comparison.PropertyIsNull; import org.deegree.filter.expression.Function; @@ -123,14 +124,15 @@ public class Filter200XMLEncoder { spatialOperatorTypeToElementName.put( SpatialOperator.SubType.EQUALS, new QName( FES_20_NS, "Equals" ) ); spatialOperatorTypeToElementName.put( SpatialOperator.SubType.DISJOINT, new QName( FES_20_NS, "Disjoint" ) ); spatialOperatorTypeToElementName.put( SpatialOperator.SubType.DWITHIN, new QName( FES_20_NS, "DWithin" ) ); - spatialOperatorTypeToElementName.put( SpatialOperator.SubType.INTERSECTS, new QName( FES_20_NS, "Intersects" ) ); + spatialOperatorTypeToElementName.put( SpatialOperator.SubType.INTERSECTS, + new QName( FES_20_NS, "Intersects" ) ); spatialOperatorTypeToElementName.put( SpatialOperator.SubType.OVERLAPS, new QName( FES_20_NS, "Overlaps" ) ); spatialOperatorTypeToElementName.put( SpatialOperator.SubType.TOUCHES, new QName( FES_20_NS, "Touches" ) ); spatialOperatorTypeToElementName.put( SpatialOperator.SubType.WITHIN, new QName( FES_20_NS, "Within" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.AFTER, new QName( FES_20_NS, "After" ) ); - temporalOperatorTypeToElementName.put( TemporalOperator.SubType.ANYINTERACTS, new QName( FES_20_NS, - "AnyInteracts" ) ); + temporalOperatorTypeToElementName.put( TemporalOperator.SubType.ANYINTERACTS, + new QName( FES_20_NS, "AnyInteracts" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.BEFORE, new QName( FES_20_NS, "Before" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.BEGINS, new QName( FES_20_NS, "Begins" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.BEGUNBY, new QName( FES_20_NS, "BegunBy" ) ); @@ -138,11 +140,13 @@ public class Filter200XMLEncoder { temporalOperatorTypeToElementName.put( TemporalOperator.SubType.ENDEDBY, new QName( FES_20_NS, "EndedBy" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.MEETS, new QName( FES_20_NS, "Meets" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.METBY, new QName( FES_20_NS, "MetBy" ) ); - temporalOperatorTypeToElementName.put( TemporalOperator.SubType.OVERLAPPEDBY, new QName( FES_20_NS, - "OverlappedBy" ) ); - temporalOperatorTypeToElementName.put( TemporalOperator.SubType.TCONTAINS, new QName( FES_20_NS, "TContains" ) ); + temporalOperatorTypeToElementName.put( TemporalOperator.SubType.OVERLAPPEDBY, + new QName( FES_20_NS, "OverlappedBy" ) ); + temporalOperatorTypeToElementName.put( TemporalOperator.SubType.TCONTAINS, + new QName( FES_20_NS, "TContains" ) ); temporalOperatorTypeToElementName.put( TemporalOperator.SubType.TEQUALS, new QName( FES_20_NS, "TEquals" ) ); - temporalOperatorTypeToElementName.put( TemporalOperator.SubType.TOVERLAPS, new QName( FES_20_NS, "TOverlaps" ) ); + temporalOperatorTypeToElementName.put( TemporalOperator.SubType.TOVERLAPS, + new QName( FES_20_NS, "TOverlaps" ) ); } /** @@ -243,6 +247,9 @@ private static void export( ComparisonOperator operator, XMLStreamWriter writer case PROPERTY_IS_NULL: export( (PropertyIsNull) operator, writer ); break; + case PROPERTY_IS_NIL: + export( (PropertyIsNil) operator, writer ); + break; default: throw new IllegalArgumentException( "Encoding of operator subtype " + operator.getType() + " is not supported yet!" ); @@ -440,6 +447,13 @@ private static void export( PropertyIsNull operator, XMLStreamWriter writer ) writer.writeEndElement(); } + private static void export( PropertyIsNil operator, XMLStreamWriter writer ) + throws XMLStreamException { + writer.writeStartElement( FES_20_NS, "PropertyIsNil" ); + export( operator.getPropertyName(), writer ); + writer.writeEndElement(); + } + private static void export( XMLStreamWriter writer, And andOp ) throws XMLStreamException, UnknownCRSException, TransformationException { writer.writeStartElement( FES_20_NS, "And" ); diff --git a/deegree-core/deegree-core-base/src/test/java/org/deegree/filter/xml/Filter200XMLEncoderParameterizedTest.java b/deegree-core/deegree-core-base/src/test/java/org/deegree/filter/xml/Filter200XMLEncoderParameterizedTest.java index 0b62fa904b..17b2e7f850 100644 --- a/deegree-core/deegree-core-base/src/test/java/org/deegree/filter/xml/Filter200XMLEncoderParameterizedTest.java +++ b/deegree-core/deegree-core-base/src/test/java/org/deegree/filter/xml/Filter200XMLEncoderParameterizedTest.java @@ -86,11 +86,12 @@ public static List data() filterTests.add( new Object[] { "testfilter5.xml", asString( "v200/testfilter5.xml" ) } ); filterTests.add( new Object[] { "testfilter6.xml", asString( "v200/testfilter6.xml" ) } ); filterTests.add( new Object[] { "testfilter7.xml", asString( "v200/testfilter7.xml" ) } ); + filterTests.add( new Object[] { "testfilter8.xml", asString( "v200/testfilter8.xml" ) } ); filterTests.add( new Object[] { "aixm_by_gml_identifier.xml", asString( "v200/aixm_by_gml_identifier.xml" ) } ); filterTests.add( new Object[] { "aixm_custom_geometry_bbox.xml", - asString( "v200/aixm_custom_geometry_bbox.xml" ) } ); + asString( "v200/aixm_custom_geometry_bbox.xml" ) } ); filterTests.add( new Object[] { "aixm_custom_geometry_property.xml", - asString( "v200/aixm_custom_geometry_property.xml" ) } ); + asString( "v200/aixm_custom_geometry_property.xml" ) } ); filterTests.add( new Object[] { "aixm_timeinstant_begin.xml", asString( "v200/aixm_timeinstant_begin.xml" ) } ); filterTests.add( new Object[] { "temporal/tequals.xml", asString( "v200/temporal/tequals.xml" ) } ); return filterTests; diff --git a/deegree-core/deegree-core-base/src/test/resources/org/deegree/filter/xml/v200/testfilter8.xml b/deegree-core/deegree-core-base/src/test/resources/org/deegree/filter/xml/v200/testfilter8.xml new file mode 100644 index 0000000000..53fb059b89 --- /dev/null +++ b/deegree-core/deegree-core-base/src/test/resources/org/deegree/filter/xml/v200/testfilter8.xml @@ -0,0 +1,7 @@ + + + + app:nilTest + + \ No newline at end of file