本文整理汇总了Java中org.opengis.filter.expression.PropertyName.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyName.evaluate方法的具体用法?Java PropertyName.evaluate怎么用?Java PropertyName.evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opengis.filter.expression.PropertyName
的用法示例。
在下文中一共展示了PropertyName.evaluate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateSortBy
import org.opengis.filter.expression.PropertyName; //导入方法依赖的package包/类
void validateSortBy(List<SortBy> sortBys, FeatureTypeInfo meta, final GetFeatureRequest3D request)
throws IOException {
FeatureType featureType = meta.getFeatureType();
for (SortBy sortBy : sortBys) {
PropertyName name = sortBy.getPropertyName();
if (name.evaluate(featureType) == null) {
throw new WFSException(request, "Illegal property name: " + name.getPropertyName()
+ " for feature type " + meta.prefixedName(), "InvalidParameterValue");
}
}
}
示例2: visit
import org.opengis.filter.expression.PropertyName; //导入方法依赖的package包/类
/**
* Writes the FilterBuilder for the attribute Expression.
*
* @param expression the attribute.
*
*/
@Override
public Object visit(PropertyName expression, Object extraData) {
LOGGER.finest("exporting PropertyName");
SimpleFeatureType featureType = this.featureType;
Class target = null;
if(extraData instanceof Class) {
target = (Class) extraData;
}
//first evaluate expression against feature type get the attribute,
AttributeDescriptor attType = (AttributeDescriptor) expression.evaluate(featureType);
String encodedField;
if ( attType != null ) {
encodedField = attType.getLocalName();
if(target != null && target.isAssignableFrom(attType.getType().getBinding())) {
// no need for casting, it's already the right type
target = null;
}
} else {
// fall back to just encoding the property name
encodedField = expression.getPropertyName();
}
if (target != null) {
LOGGER.fine("PropertyName type casting not implemented");
}
field = encodedField;
return extraData;
}