final String min = formatDateTime( (Date) iv.min ); final String max = formatDateTime( (Date) iv.max ); os[i++] = new PropertyIsBetween( property, new Literal<PrimitiveValue>( min ), new Literal<PrimitiveValue>( max ), true, null ); } else if ( o.toString().equalsIgnoreCase( "current" ) ) {
private static void export( PropertyIsBetween operator, XMLStreamWriter writer ) throws XMLStreamException, UnknownCRSException, TransformationException { writer.writeStartElement( FES_20_NS, "PropertyIsBetween" ); export( operator.getExpression(), writer ); writer.writeStartElement( FES_20_NS, "LowerBoundary" ); export( operator.getLowerBoundary(), writer ); writer.writeEndElement(); writer.writeStartElement( FES_20_NS, "UpperBoundary" ); export( operator.getUpperBoundary(), writer ); writer.writeEndElement(); writer.writeEndElement(); }
for ( TypedObjectNode upperValue : upperBoundaryValues ) { if ( upperValue != null ) { Pair<PrimitiveValue, PrimitiveValue> propUpper = getPrimitiveValues( propertyValue, upperValue ); if ( ( propUpper.first ).compareTo( propUpper.second ) <= 0 ) { Pair<PrimitiveValue, PrimitiveValue> propLower = getPrimitiveValues( propertyValue, lowerValue ); if ( ( propLower.first ).compareTo( propLower.second ) >= 0 ) {
case PROPERTY_IS_BETWEEN: PropertyIsBetween piw = (PropertyIsBetween) op; return new PropertyIsBetween( copyExpression( piw.getExpression(), values ), copyExpression( piw.getLowerBoundary(), values ), copyExpression( piw.getUpperBoundary(), values ), piw.isMatchCase(), piw.getMatchAction() ); case PROPERTY_IS_EQUAL_TO: PropertyIsEqualTo pie = (PropertyIsEqualTo) op;
case PROPERTY_IS_BETWEEN: PropertyIsBetween isBetween = (PropertyIsBetween) operator; export( isBetween.getExpression(), writer ); writer.writeStartElement( CommonNamespaces.OGCNS, "LowerBoundary" ); export( isBetween.getLowerBoundary(), writer ); writer.writeEndElement(); writer.writeStartElement( CommonNamespaces.OGCNS, "UpperBoundary" ); export( isBetween.getUpperBoundary(), writer ); writer.writeEndElement(); break;
max = ( (Number) iv.max ).toString(); os[i++] = new PropertyIsBetween( property, new Literal<PrimitiveValue>( min ), new Literal<PrimitiveValue>( max ), true, null ); } else {
PropertyIsBetween propIsBetween = (PropertyIsBetween) op; SQLOperationBuilder builder = new SQLOperationBuilder( BOOLEAN ); SQLExpression lower = toProtoSQL( propIsBetween.getLowerBoundary(), true ); SQLExpression expr = toProtoSQL( propIsBetween.getExpression(), true ); SQLExpression upper = toProtoSQL( propIsBetween.getUpperBoundary(), true ); inferType( lower, expr, upper ); builder.add( "(" );
private static PropertyIsBetween parsePropertyIsBetweenOperator( XMLStreamReader xmlStream ) throws XMLStreamException { // this is a deegree extension over Filter 1.0.0 spec. boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true ); nextElement( xmlStream ); Expression expression = parseExpression( xmlStream ); nextElement( xmlStream ); xmlStream.require( START_ELEMENT, OGC_NS, "LowerBoundary" ); nextElement( xmlStream ); Expression lowerBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); // </ expression > nextElement( xmlStream ); // </LowerBoundary> xmlStream.require( START_ELEMENT, OGC_NS, "UpperBoundary" ); nextElement( xmlStream ); Expression upperBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); // </ expression > nextElement( xmlStream ); // </UowerBoundary> return new PropertyIsBetween( expression, lowerBoundary, upperBoundary, matchCase, null ); }
private static PropertyIsBetween parsePropertyIsBetweenOperator( XMLStreamReader xmlStream ) throws XMLStreamException { // this is a deegree extension over Filter 1.1.0 spec. boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true ); nextElement( xmlStream ); Expression expression = parseExpression( xmlStream ); nextElement( xmlStream ); xmlStream.require( START_ELEMENT, OGC_NS, "LowerBoundary" ); nextElement( xmlStream ); Expression lowerBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); nextElement( xmlStream ); xmlStream.require( START_ELEMENT, OGC_NS, "UpperBoundary" ); nextElement( xmlStream ); Expression upperBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); nextElement( xmlStream ); return new PropertyIsBetween( expression, lowerBoundary, upperBoundary, matchCase, null ); }
private static PropertyIsBetween parsePropertyIsBetweenOperator( XMLStreamReader xmlStream ) throws XMLStreamException { // this is a deegree extension over Filter 2.0.0 spec. (TODO should this be null, if not present?) Boolean matchCase = getAttributeValueAsBoolean( xmlStream, null, "matchCase", true ); // this is a deegree extension over Filter 2.0.0 spec. (TODO should this be null, if not present?) MatchAction matchAction = null; String s = XMLStreamUtils.getAttributeValue( xmlStream, "matchAction" ); if ( s != null ) { matchAction = parseMatchAction( xmlStream, s ); } nextElement( xmlStream ); Expression expression = parseExpression( xmlStream ); nextElement( xmlStream ); xmlStream.require( START_ELEMENT, FES_NS, "LowerBoundary" ); nextElement( xmlStream ); Expression lowerBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); nextElement( xmlStream ); xmlStream.require( START_ELEMENT, FES_NS, "UpperBoundary" ); nextElement( xmlStream ); Expression upperBoundary = parseExpression( xmlStream ); nextElement( xmlStream ); nextElement( xmlStream ); return new PropertyIsBetween( expression, lowerBoundary, upperBoundary, matchCase, matchAction ); }
case PROPERTY_IS_BETWEEN: return new PropertyIsBetween( exs[1], exs[0], exs[2], o.isMatchCase(), o.getMatchAction() ); case PROPERTY_IS_EQUAL_TO: return new PropertyIsEqualTo( exs[0], exs[1], o.isMatchCase(), o.getMatchAction() );