/** Keys for overriding default layer properties */ public static class StyleProperty<T> { T get(Map<StyleProperty, Object> map, T def) { return map != null && map.containsKey(this) ? (T) map.get(this) : def; } public static StyleProperty<String> FORMAT = new StyleProperty<String>(); public static StyleProperty<Version> FORMAT_VERSION = new StyleProperty<Version>(); public static StyleProperty<LegendInfo> LEGEND_INFO = new StyleProperty<LegendInfo>(); }
@Override protected StyleInfo load() { StyleInfo style = GeoServerApplication.get().getCatalog().getStyle(id); // Make sure the legend object isn't null if (null == style.getLegend()) { style.setLegend(GeoServerApplication.get().getCatalog().getFactory().createLegend()); } return style; }
|| null == s.getLegend().getOnlineResource() || s.getLegend().getOnlineResource().isEmpty()) { s.setLegend(null);
|| null == style.getLegend().getOnlineResource() || style.getLegend().getOnlineResource().isEmpty()) { style.setLegend(null);