/** * List of layer FeatureType in order requested. * * @return layer FeatureType in order requested * @deprecated Use {@link #getLegends()} */ public List<FeatureType> getLayers() { List<FeatureType> types = new ArrayList<FeatureType>(legends.size()); for (LegendRequest layer : legends) { types.add(layer.getFeatureType()); } return Collections.unmodifiableList(types); }
FeatureType layer = legend.getFeatureType();
FeatureType layer = legend.getFeatureType();
private String getLayerName(LegendRequest legend) { if (legend.getLayer() != null) { return legend.getLayer(); } else if (legend.getLayerInfo() != null) { return legend.getLayerInfo().prefixedName(); } else if (legend.getFeatureType() != null) { Name name = legend.getFeatureType().getName(); NamespaceInfo ns = request.getWms().getCatalog().getNamespaceByURI(name.getNamespaceURI()); final String localName = name.getLocalPart(); if (ns != null) { return ns.getPrefix() + ":" + localName; } else { return localName; } } else { // should not really happen today, but who knows, may do in the future throw new ServiceException("Could not get the layer name out of " + legend); } }