本文整理汇总了Java中org.geomajas.global.ExceptionCode.ATTRIBUTE_UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java ExceptionCode.ATTRIBUTE_UNKNOWN属性的具体用法?Java ExceptionCode.ATTRIBUTE_UNKNOWN怎么用?Java ExceptionCode.ATTRIBUTE_UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.geomajas.global.ExceptionCode
的用法示例。
在下文中一共展示了ExceptionCode.ATTRIBUTE_UNKNOWN属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dtoCriterionToFilters
/**
*
* @param criterion
* @param mapCrs
* the geometry in geometrycriterion's are expected to be in mapCrs, the will be converted to their
* respective layerCrs's for the filters.
* @return
* @throws GeomajasException
*/
public Map<VectorLayer, Filter> dtoCriterionToFilters(Criterion criterion, Crs mapCrs)
throws GeomajasException {
if (criterion != null) {
if (criterion instanceof AttributeCriterion) {
return dtoAttributeCriterionToFilters((AttributeCriterion) criterion);
} else if (criterion instanceof GeometryCriterion) {
return dtoGeometryCriterionToFilters((GeometryCriterion) criterion, mapCrs);
} else if (criterion instanceof AndCriterion) {
AndCriterion critter = (AndCriterion) criterion;
prune(critter);
return dtoAndCriterionToFilters(critter, mapCrs);
} else if (criterion instanceof OrCriterion) {
return dtoOrCriterionToFilters((OrCriterion) criterion, mapCrs);
} else {
throw new GeomajasException(ExceptionCode.ATTRIBUTE_UNKNOWN, criterion.getClass().getName());
}
} else {
return new LinkedHashMap<VectorLayer, Filter>();
}
}
示例2: getAttributes
@Override
public List<Attribute<?>> getAttributes(String attributeName, Filter filter) throws LayerException {
if (attributeName == null) {
throw new HibernateLayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, (Object) null);
}
AssociationAttributeInfo attributeInfo = getRecursiveAttributeInfo(attributeName, getFeatureInfo()
.getAttributes());
Session session = getSessionFactory().getCurrentSession();
Criteria criteria = session.createCriteria(attributeInfo.getFeature().getDataSourceName());
CriteriaVisitor visitor = new CriteriaVisitor((HibernateFeatureModel) getFeatureModel(), dateFormat);
if (filter != null) {
Criterion c = (Criterion) filter.accept(visitor, null);
if (c != null) {
criteria.add(c);
}
}
List<Attribute<?>> attributes = new ArrayList<Attribute<?>>();
for (Object object : criteria.list()) {
try {
attributes.add(converterService.toDto(object, attributeInfo));
} catch (GeomajasException e) {
throw new HibernateLayerException(e, ExceptionCode.HIBERNATE_ATTRIBUTE_TYPE_PROBLEM, attributeName);
}
}
return attributes;
}
示例3: convertAttribute
private Attribute convertAttribute(Object object, String name) throws LayerException {
AbstractAttributeInfo attributeInfo = getAttributeInfoMap().get(name);
if (null == attributeInfo) {
throw new LayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, name, getAttributeInfoMap().keySet());
}
try {
return converterService.toDto(object, attributeInfo);
} catch (GeomajasException e) {
throw new LayerException(e);
}
}
示例4: getAttribute
@Override
public Attribute getAttribute(Object feature, String name) throws LayerException {
AbstractAttributeInfo attributeInfo = getAttributeInfoMap().get(name);
if (null == attributeInfo) {
throw new LayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, name, getAttributeInfoMap().keySet());
}
try {
return converterService.toDto(asFeature(feature).getAttribute(name), attributeInfo);
} catch (GeomajasException e) {
throw new LayerException(e);
}
}
示例5: dtoGeometryCriterionToFilters
private Map<VectorLayer, Filter> dtoGeometryCriterionToFilters(GeometryCriterion criterion, Crs mapCrs)
throws GeomajasException {
if (mapCrs == null) {
throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "mapCrs");
}
Map<VectorLayer, Filter> filters = new LinkedHashMap<VectorLayer, Filter>();
Filter f;
Geometry mapGeom = converter.toInternal(criterion.getGeometry());
for (String serverLayerId : criterion.getServerLayerIds()) {
VectorLayer vl = configurationService.getVectorLayer(serverLayerId);
if (vl == null) {
throw new GeomajasException(ExceptionCode.LAYER_NOT_FOUND, serverLayerId);
}
// Transform geometry to layer CRS:
Geometry layerGeometry = geoService.transform(mapGeom, mapCrs, vectorLayerService.getCrs(vl));
switch (criterion.getOperator()) {
case SearchByLocationRequest.QUERY_INTERSECTS:
f = filterService.createIntersectsFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_CONTAINS:
f = filterService.createContainsFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_TOUCHES:
f = filterService.createTouchesFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_WITHIN:
f = filterService
.createWithinFilter(layerGeometry, vl.getFeatureModel().getGeometryAttributeName());
break;
default:
throw new GeomajasException(ExceptionCode.ATTRIBUTE_UNKNOWN, "QueryType");
}
filters.put(vl, f);
}
return filters;
}