@Test public void testGetDefaultStyle_GeomNotInMap() { final Configuration configuration = new Configuration(); assertStyleType(Symbolizer.class, configuration.getDefaultStyle("geom")); assertStyleType(Symbolizer.class, configuration.getDefaultStyle("geometry")); assertStyleType(Symbolizer.class, configuration.getDefaultStyle("geometryCollection")); assertStyleType(Symbolizer.class, configuration.getDefaultStyle("MultiGeometry")); assertStyleType(Symbolizer.class, configuration.getDefaultStyle(Constants.Style.Grid.NAME_LINES)); assertStyleType(Symbolizer.class, configuration.getDefaultStyle(Constants.Style.Raster.NAME)); }
@Nonnull public final Style getDefaultStyle(@Nonnull final String geometryType) { String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase()); if (normalizedGeomName == null) { normalizedGeomName = geometryType.toLowerCase(); } Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase()); if (style == null) { style = this.namedStyles.get(normalizedGeomName.toLowerCase()); } if (style == null) { StyleBuilder builder = new StyleBuilder(); final Symbolizer symbolizer; if (isPointType(normalizedGeomName)) { symbolizer = builder.createPointSymbolizer(); } else if (isLineType(normalizedGeomName)) { symbolizer = builder.createLineSymbolizer(Color.black, 2); } else if (isPolygonType(normalizedGeomName)) { symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2); } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) { symbolizer = builder.createRasterSymbolizer(); } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) { symbolizer = createMapOverviewStyle(normalizedGeomName, builder); } else { final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase()); if (geomStyle != null) { return geomStyle; } else { symbolizer = builder.createPointSymbolizer(); } } style = builder.createStyle(symbolizer); } return style; }
Configuration implements ConfigurationObject { @Nonnull public final Style getDefaultStyle(@Nonnull final String geometryType) { String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase()); if (normalizedGeomName == null) { normalizedGeomName = geometryType.toLowerCase(); } Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase()); if (style == null) { style = this.namedStyles.get(normalizedGeomName.toLowerCase()); } if (style == null) { StyleBuilder builder = new StyleBuilder(); final Symbolizer symbolizer; if (isPointType(normalizedGeomName)) { symbolizer = builder.createPointSymbolizer(); } else if (isLineType(normalizedGeomName)) { symbolizer = builder.createLineSymbolizer(Color.black, 2); } else if (isPolygonType(normalizedGeomName)) { symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2); } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) { symbolizer = builder.createRasterSymbolizer(); } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) { symbolizer = createMapOverviewStyle(normalizedGeomName, builder); } else { final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase()); if (geomStyle != null) { return geomStyle; } else { symbolizer = builder.createPointSymbolizer(); } } style = builder.createStyle(symbolizer); } return style; } }
Configuration implements ConfigurationObject { @Nonnull public final Style getDefaultStyle(@Nonnull final String geometryType) { String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase()); if (normalizedGeomName == null) { normalizedGeomName = geometryType.toLowerCase(); } Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase()); if (style == null) { style = this.namedStyles.get(normalizedGeomName.toLowerCase()); } if (style == null) { StyleBuilder builder = new StyleBuilder(); final Symbolizer symbolizer; if (isPointType(normalizedGeomName)) { symbolizer = builder.createPointSymbolizer(); } else if (isLineType(normalizedGeomName)) { symbolizer = builder.createLineSymbolizer(Color.black, 2); } else if (isPolygonType(normalizedGeomName)) { symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2); } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) { symbolizer = builder.createRasterSymbolizer(); } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) { symbolizer = createMapOverviewStyle(normalizedGeomName, builder); } else { final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase()); if (geomStyle != null) { return geomStyle; } else { symbolizer = builder.createPointSymbolizer(); } } style = builder.createStyle(symbolizer); } return style; }  }
Configuration implements ConfigurationObject { @Nonnull public final Style getDefaultStyle(@Nonnull final String geometryType) { String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase()); if (normalizedGeomName == null) { normalizedGeomName = geometryType.toLowerCase(); } Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase()); if (style == null) { style = this.namedStyles.get(normalizedGeomName.toLowerCase()); } if (style == null) { StyleBuilder builder = new StyleBuilder(); final Symbolizer symbolizer; if (isPointType(normalizedGeomName)) { symbolizer = builder.createPointSymbolizer(); } else if (isLineType(normalizedGeomName)) { symbolizer = builder.createLineSymbolizer(Color.black, 2); } else if (isPolygonType(normalizedGeomName)) { symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2); } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) { symbolizer = builder.createRasterSymbolizer(); } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) { symbolizer = createMapOverviewStyle(normalizedGeomName, builder); } else { final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase()); if (geomStyle != null) { return geomStyle; } else { symbolizer = builder.createPointSymbolizer(); } } style = builder.createStyle(symbolizer); } return style; }  final void setPdfConfig(final PDFConfig pdfConfig); @PostConstruct final void init(); final boolean renderAsSvg(final Boolean renderAsSvg); final void setDefaultToSvg(final boolean defaultToSvg); @Nullable final CertificateStore getCertificateStore(); final void setCertificateStore(final CertificateStore certificateStore); final List<HttpCredential> getCredentials(); final void setCredentials(final List<HttpCredential> credentials); final List<HttpProxy> getProxies(); final void setProxies(final List<HttpProxy> proxies); final void printClientConfig(final JSONWriter json); final String getOutputFilename(); final void setOutputFilename(final String outputFilename); final Map<String, Template> getTemplates(); final void setTemplates(final Map<String, Template> templates); final Template getTemplate(final String name); final File getDirectory(); final void setConfigurationFile(final File configurationFile); final void setStyles(final Map<String, String> styles); final Optional<? extends Style> getStyle(final String styleName); @Nonnull final Style getDefaultStyle(@Nonnull final String geometryType); final void setDefaultStyle(final Map<String, Style> defaultStyle); final boolean isThrowErrorOnExtraParameters(); final void setThrowErrorOnExtraParameters(final boolean throwErrorOnExtraParameters); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); final List<Throwable> validate(); final boolean isAccessible(final String pathToSubResource); final byte[] loadFile(final String pathToSubResource); final void setFileLoaderManager(final ConfigFileLoaderManager fileLoaderManager); final void setJdbcDrivers(final Set<String> jdbcDrivers); final void setAccess(final List<String> access); final AccessAssertion getAccessAssertion(); final String getTransparentTileErrorColor(); final void setTransparentTileErrorColor(final String transparentTileErrorColor); final String getOpaqueTileErrorColor(); final void setOpaqueTileErrorColor(final String opaqueTileErrorColor); final String getResourceBundle(); final void setResourceBundle(final String resourceBundle); final UriMatchers getAllowedReferersImpl(); final void setAllowedReferers(@Nullable final List<? extends URIMatcher> matchers); SmtpConfig getSmtp(); void setSmtp(final SmtpConfig smtp); }
Configuration implements ConfigurationObject { @Nonnull public final Style getDefaultStyle(@Nonnull final String geometryType) { String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase()); if (normalizedGeomName == null) { normalizedGeomName = geometryType.toLowerCase(); } Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase()); if (style == null) { style = this.namedStyles.get(normalizedGeomName.toLowerCase()); } if (style == null) { StyleBuilder builder = new StyleBuilder(); final Symbolizer symbolizer; if (isPointType(normalizedGeomName)) { symbolizer = builder.createPointSymbolizer(); } else if (isLineType(normalizedGeomName)) { symbolizer = builder.createLineSymbolizer(Color.black, 2); } else if (isPolygonType(normalizedGeomName)) { symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2); } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) { symbolizer = builder.createRasterSymbolizer(); } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) { symbolizer = createMapOverviewStyle(normalizedGeomName, builder); } else { final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase()); if (geomStyle != null) { return geomStyle; } else { symbolizer = builder.createPointSymbolizer(); } } style = builder.createStyle(symbolizer); } return style; }  final void setPdfConfig(final PDFConfig pdfConfig); @PostConstruct final void init(); final boolean renderAsSvg(final Boolean renderAsSvg); final void setDefaultToSvg(final boolean defaultToSvg); @Nullable final CertificateStore getCertificateStore(); final void setCertificateStore(final CertificateStore certificateStore); final List<HttpCredential> getCredentials(); final void setCredentials(final List<HttpCredential> credentials); final List<HttpProxy> getProxies(); final void setProxies(final List<HttpProxy> proxies); final void printClientConfig(final JSONWriter json); final String getOutputFilename(); final void setOutputFilename(final String outputFilename); final Map<String, Template> getTemplates(); final void setTemplates(final Map<String, Template> templates); final Template getTemplate(final String name); final File getDirectory(); final void setConfigurationFile(final File configurationFile); final void setStyles(final Map<String, String> styles); final Optional<? extends Style> getStyle(final String styleName); @Nonnull final Style getDefaultStyle(@Nonnull final String geometryType); final void setDefaultStyle(final Map<String, Style> defaultStyle); final boolean isThrowErrorOnExtraParameters(); final void setThrowErrorOnExtraParameters(final boolean throwErrorOnExtraParameters); @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); final List<Throwable> validate(); final boolean isAccessible(final String pathToSubResource); final byte[] loadFile(final String pathToSubResource); final void setFileLoaderManager(final ConfigFileLoaderManager fileLoaderManager); final void setJdbcDrivers(final Set<String> jdbcDrivers); final void setAccess(final List<String> access); final AccessAssertion getAccessAssertion(); final String getTransparentTileErrorColor(); final void setTransparentTileErrorColor(final String transparentTileErrorColor); final String getOpaqueTileErrorColor(); final void setOpaqueTileErrorColor(final String opaqueTileErrorColor); final String getResourceBundle(); final void setResourceBundle(final String resourceBundle); final UriMatchers getAllowedReferersImpl(); final void setAllowedReferers(@Nullable final List<? extends URIMatcher> matchers); SmtpConfig getSmtp(); void setSmtp(final SmtpConfig smtp);  }