Skip to content

Commit

Permalink
deegree#125 fixed java formatting using spring-javaformat-maven plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tfr42 committed Dec 22, 2024
1 parent e0106dc commit 9dbbad5
Show file tree
Hide file tree
Showing 154 changed files with 8,093 additions and 8,325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
Expand All @@ -31,21 +31,22 @@
*/
public class HtmlViewConfigBuilder implements ResourceBuilder<HtmlViewConfigResource> {

private ResourceMetadata<HtmlViewConfigResource> metadata;
private ResourceMetadata<HtmlViewConfigResource> metadata;

private Workspace workspace;
private Workspace workspace;

private HtmlView config;
private HtmlView config;

public HtmlViewConfigBuilder( ResourceMetadata<HtmlViewConfigResource> metadata, Workspace workspace,
HtmlView config ) {
this.metadata = metadata;
this.workspace = workspace;
this.config = config;
}
public HtmlViewConfigBuilder(ResourceMetadata<HtmlViewConfigResource> metadata, Workspace workspace,
HtmlView config) {
this.metadata = metadata;
this.workspace = workspace;
this.config = config;
}

@Override
public HtmlViewConfigResource build() {
return new HtmlViewConfigResource(metadata, workspace, config);
}

@Override
public HtmlViewConfigResource build() {
return new HtmlViewConfigResource( metadata, workspace, config );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
Expand All @@ -29,9 +29,8 @@
*/
public class HtmlViewConfigManager extends DefaultResourceManager<HtmlViewConfigResource> {

public HtmlViewConfigManager() {
super( new DefaultResourceManagerMetadata<>( OgcApiConfigProvider.class,
"OGC API HTML config", "html" ) );
}
public HtmlViewConfigManager() {
super(new DefaultResourceManagerMetadata<>(OgcApiConfigProvider.class, "OGC API HTML config", "html"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
Expand All @@ -35,21 +35,23 @@
*/
public class HtmlViewConfigMetadata extends AbstractResourceMetadata<HtmlViewConfigResource> {

private static final String CONFIG_JAXB_PACKAGE = "org.deegree.services.jaxb.ogcapi.htmlview";
private static final String CONFIG_JAXB_PACKAGE = "org.deegree.services.jaxb.ogcapi.htmlview";

public HtmlViewConfigMetadata( Workspace workspace, ResourceLocation<HtmlViewConfigResource> location,
AbstractResourceProvider<HtmlViewConfigResource> provider ) {
super( workspace, location, provider );
}
public HtmlViewConfigMetadata(Workspace workspace, ResourceLocation<HtmlViewConfigResource> location,
AbstractResourceProvider<HtmlViewConfigResource> provider) {
super(workspace, location, provider);
}

@Override
public ResourceBuilder<HtmlViewConfigResource> prepare() {
try {
HtmlView cfg = (HtmlView) JAXBUtils.unmarshall(CONFIG_JAXB_PACKAGE, provider.getSchema(),
location.getAsStream(), workspace);
return new HtmlViewConfigBuilder(this, workspace, cfg);
}
catch (Exception e) {
throw new ResourceInitException(e.getLocalizedMessage(), e);
}
}

@Override
public ResourceBuilder<HtmlViewConfigResource> prepare() {
try {
HtmlView cfg = (HtmlView) JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(),
location.getAsStream(), workspace );
return new HtmlViewConfigBuilder( this, workspace, cfg );
} catch ( Exception e ) {
throw new ResourceInitException( e.getLocalizedMessage(), e );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
Expand All @@ -32,20 +32,20 @@
*/
public class HtmlViewConfigProvider extends OgcApiConfigProvider {

@Override
public String getNamespace() {
return "http://www.deegree.org/ogcapi/htmlview";
}
@Override
public String getNamespace() {
return "http://www.deegree.org/ogcapi/htmlview";
}

@Override
public ResourceMetadata<HtmlViewConfigResource> createFromLocation( Workspace workspace,
ResourceLocation<HtmlViewConfigResource> location ) {
return new HtmlViewConfigMetadata( workspace, location, this );
}
@Override
public ResourceMetadata<HtmlViewConfigResource> createFromLocation(Workspace workspace,
ResourceLocation<HtmlViewConfigResource> location) {
return new HtmlViewConfigMetadata(workspace, location, this);
}

@Override
public URL getSchema() {
return HtmlViewConfigProvider.class.getResource( "/META-INF/schemas/ogcapi/htmlview.xsd" );
}
@Override
public URL getSchema() {
return HtmlViewConfigProvider.class.getResource("/META-INF/schemas/ogcapi/htmlview.xsd");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
Expand All @@ -38,75 +38,74 @@
*/
public class HtmlViewConfigResource implements Resource {

private static final Logger LOG = getLogger( HtmlViewConfigResource.class );

private final ResourceMetadata<HtmlViewConfigResource> metadata;

private final Workspace workspace;

private final HtmlView config;

private HtmlViewConfiguration htmlViewConfiguration;

public HtmlViewConfigResource( ResourceMetadata<HtmlViewConfigResource> metadata, Workspace workspace,
HtmlView config ) {
this.metadata = metadata;
this.workspace = workspace;
this.config = config;
}

@Override
public ResourceMetadata<? extends Resource> getMetadata() {
return metadata;
}

@Override
public void init() {
htmlViewConfiguration = parseHtmlViewConfiguration();
LOG.debug("Using HTML view configuration: " + htmlViewConfiguration);
}

@Override
public void destroy() {

}

public HtmlViewConfiguration getHtmlViewConfiguration() {
return htmlViewConfiguration;
}

private HtmlViewConfiguration parseHtmlViewConfiguration() {
if ( config == null )
return null;
File cssFile = null;
String configuredCssFile = config.getCssFile();
if ( configuredCssFile != null ) {
cssFile = this.metadata.getLocation().resolveToFile( configuredCssFile );
if ( !cssFile.exists() || !cssFile.isFile() ) {
LOG.warn( "Configured cssFile does not exist or is not a valid file" );
}
}
String wmsUrl = null;
String wmsVersion = null;
String wmsLayers = null;
String crsCode = null;
String crsProj4Definition = null;
String source = null;

HtmlView.Map map = config.getMap();
if ( map != null ) {
wmsUrl = map.getWMSUrl().getValue();
wmsVersion= map.getWMSUrl().getVersion();
wmsLayers = map.getWMSLayers();
if ( map.getCrsProj4Definition() != null ) {
crsCode = map.getCrsProj4Definition().getCode();
crsProj4Definition = map.getCrsProj4Definition().getValue();
}
source = map.getSource();
}
return new HtmlViewConfiguration( cssFile, config.getLegalNoticeUrl(), config.getPrivacyPolicyUrl(),
config.getDocumentationUrl(), wmsUrl, wmsVersion,
wmsLayers, crsCode, crsProj4Definition, source );
}
private static final Logger LOG = getLogger(HtmlViewConfigResource.class);

private final ResourceMetadata<HtmlViewConfigResource> metadata;

private final Workspace workspace;

private final HtmlView config;

private HtmlViewConfiguration htmlViewConfiguration;

public HtmlViewConfigResource(ResourceMetadata<HtmlViewConfigResource> metadata, Workspace workspace,
HtmlView config) {
this.metadata = metadata;
this.workspace = workspace;
this.config = config;
}

@Override
public ResourceMetadata<? extends Resource> getMetadata() {
return metadata;
}

@Override
public void init() {
htmlViewConfiguration = parseHtmlViewConfiguration();
LOG.debug("Using HTML view configuration: " + htmlViewConfiguration);
}

@Override
public void destroy() {

}

public HtmlViewConfiguration getHtmlViewConfiguration() {
return htmlViewConfiguration;
}

private HtmlViewConfiguration parseHtmlViewConfiguration() {
if (config == null)
return null;
File cssFile = null;
String configuredCssFile = config.getCssFile();
if (configuredCssFile != null) {
cssFile = this.metadata.getLocation().resolveToFile(configuredCssFile);
if (!cssFile.exists() || !cssFile.isFile()) {
LOG.warn("Configured cssFile does not exist or is not a valid file");
}
}
String wmsUrl = null;
String wmsVersion = null;
String wmsLayers = null;
String crsCode = null;
String crsProj4Definition = null;
String source = null;

HtmlView.Map map = config.getMap();
if (map != null) {
wmsUrl = map.getWMSUrl().getValue();
wmsVersion = map.getWMSUrl().getVersion();
wmsLayers = map.getWMSLayers();
if (map.getCrsProj4Definition() != null) {
crsCode = map.getCrsProj4Definition().getCode();
crsProj4Definition = map.getCrsProj4Definition().getValue();
}
source = map.getSource();
}
return new HtmlViewConfiguration(cssFile, config.getLegalNoticeUrl(), config.getPrivacyPolicyUrl(),
config.getDocumentationUrl(), wmsUrl, wmsVersion, wmsLayers, crsCode, crsProj4Definition, source);
}

}
Loading

0 comments on commit 9dbbad5

Please sign in to comment.