本文整理汇总了Java中org.opengis.filter.PropertyIsLike类的典型用法代码示例。如果您正苦于以下问题:Java PropertyIsLike类的具体用法?Java PropertyIsLike怎么用?Java PropertyIsLike使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyIsLike类属于org.opengis.filter包,在下文中一共展示了PropertyIsLike类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFilterCapabilities
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
/**
* Sets the capabilities of this filter.
*
* @return FilterCapabilities for this Filter
*/
protected FilterCapabilities createFilterCapabilities() {
FilterCapabilities capabilities = new FilterCapabilities();
capabilities.addAll(FilterCapabilities.LOGICAL_OPENGIS);
capabilities.addAll(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS);
capabilities.addType(PropertyIsNull.class);
capabilities.addType(PropertyIsBetween.class);
capabilities.addType(Id.class);
capabilities.addType(IncludeFilter.class);
capabilities.addType(ExcludeFilter.class);
capabilities.addType(PropertyIsLike.class);
// spatial filters
capabilities.addType(BBOX.class);
capabilities.addType(Contains.class);
//capabilities.addType(Crosses.class);
capabilities.addType(Disjoint.class);
//capabilities.addType(Equals.class);
capabilities.addType(Intersects.class);
//capabilities.addType(Overlaps.class);
//capabilities.addType(Touches.class);
capabilities.addType(Within.class);
capabilities.addType(DWithin.class);
capabilities.addType(Beyond.class);
//temporal filters
capabilities.addType(After.class);
capabilities.addType(Before.class);
capabilities.addType(Begins.class);
capabilities.addType(BegunBy.class);
capabilities.addType(During.class);
capabilities.addType(Ends.class);
capabilities.addType(EndedBy.class);
capabilities.addType(TContains.class);
capabilities.addType(TEquals.class);
return capabilities;
}
示例2: testPropertyIsLike
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Test
public void testPropertyIsLike() {
PropertyIsLike filter = ff.like(ff.property("analyzed"), "hello");
Map<String,Object> expected = ImmutableMap.of("query_string", ImmutableMap.of("query", "hello", "default_field", "analyzed"));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例3: testCaseSensitivePropertyIsLike
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Test
public void testCaseSensitivePropertyIsLike() {
PropertyIsLike filter = ff.like(ff.property("analyzed"), "hello", "\\", "*", ".", true);
Map<String,Object> expected = ImmutableMap.of("query_string", ImmutableMap.of("query", "hello", "default_field", "analyzed"));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例4: testNestedPropertyIsLike
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Test
public void testNestedPropertyIsLike() {
PropertyIsLike filter = ff.like(ff.property("nested.hej"), "hello");
Map<String,Object> expectedFilter = ImmutableMap.of("query_string", ImmutableMap.of("query", "hello", "default_field", "nested.hej"));
Map<String,Object> expected = ImmutableMap.of("nested", ImmutableMap.of("path", "nested", "query", expectedFilter));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected,builder.getQueryBuilder());
}
示例5: testGetFeaturesWithIsLikeFilter
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Test
public void testGetFeaturesWithIsLikeFilter() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsLike f = ff.like(ff.property("standard_ss"), "IEEE 802.11?");
SimpleFeatureCollection features = featureSource.getFeatures(f);
assertEquals(11, features.size());
}
示例6: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLike filter,
final Object data ) {
return new ExtractGeometryFilterVisitorResult(
infinity(),
null);
}
示例7: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLike filter,
final Object extraData ) {
if (!usesProperty(filter)) {
return Filter.INCLUDE;
}
return super.visit(
filter,
extraData);
}
示例8: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(PropertyIsLike filter, Object userData) {
String propertyName = getPropertyName(filter.getExpression());
String finalName = parsePropertyName(propertyName, userData);
String value = filter.getLiteral();
value = value.replaceAll("\\*", "%");
value = value.replaceAll("\\?", "_");
if (filter.isMatchingCase()) {
return Restrictions.like(finalName, value);
} else {
return Restrictions.ilike(finalName, value);
}
}
示例9: like
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
public PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar,
String escape) {
ExtendedLikeFilterImpl filter = new ExtendedLikeFilterImpl();
filter.setExpression(expr);
filter.setPattern(pattern, wildcard, singleChar, escape);
return filter;
}
示例10: addFilter
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
/**
* Adds the filter.
*
* @param node the node
* @return the filter
*/
private Filter addFilter(FilterNode node) {
Filter filter = node.getFilter();
FilterConfigInterface filterConfig = node.getFilterConfig();
if (filter instanceof LogicFilterImpl) {
List<Filter> filterList = new ArrayList<Filter>();
createFilterList(node, filterList);
return filterConfig.createLogicFilter(filterList);
}
List<Expression> parameterFilter = new ArrayList<Expression>();
if (filter instanceof FidFilterImpl) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof BinaryTemporalOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof PropertyIsBetween) {
createExpressionParameterList(node, 3, parameterFilter);
} else if (filter instanceof PropertyIsNull) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsLike) {
createExpressionParameterList(node, 6, parameterFilter);
} else if (filter instanceof BinarySpatialOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof BinaryComparisonAbstract) {
if (filter instanceof Not) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsGreaterThan) {
createExpressionParameterList(node, 2, parameterFilter);
} else {
createExpressionParameterList(node, 3, parameterFilter);
}
} else {
return filter;
}
return filterConfig.createFilter(parameterFilter);
}
示例11: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
/**
* Writes the FilterBuilder for the Like Filter.
*
* @param filter the filter to be visited
*
*/
public Object visit(PropertyIsLike filter, Object extraData) {
char esc = filter.getEscape().charAt(0);
char multi = filter.getWildCard().charAt(0);
char single = filter.getSingleChar().charAt(0);
boolean matchCase = false;
if (filter.isMatchingCase()) {
LOGGER.fine("Case sensitive search not supported");
}
String literal = filter.getLiteral();
Expression att = filter.getExpression();
AttributeDescriptor attType = (AttributeDescriptor) att.evaluate(featureType);
analyzed = false;
nested = false;
if (attType != null) {
if (attType.getUserData().containsKey(ANALYZED)) {
analyzed = (Boolean) attType.getUserData().get(ANALYZED);
}
if (attType.getUserData().containsKey(NESTED)) {
nested = (Boolean) attType.getUserData().get(NESTED);
}
if (Date.class.isAssignableFrom(attType.getType().getBinding())) {
updateDateFormatter(attType);
}
}
att.accept(this, extraData);
key = (String) field;
if (analyzed) {
// use query string query post filter for analyzed fields
pattern = convertToQueryString(esc, multi, single, matchCase, literal);
} else {
// default to regexp filter
pattern = convertToRegex(esc, multi, single, matchCase, literal);
}
if (nested) {
path = extractNestedPath(key);
}
if (analyzed) {
// use query string query for analyzed fields
queryBuilder = ImmutableMap.of("query_string", ImmutableMap.of("query", pattern, "default_field", key));
} else {
// default to regexp query
queryBuilder = ImmutableMap.of("regexp", ImmutableMap.of(key, pattern));
}
if (nested) {
queryBuilder = ImmutableMap.of("nested", ImmutableMap.of("path", path, "query", queryBuilder));
}
return extraData;
}
示例12: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Override
public Object visit(PropertyIsLike pil, Object o) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例13: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLike filter,
final Object data ) {
return new TemporalConstraints();
}
示例14: visit
import org.opengis.filter.PropertyIsLike; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLike filter,
final Object data ) {
return new PropertyConstraintSet();
}