当前位置: 首页>>代码示例>>Java>>正文


Java PropertyIsBetween.getExpression方法代码示例

本文整理汇总了Java中org.opengis.filter.PropertyIsBetween.getExpression方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyIsBetween.getExpression方法的具体用法?Java PropertyIsBetween.getExpression怎么用?Java PropertyIsBetween.getExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opengis.filter.PropertyIsBetween的用法示例。


在下文中一共展示了PropertyIsBetween.getExpression方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.opengis.filter.PropertyIsBetween; //导入方法依赖的package包/类
/**
 * Writes the FilterBuilder for the PropertyIsBetween Filter.
 *
 * @param filter the Filter to be visited.
 *
 */
public Object visit(PropertyIsBetween filter, Object extraData) {
    LOGGER.finest("exporting PropertyIsBetween");

    Expression expr = (Expression) filter.getExpression();
    Expression lowerbounds = (Expression) filter.getLowerBoundary();
    Expression upperbounds = (Expression) filter.getUpperBoundary();

    Class context;
    nested = false;
    AttributeDescriptor attType = (AttributeDescriptor)expr.evaluate(featureType);
    if (attType != null) {
        context = attType.getType().getBinding();
        if (attType.getUserData().containsKey(NESTED)) {
            nested = (Boolean) attType.getUserData().get(NESTED);
        }
        if (Date.class.isAssignableFrom(context)) {
            updateDateFormatter(attType);
        }
    } else {
        //assume it's a string?
        context = String.class;
    }

    expr.accept(this, extraData);
    key = (String) field;
    lowerbounds.accept(this, context);
    lower = field;
    upperbounds.accept(this, context);
    upper = field;

    if(nested) {
        path = extractNestedPath(key);
    }

    queryBuilder = ImmutableMap.of("range", ImmutableMap.of(key, ImmutableMap.of("gte", lower, "lte", upper)));
    if(nested) {
        queryBuilder = ImmutableMap.of("nested", ImmutableMap.of("path", path, "query", queryBuilder));
    }

    return extraData;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:48,代码来源:FilterToElastic.java


注:本文中的org.opengis.filter.PropertyIsBetween.getExpression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。