Package org.geotools.filter

Examples of org.geotools.filter.LiteralExpressionImpl


  public Object visit(Equals filter, Object userData) {
    throw new UnsupportedOperationException("visit(Equals filter, Object userData)");
  }

  public Object visit(Intersects filter, Object userData) {
    LiteralExpressionImpl exp = (LiteralExpressionImpl) filter.getExpression2();
    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.intersects(finalName, asGeometry(exp.getValue()));
  }
View Full Code Here


    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.intersects(finalName, asGeometry(exp.getValue()));
  }

  public Object visit(Overlaps filter, Object userData) {
    LiteralExpressionImpl exp = (LiteralExpressionImpl) filter.getExpression2();
    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.overlaps(finalName, asGeometry(exp.getValue()));
  }
View Full Code Here

    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.overlaps(finalName, asGeometry(exp.getValue()));
  }

  public Object visit(Touches filter, Object userData) {
    LiteralExpressionImpl exp = (LiteralExpressionImpl) filter.getExpression2();
    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.touches(finalName, asGeometry(exp.getValue()));
  }
View Full Code Here

    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.touches(finalName, asGeometry(exp.getValue()));
  }

  public Object visit(Within filter, Object userData) {
    LiteralExpressionImpl exp = (LiteralExpressionImpl) filter.getExpression2();
    String finalName = parsePropertyName(geomName, userData);
    return SpatialRestrictions.within(finalName, asGeometry(exp.getValue()));
  }
View Full Code Here

            PropertyName pName = (PropertyName) expression;
            return pName.getPropertyName();
        }

        if (expression instanceof LiteralExpressionImpl) {
            LiteralExpressionImpl pName = (LiteralExpressionImpl) expression;
            return pName.getValue().toString();
        }

        Integer evaluateInt = expression.evaluate(null, Integer.class);
        if (evaluateInt != null) {
            return evaluateInt.toString();
View Full Code Here

  }

  private static void decodeExpression(Expression exp)
      throws UnsupportedEncodingException {
    if (exp instanceof LiteralExpressionImpl) {
      LiteralExpressionImpl impl = (LiteralExpressionImpl) exp;
      String encode = String.valueOf(impl.getValue());
      impl.setValue(decodeString(encode));
    }
  }
View Full Code Here

            setExpression2(e2);
    }

    public BBOXImpl(Expression name, double minx, double miny, double maxx, double maxy, String srs) {
        this(name,
             new LiteralExpressionImpl(boundingPolygon(new Envelope(minx, maxx, miny, maxy)))
             );
        this.srs = srs;
    }
View Full Code Here

    }

    public BBOXImpl(Expression name, double minx, double miny, double maxx, double maxy,
            String srs, MatchAction matchAction) {
        this(name,
             new LiteralExpressionImpl( boundingPolygon(buildEnvelope(minx, maxx, miny, maxy, srs))),
             matchAction);
        this.srs = srs;
    }
View Full Code Here

    }

    private void updateExpression2() {
        // this is temporary until set...XY are removed
        Literal expression =
                new LiteralExpressionImpl( boundingPolygon(buildEnvelope(minx, maxx, miny, maxy, srs)));
        super.setExpression2(expression);
    }
View Full Code Here

  public String getExpressionValue(Expression expression, Feature feature) {
    if ((expression == null) || (feature == null)) {
      return null;
    }
    if (expression.getClass().isAssignableFrom(LiteralExpressionImpl.class)) {
      LiteralExpressionImpl v = (LiteralExpressionImpl) expression;
      byte[] utf8Bytes = null;
      String result = "";
      try {
        utf8Bytes = v.toString().getBytes("UTF8");
        result = new String(utf8Bytes, "UTF8");
      } catch (UnsupportedEncodingException e) {
        return "";
      }
      return result;

    }
    if (expression.getClass().isAssignableFrom(
        AttributeExpressionImpl.class)) {
      AttributeExpressionImpl v = (AttributeExpressionImpl) expression;
      String property = v.getPropertyName();
      Object o = feature.getProperty(property).getValue();
      if (o != null) {
        return o.toString();
      }
    }
View Full Code Here

TOP

Related Classes of org.geotools.filter.LiteralExpressionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.