diff --git a/.gitignore b/.gitignore index f190e4bc19841cf1aa289fc09f5b260ea70f0b82..8b4f9f0291beadfb206d34c1571ce6884d367d7b 100644 --- a/.gitignore +++ b/.gitignore @@ -148,10 +148,10 @@ fabric.properties ### Intellij Patch ### # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr + *.iml + modules.xml + .idea/misc.xml + *.ipr # Sonarlint plugin .idea/sonarlint @@ -271,4 +271,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +**/.idea/ + # End of https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij diff --git a/citygml4j-quality-ade/.gitignore b/citygml4j-quality-ade/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a2ca7a03ecc6d82159ead0f4ebbe153a08237050 --- /dev/null +++ b/citygml4j-quality-ade/.gitignore @@ -0,0 +1,2 @@ +/.apt_generated_tests/ +*.iml diff --git a/citygml4j-quality-ade/pom.xml b/citygml4j-quality-ade/pom.xml index 4c65c090ee5cdc7c243476c2c97a1108c03674f7..64d79092065b2c0a02aa9e5270cfc85f8c581c80 100644 --- a/citygml4j-quality-ade/pom.xml +++ b/citygml4j-quality-ade/pom.xml @@ -4,21 +4,25 @@ 4.0.0 de.hft.stuttgart citygml4j-quality-ade - 0.1.3 + 3.1.4 UTF-8 - 1.8 - 1.8 + 11 + 11 - - - org.citygml4j - citygml4j - 2.10.2 - + + org.citygml4j + citygml4j-core + 3.0.0-rc.4 + + + org.citygml4j + citygml4j-xml + 3.0.0-rc.4 + org.junit.jupiter diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEContext.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEContext.java index f1e7d58cdf742678cc3a8ed408f4cbc331ef53a0..f7b70bafdee1cdcfd3fc884b474a5a17b5061716 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEContext.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEContext.java @@ -18,36 +18,23 @@ package de.hft.stuttgart.quality; import java.util.Collections; import java.util.List; -import org.citygml4j.model.citygml.ade.binding.ADEContext; -import org.citygml4j.model.citygml.ade.binding.ADEMarshaller; -import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller; -import org.citygml4j.model.module.ade.ADEModule; +import org.citygml4j.core.visitor.ADEWalker; +import org.citygml4j.xml.ade.CityGMLADE; +import org.citygml4j.xml.module.ade.ADEModule; -import de.hft.stuttgart.quality.marshaller.QualityAdeMarshaller; -import de.hft.stuttgart.quality.marshaller.QualityAdeUnmarshaller; -public class QualityADEContext implements ADEContext { +public class QualityADEContext implements CityGMLADE { - private final List modules = Collections.singletonList(QualityADEModule.V0_1_3); + private final List modules = Collections.singletonList(QualityADEModule.V0_1_4); @Override public List getADEModules() { return modules; } - - @Override - public List getModelPackageNames() { - return Collections.singletonList("de.hft.stuttgart.quality.model"); - } - - @Override - public ADEMarshaller createADEMarshaller() { - return new QualityAdeMarshaller(); - } - + @Override - public ADEUnmarshaller createADEUnmarshaller() { - return new QualityAdeUnmarshaller(); + public ADEWalker getADEWalker() { + return new QualityADEWalker(); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEModule.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEModule.java index 9270a2539ecc1c8915c3513663a16c15822639a3..58d389b7ca2d5da3a12d71cf1dc4f88d266737f2 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEModule.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEModule.java @@ -16,66 +16,22 @@ package de.hft.stuttgart.quality; import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import javax.xml.namespace.QName; - -import org.citygml4j.model.gml.feature.AbstractFeature; -import org.citygml4j.model.module.ade.ADEModule; -import org.citygml4j.model.module.citygml.CityGMLVersion; +import org.citygml4j.core.model.CityGMLVersion; +import org.citygml4j.xml.module.ade.ADEModule; public class QualityADEModule extends ADEModule { - public static final String NAMESPACE_URI = "https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3"; - - public static final QualityADEModule V0_1_3 = new QualityADEModule(); - - private static final long serialVersionUID = -8208579547274734280L; - - public QualityADEModule() { - super(NAMESPACE_URI, "qual", CityGMLVersion.v2_0_0); - } - - @Override - public URL getSchemaResource() { - return QualityADEContext.class.getResource("/qualityAde.xsd"); - } - - @Override - public List getJAXBPackageNames() { - return Collections.singletonList("de.hft.stuttgart.quality.model.jaxb"); - } + public static final String NAMESPACE_URI = "https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.4"; - @Override - public boolean hasFeatureProperty(String name) { - return false; - } + public static final QualityADEModule V0_1_4 = new QualityADEModule(); - @Override - public boolean hasFeature(String name) { - return false; - } - - @Override - public Class getFeatureClass(String name) { - throw new IllegalStateException("No feature classes available"); - } - - @Override - public QName getFeatureName(Class featureClass) { - return null; - } - - @Override - public Map> getFeatures() { - return Collections.emptyMap(); - } - - @Override - public boolean isTopLevelFeature(String name) { - return false; - } + public QualityADEModule() { + super(NAMESPACE_URI, "qual", CityGMLVersion.v2_0); + } + @Override + public URL getSchemaResource() { + return QualityADEContext.class.getResource("/qualityAde.xsd"); + } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEWalker.java similarity index 72% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationError.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEWalker.java index a1b5a8e2faba36caba5ebc77e4c545f208573f2a..6c035a38f229166b4ed7bd88668405ea47c44a09 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationError.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/QualityADEWalker.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality; -public abstract class ValidationError extends ChildObject { +import org.citygml4j.core.visitor.ADEWalker; + +public class QualityADEWalker extends ADEWalker { + - private static final long serialVersionUID = -2995694676938108325L; } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..ef88670d617810281ac5e59148017a6e1880e037 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractGeometryErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractGeometryErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..45b39300951e3d63fb0c4bb1be78bd8575771000 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractGeometryErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractGeometryErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractGeometryErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractGeometryErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractGeometryErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractPolygonErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractPolygonErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..3ef49fafb5696dfbc5972270358cc314180e0b48 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractPolygonErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractPolygonErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractPolygonErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractPolygonErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractPolygonErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractRingErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractRingErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..586548eb1ab5b5fc7ddba94e4249c63e3d93d22c --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractRingErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractRingErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractRingErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractRingErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractRingErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSemanticErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSemanticErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..3301ceb80cabfbb64ae8fb75c4f7f6ec3c2f58a6 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSemanticErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractSemanticErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractSemanticErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractSemanticErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractSemanticErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSolidErrorPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSolidErrorPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4a28b4fd0d1633b7881f26680afecb6c9282b219 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/AbstractSolidErrorPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.AbstractSolidErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class AbstractSolidErrorPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public AbstractSolidErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new AbstractSolidErrorProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/CheckingPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/CheckingPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..60e31d583e789b4269a3aba81f6a2e3f48bbab60 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/CheckingPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.CheckingProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class CheckingPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public CheckingProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new CheckingProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgeListPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgeListPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..a928e0592c2058e743a97d76095ee775358a43ee --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgeListPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.EdgeListProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class EdgeListPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public EdgeListProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new EdgeListProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPoints.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgePropertyAdapter.java similarity index 52% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPoints.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgePropertyAdapter.java index 7e1272228341b9adb212f2b3af5066f349ffd51b..9ec5629cdd7ac722f37d6351d376b07af7606943 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPoints.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/EdgePropertyAdapter.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,21 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.adapter.properties; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.properties.EdgeProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; -public class TooFewPoints extends RingError { +import javax.xml.namespace.QName; - private static final long serialVersionUID = -904319347280328865L; - - @Override - public String toString() { - return "TooFewPoints [linearRingId=" + getLinearRingId() + "]"; - } +public class EdgePropertyAdapter extends AbstractInlinePropertyAdapter { @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new TooFewPoints(), copyBuilder); + public EdgeProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new EdgeProperty(); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InteriorDisconnected.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ErrorPropertyAdapter.java similarity index 52% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InteriorDisconnected.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ErrorPropertyAdapter.java index 64da8cc78e1e5768201a0023646424b86b7c4ba2..421dca24f09e057c74f95d2fbffd191c240bb3c4 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InteriorDisconnected.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ErrorPropertyAdapter.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,21 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.adapter.properties; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.properties.ErrorProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; -public class InteriorDisconnected extends PolygonError { +import javax.xml.namespace.QName; - private static final long serialVersionUID = 8443642232356795359L; - - @Override - public String toString() { - return "InteriorDisconnected [polygonId=" + getPolygonId() + "]"; - } +public class ErrorPropertyAdapter extends AbstractInlinePropertyAdapter { @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new InteriorDisconnected(), copyBuilder); + public ErrorProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new ErrorProperty(); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FeatureStatisticsPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FeatureStatisticsPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..2dffab4f99179a733e3ac6d5d9048a13f24ef9fe --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FeatureStatisticsPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.FeatureStatisticsProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class FeatureStatisticsPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public FeatureStatisticsProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new FeatureStatisticsProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AllPolygonsWrongOrientation.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FilterPropertyAdapter.java similarity index 52% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AllPolygonsWrongOrientation.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FilterPropertyAdapter.java index 0b384b735f8fe70961198da21773642cac5ba538..9c0e26f4c14d60af5be737f027f4ea7ff77ae181 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AllPolygonsWrongOrientation.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/FilterPropertyAdapter.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,22 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.adapter.properties; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.properties.FilterProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; -public class AllPolygonsWrongOrientation extends SolidError { +import javax.xml.namespace.QName; - private static final long serialVersionUID = 3817224755569965908L; +public class FilterPropertyAdapter extends AbstractInlinePropertyAdapter { @Override - public String toString() { - return "AllPolygonsWrongOrientation [geometryId=" + getGeometryId() + "]"; + public FilterProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new FilterProperty(); } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new AllPolygonsWrongOrientation(), copyBuilder); - } - } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/GlobalParametersPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/GlobalParametersPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..7321e2ffedd95577537163a058e103d0804b33c4 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/GlobalParametersPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.GlobalParametersProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class GlobalParametersPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public GlobalParametersProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new GlobalParametersProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ParameterPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ParameterPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4c9e80fb950b2a87d630e98d00dbee3bbebc1ed9 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ParameterPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.ParameterProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class ParameterPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public ParameterProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new ParameterProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/PolygonIdListPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/PolygonIdListPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..31ff49dd8b29c57c1df8da28670b0e7066aa5336 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/PolygonIdListPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.PolygonIdListProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class PolygonIdListPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public PolygonIdListProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new PolygonIdListProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/RequirementPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/RequirementPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4c746fd17e3131c6260ef9e99906f533496e6841 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/RequirementPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.RequirementProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class RequirementPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public RequirementProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new RequirementProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/StatisticsPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/StatisticsPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..53f0e3e135317e3500a1d4261e9294a47afa4266 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/StatisticsPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.StatisticsProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class StatisticsPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public StatisticsProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new StatisticsProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPlanPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPlanPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..6e38ff2ce06c33c1e03d05e0d7b7e0c6e3f8871a --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPlanPropertyAdapter.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import de.hft.stuttgart.quality.model.properties.ValidationPlanProperty; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlinePropertyAdapter; + +import javax.xml.namespace.QName; + +public class ValidationPlanPropertyAdapter extends AbstractInlinePropertyAdapter { + + @Override + public ValidationPlanProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new ValidationPlanProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..47f40014fa7371e0c537470c27dfc61b748397c6 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPropertyAdapter.java @@ -0,0 +1,31 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import javax.xml.namespace.QName; + +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlineOrByReferencePropertyAdapter; + +import de.hft.stuttgart.quality.model.properties.ValidationProperty; + +public class ValidationPropertyAdapter extends AbstractInlineOrByReferencePropertyAdapter { + + @Override + public ValidationProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new ValidationProperty(); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationResultPropertyAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationResultPropertyAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4eae3e65d3cab2c8552c259bf6eb6ed1cca16ad6 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationResultPropertyAdapter.java @@ -0,0 +1,33 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.adapter.properties; + +import javax.xml.namespace.QName; + +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.base.AbstractInlineOrByReferencePropertyAdapter; + +import de.hft.stuttgart.quality.model.properties.ValidationResultProperty; + +public class ValidationResultPropertyAdapter + extends AbstractInlineOrByReferencePropertyAdapter { + + @Override + public ValidationResultProperty createObject(QName name, Object parent) throws ObjectBuildException { + return new ValidationResultProperty(); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..ba552871fd5750188529c50984c3848730ca5ce9 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractErrorAdapter.java @@ -0,0 +1,10 @@ +package de.hft.stuttgart.quality.adapter.types; + +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializer; + +import de.hft.stuttgart.quality.model.types.AbstractError; + +public abstract class AbstractErrorAdapter implements ObjectBuilder, ObjectSerializer { + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractGeometryErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractGeometryErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..aa33625961584d26239cf494056efea368453df5 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractGeometryErrorAdapter.java @@ -0,0 +1,7 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.types.AbstractGeometryError; + +public abstract class AbstractGeometryErrorAdapter extends AbstractErrorAdapter { + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractPolygonErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractPolygonErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..dbdcc9eb19c01477ecf161a751462ed6e16ee80d --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractPolygonErrorAdapter.java @@ -0,0 +1,45 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.AbstractPolygonError; + +public abstract class AbstractPolygonErrorAdapter + extends AbstractGeometryErrorAdapter { + + @Override + public void buildChildObject(AbstractPolygonError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "polygonId": + reader.getTextContent().ifPresent(object::setPolygonId); + break; + default: + throw new IllegalStateException( + "Cannot handle name " + name + " when building AbstractPolygonError element"); + } + } + + @Override + public void writeChildElements(AbstractPolygonError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getPolygonId() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "polygonId").addTextContent(object.getPolygonId())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractRingErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractRingErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..ae355bca6248471829b237d5606bd9a381878d3c --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractRingErrorAdapter.java @@ -0,0 +1,41 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.AbstractRingError; + +public abstract class AbstractRingErrorAdapter extends AbstractGeometryErrorAdapter { + + @Override + public void buildChildObject(AbstractRingError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "linearRingId": + reader.getTextContent().ifPresent(object::setLinearRingId); + break; + } + } + + @Override + public void writeChildElements(AbstractRingError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getLinearRingId() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId") + .addTextContent(object.getLinearRingId())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSemanticErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSemanticErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..c429b9788441b89a07dad51ca4a771cd93a0f8b3 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSemanticErrorAdapter.java @@ -0,0 +1,7 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.types.AbstractSemanticError; + +public abstract class AbstractSemanticErrorAdapter extends AbstractErrorAdapter { + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSolidErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSolidErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..41171ca98982a356c1b79d9e0f18244bfe10e9b6 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSolidErrorAdapter.java @@ -0,0 +1,43 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.AbstractSolidError; + +public abstract class AbstractSolidErrorAdapter extends AbstractGeometryErrorAdapter { + + @Override + public void buildChildObject(AbstractSolidError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "geometryId": + reader.getTextContent().ifPresent(object::setGeometryId); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building AbstractSolidError element"); + } + } + + @Override + public void writeChildElements(AbstractSolidError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getGeometryId() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "geometryId").addTextContent(object.getGeometryId())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AllPolygonsOrientedWrongErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AllPolygonsOrientedWrongErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..496231a7d63b316f3f9264313f0205e78aa9557c --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AllPolygonsOrientedWrongErrorAdapter.java @@ -0,0 +1,28 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.AllPolygonsOrientedWrongError; + +@XMLElement(name = "GE_S_ALL_POLYGONS_WRONG_ORIENTATION", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class AllPolygonsOrientedWrongErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public AllPolygonsOrientedWrongError createObject(QName name, Object parent) throws ObjectBuildException { + return new AllPolygonsOrientedWrongError(); + } + + @Override + public Element createElement(AllPolygonsOrientedWrongError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_ALL_POLYGONS_WRONG_ORIENTATION"); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CheckingAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CheckingAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..a9af1002c184fc3702cd5d707c1c86c9ce760d2d --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CheckingAdapter.java @@ -0,0 +1,59 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.enums.TopLevelFeatureType; +import de.hft.stuttgart.quality.model.types.Checking; + +import de.hft.stuttgart.quality.QualityADEModule; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import javax.xml.namespace.QName; + +@XMLElement(name = "Checking", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class CheckingAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Checking createObject(QName name, Object parent) throws ObjectBuildException { + return new Checking(); + } + + @Override + public void buildChildObject(Checking object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "featureType": + reader.getTextContent().ifPresent(s -> object.setFeatureType(TopLevelFeatureType.valueOf(s))); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Checking element"); + } + } + + @Override + public Element createElement(Checking object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Checking"); + } + + @Override + public void writeChildElements(Checking object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getFeatureType() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "featureType") + .addTextContent(object.getFeatureType().toString())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CityObjectPropertiesAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CityObjectPropertiesAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..f981bc59da5663d5b96c1a8beaeccdcd295bf050 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CityObjectPropertiesAdapter.java @@ -0,0 +1,55 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.ValidationResultPropertyAdapter; +import de.hft.stuttgart.quality.model.types.CityObjectProperties; + +@XMLElement(name = "validationResult", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class CityObjectPropertiesAdapter + implements ObjectBuilder, ObjectSerializer { + + @Override + public CityObjectProperties createObject(QName name, Object parent) throws ObjectBuildException { + return new CityObjectProperties(); + } + + @Override + public void buildChildObject(CityObjectProperties object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "ValidationResult": + object.setValidationResult(reader.getObjectUsingBuilder(ValidationResultPropertyAdapter.class)); + break; + default: + throw new IllegalStateException( + "Cannot handle name " + name + " when building CityObjectProperties element"); + } + } + + @Override + public void writeChildElements(CityObjectProperties object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getValidationResult() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "validationResult"), + object.getValidationResult(), ValidationResultPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ConsecutivePointsSameErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ConsecutivePointsSameErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..9f923fbfa7c29b25d3c18265113697ded6e3d19d --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ConsecutivePointsSameErrorAdapter.java @@ -0,0 +1,66 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.geometry.DirectPositionAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.ConsecutivePointsSameError; + +@XMLElement(name = "GE_R_CONSECUTIVE_POINTS_SAME", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ConsecutivePointsSameErrorAdapter extends AbstractRingErrorAdapter { + + @Override + public ConsecutivePointsSameError createObject(QName name, Object parent) throws ObjectBuildException { + return new ConsecutivePointsSameError(); + } + + @Override + public void buildChildObject(ConsecutivePointsSameError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "vertex1": + object.setVertex1(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + case "vertex2": + object.setVertex2(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(ConsecutivePointsSameError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_R_CONSECUTIVE_POINTS_SAME"); + } + + @Override + public void writeChildElements(ConsecutivePointsSameError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + + if (object.getVertex1() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex1"), + object.getVertex1(), DirectPositionAdapter.class, namespaces); + } + if (object.getVertex2() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex2"), + object.getVertex2(), DirectPositionAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..285418cb8826bff835f0e725d90d876eaf668c67 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeAdapter.java @@ -0,0 +1,65 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.gml.adapter.geometry.DirectPositionAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.Edge; + +@XMLElement(name = "Edge", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class EdgeAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Edge createObject(QName name, Object parent) throws ObjectBuildException { + return new Edge(); + } + + @Override + public void buildChildObject(Edge object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "from": + object.setFrom(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + case "to": + object.setTo(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Edge element"); + } + } + + @Override + public Element createElement(Edge object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Edge"); + } + + @Override + public void writeChildElements(Edge object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getFrom() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "from"), object.getFrom(), + DirectPositionAdapter.class, namespaces); + } + if (object.getTo() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "to"), object.getTo(), + DirectPositionAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeListAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeListAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..3ddbcd0762135daaaba6ddfce86749cda08fe77b --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeListAdapter.java @@ -0,0 +1,59 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.EdgePropertyAdapter; +import de.hft.stuttgart.quality.model.properties.EdgeProperty; +import de.hft.stuttgart.quality.model.types.EdgeList; + +@XMLElement(name = "EdgeList", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class EdgeListAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public EdgeList createObject(QName name, Object parent) throws ObjectBuildException { + return new EdgeList(); + } + + @Override + public void buildChildObject(EdgeList object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "edge": + object.getEdges().add(reader.getObjectUsingBuilder(EdgePropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building EdgeList element"); + } + } + + @Override + public Element createElement(EdgeList object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "EdgeList"); + } + + @Override + public void writeChildElements(EdgeList object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + for (EdgeProperty edgeProp : object.getEdges()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edge"), edgeProp, + EdgePropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..7b5d0cad1157828b79c1afe0a464d193382f5d07 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ErrorAdapter.java @@ -0,0 +1,63 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.enums.ErrorId; +import de.hft.stuttgart.quality.model.types.Error; + +@XMLElement(name = "Error", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ErrorAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Error createObject(QName name, Object parent) throws ObjectBuildException { + return new Error(); + } + + @Override + public void buildChildObject(Error object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "occurrences": + reader.getTextContent().ifPresent(s -> object.setOccurrences(Integer.parseInt(s))); + break; + case "name": + reader.getTextContent().ifPresent(s -> object.setName(ErrorId.valueOf(s))); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Error element"); + } + } + + @Override + public Element createElement(Error object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Error"); + } + + @Override + public void writeChildElements(Error object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "occurrences") + .addTextContent(Integer.toString(object.getOccurrences()))); + if (object.getName() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "name").addTextContent(object.getName().toString())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FeatureStatisticsAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FeatureStatisticsAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..2169b7fb97d32773644b7905733b4deabb4491a5 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FeatureStatisticsAdapter.java @@ -0,0 +1,61 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.types.FeatureStatistics; + +import de.hft.stuttgart.quality.QualityADEModule; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import javax.xml.namespace.QName; + +@XMLElement(name = "FeatureStatistics", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class FeatureStatisticsAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public FeatureStatistics createObject(QName name, Object parent) throws ObjectBuildException { + return new FeatureStatistics(); + } + + @Override + public void buildChildObject(FeatureStatistics object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "numChecked": + reader.getTextContent().ifPresent(s -> object.setNumChecked(Integer.parseInt(s))); + break; + case "numErrors": + reader.getTextContent().ifPresent(s -> object.setNumErrors(Integer.parseInt(s))); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building FeatureStatistics element"); + } + } + + @Override + public Element createElement(FeatureStatistics object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "FeatureStatistics"); + } + + @Override + public void writeChildElements(FeatureStatistics object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "numChecked") + .addTextContent(Integer.toString(object.getNumChecked()))); + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "numErrors") + .addTextContent(Integer.toString(object.getNumErrors()))); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FilterAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FilterAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..bebe70fa0c742141c5ce54c95d9ac2104ddb65a5 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FilterAdapter.java @@ -0,0 +1,59 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.CheckingPropertyAdapter; +import de.hft.stuttgart.quality.model.properties.CheckingProperty; +import de.hft.stuttgart.quality.model.types.Filter; + +@XMLElement(name = "Filter", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class FilterAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Filter createObject(QName name, Object parent) throws ObjectBuildException { + return new Filter(); + } + + @Override + public void buildChildObject(Filter object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "checking": + object.getChecking().add(reader.getObjectUsingBuilder(CheckingPropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Filter element"); + } + } + + @Override + public Element createElement(Filter object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Filter"); + } + + @Override + public void writeChildElements(Filter object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + for (CheckingProperty checkProp : object.getChecking()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "checking"), checkProp, + CheckingPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/GlobalParametersAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/GlobalParametersAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..0708065d835233b041c104c22610093140eff114 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/GlobalParametersAdapter.java @@ -0,0 +1,59 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.ParameterPropertyAdapter; +import de.hft.stuttgart.quality.model.properties.ParameterProperty; +import de.hft.stuttgart.quality.model.types.GlobalParameters; + +@XMLElement(name = "GlobalParameters", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class GlobalParametersAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public GlobalParameters createObject(QName name, Object parent) throws ObjectBuildException { + return new GlobalParameters(); + } + + @Override + public void buildChildObject(GlobalParameters object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "parameter": + object.getParameters().add(reader.getObjectUsingBuilder(ParameterPropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building GlobalParameters element"); + } + } + + @Override + public Element createElement(GlobalParameters object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GlobalParameters"); + } + + @Override + public void writeChildElements(GlobalParameters object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + for (ParameterProperty gpp : object.getParameters()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "parameter"), gpp, + ParameterPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/HoleOutsideErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/HoleOutsideErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..0b7a3a238fd4db795a8bc2bed27212750d46bf92 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/HoleOutsideErrorAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.HoleOutsideError; + +@XMLElement(name = "GE_P_HOLE_OUTSIDE", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class HoleOutsideErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public HoleOutsideError createObject(QName name, Object parent) throws ObjectBuildException { + return new HoleOutsideError(); + } + + @Override + public void buildChildObject(HoleOutsideError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "linearRingId": + reader.getTextContent().ifPresent(object::setLinearRingId); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(HoleOutsideError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_HOLE_OUTSIDE"); + } + + @Override + public void writeChildElements(HoleOutsideError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + + if (object.getLinearRingId() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId") + .addTextContent(object.getLinearRingId())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InnerRingsNestedErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InnerRingsNestedErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..45d6cdc66cd0106f8dd2217208153b8bfcc8bd02 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InnerRingsNestedErrorAdapter.java @@ -0,0 +1,63 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.InnerRingsNestedError; + +@XMLElement(name = "GE_P_INNER_RINGS_NESTED", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class InnerRingsNestedErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public InnerRingsNestedError createObject(QName name, Object parent) throws ObjectBuildException { + return new InnerRingsNestedError(); + } + + @Override + public void buildChildObject(InnerRingsNestedError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "linearRingId1": + reader.getTextContent().ifPresent(object::setLinearRingId1); + break; + case "linearRingId2": + reader.getTextContent().ifPresent(object::setLinearRingId2); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(InnerRingsNestedError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_INNER_RINGS_NESTED"); + } + + @Override + public void writeChildElements(InnerRingsNestedError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getLinearRingId1() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId1") + .addTextContent(object.getLinearRingId1())); + } + if (object.getLinearRingId2() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId2") + .addTextContent(object.getLinearRingId2())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InteriorDisconnectedErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InteriorDisconnectedErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..c530f04c5eaa5b519b4c45cbc9a42c6326b19f6f --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/InteriorDisconnectedErrorAdapter.java @@ -0,0 +1,28 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.InteriorDisconnectedError; + +@XMLElement(name = "GE_P_INTERIOR_DISCONNECTED", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class InteriorDisconnectedErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public InteriorDisconnectedError createObject(QName name, Object parent) throws ObjectBuildException { + return new InteriorDisconnectedError(); + } + + @Override + public Element createElement(InteriorDisconnectedError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_INTERIOR_DISCONNECTED"); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/IntersectingRingsErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/IntersectingRingsErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..3fd59f0c435ed162ee5d87c6137496864f996fd3 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/IntersectingRingsErrorAdapter.java @@ -0,0 +1,64 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.IntersectingRingsError; + +@XMLElement(name = "GE_P_INTERSECTING_RINGS", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class IntersectingRingsErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public IntersectingRingsError createObject(QName name, Object parent) throws ObjectBuildException { + return new IntersectingRingsError(); + } + + @Override + public void buildChildObject(IntersectingRingsError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "linearRingId1": + reader.getTextContent().ifPresent(object::setLinearRingId1); + break; + case "linearRingId2": + reader.getTextContent().ifPresent(object::setLinearRingId2); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(IntersectingRingsError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_INTERSECTING_RINGS"); + } + + @Override + public void writeChildElements(IntersectingRingsError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + + if (object.getLinearRingId1() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId1") + .addTextContent(object.getLinearRingId1())); + } + if (object.getLinearRingId2() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId2") + .addTextContent(object.getLinearRingId2())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/MultipleComponentsErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/MultipleComponentsErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4a353890736b3ea5c28e4e1b4dc57b3ba8435025 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/MultipleComponentsErrorAdapter.java @@ -0,0 +1,59 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.PolygonIdListPropertyAdapter; +import de.hft.stuttgart.quality.model.properties.PolygonIdListProperty; +import de.hft.stuttgart.quality.model.types.MultipleComponentsError; + +@XMLElement(name = "GE_S_MULTIPLE_CONNECTED_COMPONENTS", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class MultipleComponentsErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public MultipleComponentsError createObject(QName name, Object parent) throws ObjectBuildException { + return new MultipleComponentsError(); + } + + @Override + public void buildChildObject(MultipleComponentsError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "component": + object.getComponents().add(reader.getObjectUsingBuilder(PolygonIdListPropertyAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(MultipleComponentsError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_MULTIPLE_CONNECTED_COMPONENTS"); + } + + @Override + public void writeChildElements(MultipleComponentsError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + for (PolygonIdListProperty clp : object.getComponents()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "component"), clp, + PolygonIdListPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldEdgeErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldEdgeErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..e9ab81c5a56a6003a37198bae6bc1e50535e3573 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldEdgeErrorAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.EdgeListPropertyAdapter; +import de.hft.stuttgart.quality.model.types.NonManifoldEdgeError; + +@XMLElement(name = "GE_S_NON_MANIFOLD_EDGE", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class NonManifoldEdgeErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public NonManifoldEdgeError createObject(QName name, Object parent) throws ObjectBuildException { + return new NonManifoldEdgeError(); + } + + @Override + public void buildChildObject(NonManifoldEdgeError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "edges": + object.setEdges(reader.getObjectUsingBuilder(EdgeListPropertyAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(NonManifoldEdgeError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_NON_MANIFOLD_EDGE"); + } + + @Override + public void writeChildElements(NonManifoldEdgeError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getEdges() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edges"), object.getEdges(), + EdgeListPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldVertexErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldVertexErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..2dcf8bc1af01cdc09ffddc06c929726cfbc68959 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/NonManifoldVertexErrorAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.geometry.DirectPositionAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.NonManifoldVertexError; + +@XMLElement(name = "GE_S_NON_MANIFOLD_VERTEX", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class NonManifoldVertexErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public NonManifoldVertexError createObject(QName name, Object parent) throws ObjectBuildException { + return new NonManifoldVertexError(); + } + + @Override + public void buildChildObject(NonManifoldVertexError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "vertex": + object.setVertex(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(NonManifoldVertexError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_NON_MANIFOLD_VERTEX"); + } + + @Override + public void writeChildElements(NonManifoldVertexError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getVertex() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex"), object.getVertex(), + DirectPositionAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/OrientationRingsSameErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/OrientationRingsSameErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..ebf8ffa7ae42a49bc742ed0bb693e36e86a1a72f --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/OrientationRingsSameErrorAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.OrientationRingsSameError; + +@XMLElement(name = "GE_P_ORIENTATION_RINGS_SAME", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class OrientationRingsSameErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public OrientationRingsSameError createObject(QName name, Object parent) throws ObjectBuildException { + return new OrientationRingsSameError(); + } + + @Override + public void buildChildObject(OrientationRingsSameError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "linearRingId": + reader.getTextContent().ifPresent(object::setLinearRing); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(OrientationRingsSameError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_ORIENTATION_RINGS_SAME"); + } + + @Override + public void writeChildElements(OrientationRingsSameError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getLinearRing() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "linearRingId").addTextContent(object.getLinearRing())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ParameterAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ParameterAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..89c91c2d1a953907da2db116edd8088327421074 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ParameterAdapter.java @@ -0,0 +1,69 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.types.Parameter; + +import de.hft.stuttgart.quality.QualityADEModule; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import javax.xml.namespace.QName; + +@XMLElement(name = "Parameter", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ParameterAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Parameter createObject(QName name, Object parent) throws ObjectBuildException { + return new Parameter(); + } + + @Override + public void buildChildObject(Parameter object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "name": + reader.getTextContent().ifPresent(object::setName); + break; + case "uom": + reader.getTextContent().ifPresent(object::setUom); + break; + case "value": + reader.getTextContent().ifPresent(object::setValue); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Parameter element"); + } + } + + @Override + public Element createElement(Parameter object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Parameter"); + } + + @Override + public void writeChildElements(Parameter object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getName() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "name").addTextContent(object.getName())); + } + if (object.getUom() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "uom").addTextContent(object.getUom())); + } + if (object.getValue() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "value").addTextContent(object.getValue())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarDistancePlaneErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarDistancePlaneErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..38aa5205bf0e05d1c0893489d0ef8ca0687784e1 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarDistancePlaneErrorAdapter.java @@ -0,0 +1,67 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.geometry.DirectPositionAdapter; +import org.xmlobjects.gml.adapter.measures.LengthAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.PlanarDistancePlaneError; + +@XMLElement(name = "GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class PlanarDistancePlaneErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public PlanarDistancePlaneError createObject(QName name, Object parent) throws ObjectBuildException { + return new PlanarDistancePlaneError(); + } + + @Override + public void buildChildObject(PlanarDistancePlaneError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "vertex": + object.setVertex(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + case "distance": + object.setDistance(reader.getObjectUsingBuilder(LengthAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(PlanarDistancePlaneError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"); + } + + @Override + public void writeChildElements(PlanarDistancePlaneError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getDistance() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "distance"), + object.getDistance(), LengthAdapter.class, namespaces); + } + if (object.getVertex() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex"), object.getVertex(), + DirectPositionAdapter.class, namespaces); + } + + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarNormalsDeviationErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarNormalsDeviationErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..c0d21307bab6606c5b9178880d163a846e4c6058 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PlanarNormalsDeviationErrorAdapter.java @@ -0,0 +1,58 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.measures.AngleAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.PlanarNormalsDeviationError; + +@XMLElement(name = "GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class PlanarNormalsDeviationErrorAdapter extends AbstractPolygonErrorAdapter { + + @Override + public PlanarNormalsDeviationError createObject(QName name, Object parent) throws ObjectBuildException { + return new PlanarNormalsDeviationError(); + } + + @Override + public void buildChildObject(PlanarNormalsDeviationError object, QName name, Attributes attributes, + XMLReader reader) throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "deviation": + object.setDeviation(reader.getObjectUsingBuilder(AngleAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(PlanarNormalsDeviationError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"); + } + + @Override + public void writeChildElements(PlanarNormalsDeviationError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getDeviation() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "deviation"), + object.getDeviation(), AngleAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonIdListAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonIdListAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..f031f38072baffe9eb7ac649b18e1204641a76f0 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonIdListAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.types.PolygonIdList; + +import de.hft.stuttgart.quality.QualityADEModule; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import javax.xml.namespace.QName; + +@XMLElement(name = "PolygonIdList", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class PolygonIdListAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public PolygonIdList createObject(QName name, Object parent) throws ObjectBuildException { + return new PolygonIdList(); + } + + @Override + public void buildChildObject(PolygonIdList object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "polygonId": + object.getPolygonIds().add(reader.getTextContent().get()); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building PolygonIdList element"); + } + } + + @Override + public Element createElement(PolygonIdList object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "PolygonIdList"); + } + + @Override + public void writeChildElements(PolygonIdList object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + for (String polygonId : object.getPolygonIds()) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "polygonId").addTextContent(polygonId)); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonWrongOrientationErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonWrongOrientationErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4a67fc1046f53a02456921748a1dbfc748f8a85d --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/PolygonWrongOrientationErrorAdapter.java @@ -0,0 +1,58 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.EdgeListPropertyAdapter; +import de.hft.stuttgart.quality.model.types.PolygonWrongOrientationError; + +@XMLElement(name = "GE_S_POLYGON_WRONG_ORIENTATION", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class PolygonWrongOrientationErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public PolygonWrongOrientationError createObject(QName name, Object parent) throws ObjectBuildException { + return new PolygonWrongOrientationError(); + } + + @Override + public void buildChildObject(PolygonWrongOrientationError object, QName name, Attributes attributes, + XMLReader reader) throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "edges": + object.setEdges(reader.getObjectUsingBuilder(EdgeListPropertyAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(PolygonWrongOrientationError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_POLYGON_WRONG_ORIENTATION"); + } + + @Override + public void writeChildElements(PolygonWrongOrientationError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getEdges() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edges"), object.getEdges(), + EdgeListPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RequirementAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RequirementAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..9c4ea09e4f78b76522896302ba52beb859ec0c43 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RequirementAdapter.java @@ -0,0 +1,73 @@ +package de.hft.stuttgart.quality.adapter.types; + +import de.hft.stuttgart.quality.model.enums.RequirementId; +import de.hft.stuttgart.quality.model.properties.ParameterProperty; +import de.hft.stuttgart.quality.model.types.Requirement; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.ParameterPropertyAdapter; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import javax.xml.namespace.QName; + +@XMLElement(name = "Requirement", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class RequirementAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Requirement createObject(QName name, Object parent) throws ObjectBuildException { + return new Requirement(); + } + + @Override + public void buildChildObject(Requirement object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "enabled": + reader.getTextContent().ifPresent(s -> object.setEnabled(Boolean.parseBoolean(s))); + break; + case "requirementType": + object.setRequirementType(RequirementId.valueOf(reader.getTextContent().get())); + break; + case "parameter": + object.getParameters().add(reader.getObjectUsingBuilder(ParameterPropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Requirement element"); + } + } + + @Override + public Element createElement(Requirement object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Requirement"); + } + + @Override + public void writeChildElements(Requirement object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "enabled") + .addTextContent(Boolean.toString(object.isEnabled()))); + if (object.getRequirementType() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "requirementType") + .addTextContent(object.getRequirementType().toString())); + } + for (ParameterProperty params : object.getParameters()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "parameter"), params, + ParameterPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingNotClosedErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingNotClosedErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..a34143eb4c59176b0c3f4e95819eef2c1f81637b --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingNotClosedErrorAdapter.java @@ -0,0 +1,26 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.RingNotClosedError; + +@XMLElement(name = "GE_R_NOT_CLOSED", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class RingNotClosedErrorAdapter extends AbstractRingErrorAdapter { + + @Override + public RingNotClosedError createObject(QName name, Object parent) throws ObjectBuildException { + return new RingNotClosedError(); + } + + @Override + public Element createElement(RingNotClosedError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_R_NOT_CLOSED"); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingSelfIntersectionErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingSelfIntersectionErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..7598322692f59b7086e37a2d7ee2982ea539fe96 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingSelfIntersectionErrorAdapter.java @@ -0,0 +1,88 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.gml.adapter.geometry.DirectPositionAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.EdgePropertyAdapter; +import de.hft.stuttgart.quality.model.enums.RingSelfIntType; +import de.hft.stuttgart.quality.model.types.RingSelfIntersectionError; + +@XMLElement(name = "GE_R_SELF_INTERSECTION", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class RingSelfIntersectionErrorAdapter extends AbstractRingErrorAdapter { + + @Override + public RingSelfIntersectionError createObject(QName name, Object parent) throws ObjectBuildException { + return new RingSelfIntersectionError(); + } + + @Override + public void buildChildObject(RingSelfIntersectionError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "type": + reader.getTextContent().ifPresent(s -> object.setType(RingSelfIntType.valueOf(s))); + break; + case "edge1": + object.setEdge1(reader.getObjectUsingBuilder(EdgePropertyAdapter.class)); + break; + case "edge2": + object.setEdge2(reader.getObjectUsingBuilder(EdgePropertyAdapter.class)); + break; + case "vertex1": + object.setVertex1(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + case "vertex2": + object.setVertex2(reader.getObjectUsingBuilder(DirectPositionAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(RingSelfIntersectionError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_R_SELF_INTERSECTION"); + } + + @Override + public void writeChildElements(RingSelfIntersectionError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getEdge1() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edge1"), object.getEdge1(), + EdgePropertyAdapter.class, namespaces); + } + if (object.getEdge2() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edge2"), object.getEdge2(), + EdgePropertyAdapter.class, namespaces); + } + if (object.getVertex1() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex1"), + object.getVertex1(), DirectPositionAdapter.class, namespaces); + } + if (object.getVertex2() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "vertex2"), + object.getVertex2(), DirectPositionAdapter.class, namespaces); + } + if (object.getType() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "type").addTextContent(object.getType().toString())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingTooFewPointsErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingTooFewPointsErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..a325d9d5e060485f2c749afe60de3cd50656af46 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/RingTooFewPointsErrorAdapter.java @@ -0,0 +1,27 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.RingTooFewPointsError; + +@XMLElement(name = "GE_R_TOO_FEW_POINTS", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class RingTooFewPointsErrorAdapter extends AbstractRingErrorAdapter { + + @Override + public RingTooFewPointsError createObject(QName name, Object parent) throws ObjectBuildException { + return new RingTooFewPointsError(); + } + + @Override + public Element createElement(RingTooFewPointsError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_R_TOO_FEW_POINTS"); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeMissingErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeMissingErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..c47bcfc846a218138eca1d49167300601ee0605f --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeMissingErrorAdapter.java @@ -0,0 +1,69 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.SemanticAttributeMissingError; + +@XMLElement(name = "SE_ATTRIBUTE_MISSING", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class SemanticAttributeMissingErrorAdapter extends AbstractSemanticErrorAdapter { + + @Override + public SemanticAttributeMissingError createObject(QName name, Object parent) throws ObjectBuildException { + return new SemanticAttributeMissingError(); + } + + @Override + public void buildChildObject(SemanticAttributeMissingError object, QName name, Attributes attributes, + XMLReader reader) throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "childId": + reader.getTextContent().ifPresent(object::setChildId); + break; + case "attributeName": + reader.getTextContent().ifPresent(object::setAttributeName); + break; + case "generic": + reader.getTextContent().ifPresent(s -> object.setGeneric(Boolean.parseBoolean(s))); + break; + default: + throw new IllegalStateException( + "Cannot handle name " + name + " when building SemanticAttributeMissingError element"); + } + } + + @Override + public Element createElement(SemanticAttributeMissingError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "SE_ATTRIBUTE_MISSING"); + } + + @Override + public void writeChildElements(SemanticAttributeMissingError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getChildId() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "childId").addTextContent(object.getChildId())); + } + if (object.getAttributeName() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "attributeName") + .addTextContent(object.getAttributeName())); + } + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "generic") + .addTextContent(Boolean.toString(object.isGeneric()))); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeWrongValueErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeWrongValueErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..923bf5edbb65d828bd2c12954f9b4869441f8ef5 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SemanticAttributeWrongValueErrorAdapter.java @@ -0,0 +1,71 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.SemanticAttributeWrongValueError; + +@XMLElement(name = "SE_ATTRIBUTE_WRONG_VALUE", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class SemanticAttributeWrongValueErrorAdapter + extends AbstractSemanticErrorAdapter { + + @Override + public SemanticAttributeWrongValueError createObject(QName name, Object parent) throws ObjectBuildException { + return new SemanticAttributeWrongValueError(); + } + + @Override + public void buildChildObject(SemanticAttributeWrongValueError object, QName name, Attributes attributes, + XMLReader reader) throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "childId": + reader.getTextContent().ifPresent(object::setChildId); + break; + case "attributeName": + reader.getTextContent().ifPresent(object::setAttributeName); + break; + case "generic": + reader.getTextContent().ifPresent(s -> object.setGeneric(Boolean.parseBoolean(s))); + break; + default: + throw new IllegalStateException( + "Cannot handle name " + name + " when building SemanticAttributeWrongValueError element"); + } + } + + @Override + public Element createElement(SemanticAttributeWrongValueError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "SE_ATTRIBUTE_WRONG_VALUE"); + } + + @Override + public void writeChildElements(SemanticAttributeWrongValueError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getChildId() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "childId").addTextContent(object.getChildId())); + } + if (object.getAttributeName() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "attributeName") + .addTextContent(object.getAttributeName())); + } + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "generic") + .addTextContent(Boolean.toString(object.isGeneric()))); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidNotClosedErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidNotClosedErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..54c7760fa66b16355e9b8e92e8024d00bc0fa62a --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidNotClosedErrorAdapter.java @@ -0,0 +1,57 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.EdgeListPropertyAdapter; +import de.hft.stuttgart.quality.model.types.SolidNotClosedError; + +@XMLElement(name = "GE_S_NOT_CLOSED", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class SolidNotClosedErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public SolidNotClosedError createObject(QName name, Object parent) throws ObjectBuildException { + return new SolidNotClosedError(); + } + + @Override + public void buildChildObject(SolidNotClosedError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "edges": + object.setEdges(reader.getObjectUsingBuilder(EdgeListPropertyAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(SolidNotClosedError object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_NOT_CLOSED"); + } + + @Override + public void writeChildElements(SolidNotClosedError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getEdges() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "edges"), object.getEdges(), + EdgeListPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidSelfIntersectionErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidSelfIntersectionErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..e0491cf97e28b8f97ac800a1b8265aab686ea775 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidSelfIntersectionErrorAdapter.java @@ -0,0 +1,64 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.SolidSelfIntersectionError; + +@XMLElement(name = "GE_S_SELF_INTERSECTION", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class SolidSelfIntersectionErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public SolidSelfIntersectionError createObject(QName name, Object parent) throws ObjectBuildException { + return new SolidSelfIntersectionError(); + } + + @Override + public void buildChildObject(SolidSelfIntersectionError object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "polygonId1": + reader.getTextContent().ifPresent(object::setPolygonId1); + break; + case "polygonId2": + reader.getTextContent().ifPresent(object::setPolygonId2); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(SolidSelfIntersectionError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_SELF_INTERSECTION"); + } + + @Override + public void writeChildElements(SolidSelfIntersectionError object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getPolygonId1() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "polygonId1").addTextContent(object.getPolygonId1())); + } + if (object.getPolygonId2() != null) { + writer.writeElement( + Element.of(QualityADEModule.NAMESPACE_URI, "polygonId2").addTextContent(object.getPolygonId2())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidTooFewPolygonsErrorAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidTooFewPolygonsErrorAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..7588b418b24e9e4415f826d0852078faedb47376 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/SolidTooFewPolygonsErrorAdapter.java @@ -0,0 +1,28 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.model.types.SolidTooFewPolygonsError; + +@XMLElement(name = "GE_S_TOO_FEW_POLYGONS", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class SolidTooFewPolygonsErrorAdapter extends AbstractSolidErrorAdapter { + + @Override + public SolidTooFewPolygonsError createObject(QName name, Object parent) throws ObjectBuildException { + return new SolidTooFewPolygonsError(); + } + + @Override + public Element createElement(SolidTooFewPolygonsError object, Namespaces namespaces) + throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "GE_S_TOO_FEW_POLYGONS"); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/StatisticsAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/StatisticsAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..faa53f6fdd91abad3c52bbe0f4ed6005680d9d1a --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/StatisticsAdapter.java @@ -0,0 +1,102 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.ErrorPropertyAdapter; +import de.hft.stuttgart.quality.adapter.properties.FeatureStatisticsPropertyAdapter; +import de.hft.stuttgart.quality.model.properties.ErrorProperty; +import de.hft.stuttgart.quality.model.types.Statistics; + +@XMLElement(name = "Statistics", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class StatisticsAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public Statistics createObject(QName name, Object parent) throws ObjectBuildException { + return new Statistics(); + } + + @Override + public void buildChildObject(Statistics object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "numErrorBuildings": + object.setNumErrorBuildings(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "numErrorVegetation": + object.setNumErrorVegetation(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "numErrorLandObjects": + object.setNumErrorLandObjects(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "numErrorBridgeObjects": + object.setNumErrorBridgeObjects(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "numErrorWaterObjects": + object.setNumErrorWaterObjects(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "numErrorTransportation": + object.setNumErrorTransportation(reader.getObjectUsingBuilder(FeatureStatisticsPropertyAdapter.class)); + break; + case "error": + object.getErrors().add(reader.getObjectUsingBuilder(ErrorPropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building Statistics element"); + } + } + + @Override + public Element createElement(Statistics object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Statistics"); + } + + @Override + public void writeChildElements(Statistics object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getNumErrorBuildings() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorBuildings"), + object.getNumErrorBuildings(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + if (object.getNumErrorVegetation() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorVegetation"), + object.getNumErrorVegetation(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + if (object.getNumErrorLandObjects() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorLandObjects"), + object.getNumErrorLandObjects(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + if (object.getNumErrorBridgeObjects() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorBridgeObjects"), + object.getNumErrorBridgeObjects(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + if (object.getNumErrorWaterObjects() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorWaterObjects"), + object.getNumErrorWaterObjects(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + if (object.getNumErrorTransportation() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "numErrorTransportation"), + object.getNumErrorTransportation(), FeatureStatisticsPropertyAdapter.class, namespaces); + } + for (ErrorProperty errorProp : object.getErrors()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "error"), errorProp, + ErrorPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..bd347f05475f03db9ca84a70e40a5c87afca47e1 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationAdapter.java @@ -0,0 +1,82 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.citygml4j.xml.adapter.core.AbstractFeatureAdapter; +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.StatisticsPropertyAdapter; +import de.hft.stuttgart.quality.adapter.properties.ValidationPlanPropertyAdapter; +import de.hft.stuttgart.quality.model.types.Validation; + +@XMLElement(name = "Validation", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ValidationAdapter extends AbstractFeatureAdapter { + + private static final ZonedDateTimeAdapter DATE_TIME_ADAPTER = new ZonedDateTimeAdapter(); + + @Override + public Validation createObject(QName name, Object parent) throws ObjectBuildException { + return new Validation(); + } + + @Override + public void buildChildObject(Validation object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "validationDate": + reader.getTextContent().ifPresent(s -> object.setValidationDate(DATE_TIME_ADAPTER.fromString(s))); + break; + case "validationSoftware": + reader.getTextContent().ifPresent(object::setValidationSoftware); + break; + case "statistics": + object.setStatistics(reader.getObjectUsingBuilder(StatisticsPropertyAdapter.class)); + break; + case "validationPlan": + object.setValidationPlan(reader.getObjectUsingBuilder(ValidationPlanPropertyAdapter.class)); + break; + default: + super.buildChildObject(object, name, attributes, reader); + } + } + + @Override + public Element createElement(Validation object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "Validation"); + } + + @Override + public void writeChildElements(Validation object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + super.writeChildElements(object, namespaces, writer); + if (object.getValidationDate() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "validationDate") + .addTextContent(DATE_TIME_ADAPTER.toString(object.getValidationDate()))); + } + if (object.getValidationSoftware() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "validationSoftware") + .addTextContent(object.getValidationSoftware())); + } + if (object.getStatistics() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "statistics"), + object.getStatistics(), StatisticsPropertyAdapter.class, namespaces); + } + if (object.getValidationPlan() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "validationPlan"), + object.getValidationPlan(), ValidationPlanPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationPlanAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationPlanAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..b84f85e2098255b7861addfdc353033d8d51ac2e --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationPlanAdapter.java @@ -0,0 +1,75 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.FilterPropertyAdapter; +import de.hft.stuttgart.quality.adapter.properties.GlobalParametersPropertyAdapter; +import de.hft.stuttgart.quality.adapter.properties.RequirementPropertyAdapter; +import de.hft.stuttgart.quality.model.properties.RequirementProperty; +import de.hft.stuttgart.quality.model.types.ValidationPlan; + +@XMLElement(name = "ValidationPlan", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ValidationPlanAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public ValidationPlan createObject(QName name, Object parent) throws ObjectBuildException { + return new ValidationPlan(); + } + + @Override + public void buildChildObject(ValidationPlan object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "globalParameters": + object.setGlobalParameters(reader.getObjectUsingBuilder(GlobalParametersPropertyAdapter.class)); + break; + case "filter": + object.setFilter(reader.getObjectUsingBuilder(FilterPropertyAdapter.class)); + break; + case "requirement": + object.getRequirements().add(reader.getObjectUsingBuilder(RequirementPropertyAdapter.class)); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building ValidationPlan element"); + } + } + + @Override + public Element createElement(ValidationPlan object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "ValidationPlan"); + } + + @Override + public void writeChildElements(ValidationPlan object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getGlobalParameters() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "globalParameters"), + object.getGlobalParameters(), GlobalParametersPropertyAdapter.class, namespaces); + } + if (object.getFilter() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "filter"), object.getFilter(), + FilterPropertyAdapter.class, namespaces); + } + for (RequirementProperty req : object.getRequirements()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "requirement"), req, + RequirementPropertyAdapter.class, namespaces); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationResultAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationResultAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..6e65ca926bf906a48ce5cfd43970542deb35b314 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ValidationResultAdapter.java @@ -0,0 +1,75 @@ +package de.hft.stuttgart.quality.adapter.types; + +import javax.xml.namespace.QName; + +import org.xmlobjects.annotation.XMLElement; +import org.xmlobjects.builder.ObjectBuildException; +import org.xmlobjects.builder.ObjectBuilder; +import org.xmlobjects.gml.adapter.base.ReferenceAdapter; +import org.xmlobjects.serializer.ObjectSerializeException; +import org.xmlobjects.serializer.ObjectSerializer; +import org.xmlobjects.stream.XMLReadException; +import org.xmlobjects.stream.XMLReader; +import org.xmlobjects.stream.XMLWriteException; +import org.xmlobjects.stream.XMLWriter; +import org.xmlobjects.xml.Attributes; +import org.xmlobjects.xml.Element; +import org.xmlobjects.xml.Namespaces; + +import de.hft.stuttgart.quality.QualityADEModule; +import de.hft.stuttgart.quality.adapter.properties.AbstractErrorPropertyAdapter; +import de.hft.stuttgart.quality.model.enums.ResultType; +import de.hft.stuttgart.quality.model.properties.AbstractErrorProperty; +import de.hft.stuttgart.quality.model.types.ValidationResult; + +@XMLElement(name = "ValidationResult", namespaceURI = QualityADEModule.NAMESPACE_URI) +public class ValidationResultAdapter implements ObjectBuilder, ObjectSerializer { + + @Override + public ValidationResult createObject(QName name, Object parent) throws ObjectBuildException { + return new ValidationResult(); + } + + @Override + public void buildChildObject(ValidationResult object, QName name, Attributes attributes, XMLReader reader) + throws ObjectBuildException, XMLReadException { + if (!QualityADEModule.NAMESPACE_URI.equals(name.getNamespaceURI())) { + return; + } + switch (name.getLocalPart()) { + case "validationPlanID": + object.setValidationPlanID(reader.getObjectUsingBuilder(ReferenceAdapter.class)); + break; + case "error": + object.getErrors().add(reader.getObjectUsingBuilder(AbstractErrorPropertyAdapter.class)); + break; + case "resultType": + reader.getTextContent().ifPresent(s -> object.setResultType(ResultType.valueOf(s))); + break; + default: + throw new IllegalStateException("Cannot handle name " + name + " when building ValidationResult element"); + } + } + + @Override + public Element createElement(ValidationResult object, Namespaces namespaces) throws ObjectSerializeException { + return Element.of(QualityADEModule.NAMESPACE_URI, "ValidationResult"); + } + + @Override + public void writeChildElements(ValidationResult object, Namespaces namespaces, XMLWriter writer) + throws ObjectSerializeException, XMLWriteException { + if (object.getValidationPlanID() != null) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "validationPlanID"), + object.getValidationPlanID(), ReferenceAdapter.class, namespaces); + } + for (AbstractErrorProperty err : object.getErrors()) { + writer.writeElementUsingSerializer(Element.of(QualityADEModule.NAMESPACE_URI, "error"), err, + AbstractErrorPropertyAdapter.class, namespaces); + } + if (object.getResultType() != null) { + writer.writeElement(Element.of(QualityADEModule.NAMESPACE_URI, "resultType") + .addTextContent(object.getResultType().toString())); + } + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/ZonedDateTimeAdapter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ZonedDateTimeAdapter.java similarity index 71% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/ZonedDateTimeAdapter.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ZonedDateTimeAdapter.java index bf9101cd0aa816982b9f18c1858474de3b8d8fb1..5a66e344a0aaa5b679ce36188caa840c28900a06 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/ZonedDateTimeAdapter.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ZonedDateTimeAdapter.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.marshaller; +package de.hft.stuttgart.quality.adapter.types; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; -import javax.xml.bind.annotation.adapters.XmlAdapter; +public class ZonedDateTimeAdapter { -public class ZonedDateTimeAdapter extends XmlAdapter { - - @Override - public ZonedDateTime unmarshal(String v) throws Exception { + public ZonedDateTime fromString(String v) { try { return ZonedDateTime.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(v)); } catch (Exception e) { @@ -33,11 +30,8 @@ public class ZonedDateTimeAdapter extends XmlAdapter { } } - @Override - public String marshal(ZonedDateTime v) throws Exception { + public String toString(ZonedDateTime v) { return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(v); } - - } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeMarshaller.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeMarshaller.java deleted file mode 100644 index cd0528a760628127453cad9dc063bf21519bfec4..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeMarshaller.java +++ /dev/null @@ -1,412 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.marshaller; - -import java.util.List; -import java.util.concurrent.locks.ReentrantLock; - -import javax.xml.bind.JAXBElement; - -import org.citygml4j.builder.jaxb.marshal.citygml.ade.ADEMarshallerHelper; -import org.citygml4j.model.citygml.ade.binding.ADEMarshaller; -import org.citygml4j.model.citygml.ade.binding.ADEModelObject; -import org.citygml4j.util.mapper.TypeMapper; - -import de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation; -import de.hft.stuttgart.quality.model.AttributeMissing; -import de.hft.stuttgart.quality.model.AttributeWrongValue; -import de.hft.stuttgart.quality.model.ConsecutivePointsSame; -import de.hft.stuttgart.quality.model.Edge; -import de.hft.stuttgart.quality.model.HoleOutside; -import de.hft.stuttgart.quality.model.InnerRingsNested; -import de.hft.stuttgart.quality.model.InteriorDisconnected; -import de.hft.stuttgart.quality.model.IntersectingRings; -import de.hft.stuttgart.quality.model.MultipleConnectedComponents; -import de.hft.stuttgart.quality.model.NonManifoldEdge; -import de.hft.stuttgart.quality.model.NonManifoldVertex; -import de.hft.stuttgart.quality.model.NonPlanarDistancePlane; -import de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation; -import de.hft.stuttgart.quality.model.OrientationRingsSame; -import de.hft.stuttgart.quality.model.PolygonWrongOrientation; -import de.hft.stuttgart.quality.model.RingNotClosed; -import de.hft.stuttgart.quality.model.RingSelfIntersection; -import de.hft.stuttgart.quality.model.SolidNotClosed; -import de.hft.stuttgart.quality.model.SolidSelfIntersection; -import de.hft.stuttgart.quality.model.TooFewPoints; -import de.hft.stuttgart.quality.model.TooFewPolygons; -import de.hft.stuttgart.quality.model.Validation; -import de.hft.stuttgart.quality.model.ValidationError; -import de.hft.stuttgart.quality.model.ValidationResult; -import de.hft.stuttgart.quality.model.jaxb.AllPolygonsWrongOrientationType; -import de.hft.stuttgart.quality.model.jaxb.AttributeMissingType; -import de.hft.stuttgart.quality.model.jaxb.AttributeWrongValueType; -import de.hft.stuttgart.quality.model.jaxb.ConsecutivePointsSameType; -import de.hft.stuttgart.quality.model.jaxb.EdgeType; -import de.hft.stuttgart.quality.model.jaxb.HoleOutsideType; -import de.hft.stuttgart.quality.model.jaxb.InnerRingsNestedType; -import de.hft.stuttgart.quality.model.jaxb.InteriorDisconnectedType; -import de.hft.stuttgart.quality.model.jaxb.IntersectingRingsType; -import de.hft.stuttgart.quality.model.jaxb.MultipleConnectedComponentsType; -import de.hft.stuttgart.quality.model.jaxb.NonManifoldEdgeType; -import de.hft.stuttgart.quality.model.jaxb.NonManifoldVertexType; -import de.hft.stuttgart.quality.model.jaxb.NonPlanarDistancePlaneType; -import de.hft.stuttgart.quality.model.jaxb.NonPlanarNormalsDeviationType; -import de.hft.stuttgart.quality.model.jaxb.ObjectFactory; -import de.hft.stuttgart.quality.model.jaxb.OrientationRingsSameType; -import de.hft.stuttgart.quality.model.jaxb.PolygonWrongOrientationType; -import de.hft.stuttgart.quality.model.jaxb.RingNotClosedType; -import de.hft.stuttgart.quality.model.jaxb.RingSelfIntersectionType; -import de.hft.stuttgart.quality.model.jaxb.SolidNotClosedType; -import de.hft.stuttgart.quality.model.jaxb.SolidSelfIntersectionType; -import de.hft.stuttgart.quality.model.jaxb.TooFewPointsType; -import de.hft.stuttgart.quality.model.jaxb.TooFewPolygonsType; -import de.hft.stuttgart.quality.model.jaxb.ValidationErrorType; -import de.hft.stuttgart.quality.model.jaxb.ValidationResultType; -import de.hft.stuttgart.quality.model.jaxb.ValidationType; - -public class QualityAdeMarshaller implements ADEMarshaller { - - private final ReentrantLock lock = new ReentrantLock(); - private final ObjectFactory factory = new ObjectFactory(); - private TypeMapper> elementMapper; - private TypeMapper typeMapper; - private ADEMarshallerHelper helper; - - private TypeMapper> getElementMapper() { - if (elementMapper == null) { - lock.lock(); - try { - if (elementMapper == null) { - elementMapper = TypeMapper.>create().with(Validation.class, this::createValidation) - .with(ValidationResult.class, this::createValidationResult); - } - } finally { - lock.unlock(); - } - } - - return elementMapper; - } - - private TypeMapper getTypeMapper() { - if (typeMapper == null) { - lock.lock(); - try { - if (typeMapper == null) { - typeMapper = TypeMapper.create().with(Validation.class, this::marshalValidation) - .with(ValidationResult.class, this::marshalValidationResult) - .with(ConsecutivePointsSame.class, this::marshalConsecutivePointsSame) - .with(TooFewPoints.class, this::marshalTooFewPoints) - .with(RingSelfIntersection.class, this::marshalRingSelfIntersection) - .with(RingNotClosed.class, this::marshalRingNotClosed) - .with(InteriorDisconnected.class, this::marshalInteriorDisconnected) - .with(IntersectingRings.class, this::marshalIntersectingRings) - .with(NonPlanarDistancePlane.class, this::marshalNonPlanarDistancePlane) - .with(InnerRingsNested.class, this::marshalInnerRingsNested) - .with(HoleOutside.class, this::marshalHoleOutside) - .with(NonPlanarNormalsDeviation.class, this::marshalNonPlanarNormalsDeviation) - .with(OrientationRingsSame.class, this::marshalOrientationRingsSame) - .with(AllPolygonsWrongOrientation.class, this::marshalAllPolygonsWrongOrientation) - .with(PolygonWrongOrientation.class, this::marshalPolygonWrongOrientation) - .with(SolidSelfIntersection.class, this::marshalSolidSelfIntersection) - .with(NonManifoldVertex.class, this::marshalNonManifoldVertex) - .with(NonManifoldEdge.class, this::marshalNonManifoldEdge) - .with(SolidNotClosed.class, this::marshalSolidNotClosed) - .with(TooFewPolygons.class, this::marshalTooFewPolygons) - .with(MultipleConnectedComponents.class, this::marshalMultipleConnectedComponents) - .with(AttributeWrongValue.class, this::marshalAttributeWrongValue) - .with(AttributeMissing.class, this::marshalAttributeMissing); - } - } finally { - lock.unlock(); - } - } - - return typeMapper; - } - - private ValidationType marshalValidation(Validation src) { - ValidationType dest = new ValidationType(); - - if (src.isSetDateTime()) { - dest.setValidationDate(src.getValidationDate()); - } - - if (src.isSetValidationSoftware()) { - dest.setValidationSoftware(src.getValidationSoftware()); - } - - if (src.isSetValidationPlan()) { - dest.setValidationPlan(src.getValidationPlan()); - } - - if (src.isSetStatistics()) { - dest.setStatistics(src.getStatistics()); - } - - return dest; - } - - private ValidationResultType marshalValidationResult(ValidationResult src) { - ValidationResultType dest = factory.createValidationResultType(); - - dest.setResult(src.getResult()); - - if (src.hasErrors()) { - for (ValidationError err : src.getErrors()) { - dest.getErrors().add(marshalValidationError(err)); - // sort lexicographic, order does not actually matter but xml is restrictive - // that way - // could be solved with xsd v1.1 but jaxb can only process v1.0 - dest.getErrors().sort((e1, e2) -> e1.getName().compareTo(e2.getName())); - } - } - return dest; - } - - private JAXBElement createValidation(Validation src) { - return factory.createValidationType(marshalValidation(src)); - } - - private JAXBElement createValidationResult(ValidationResult src) { - return factory.createValidationResultType(marshalValidationResult(src)); - } - - private ValidationErrorType marshalValidationError(ValidationError err) { - return (ValidationErrorType) marshal(err); - } - - @Override - public void setADEMarshallerHelper(ADEMarshallerHelper helper) { - this.helper = helper; - } - - @Override - public JAXBElement marshalJAXBElement(ADEModelObject src) { - return getElementMapper().apply(src); - } - - @Override - public Object marshal(ADEModelObject src) { - return getTypeMapper().apply(src); - } - - private ConsecutivePointsSameType marshalConsecutivePointsSame(ConsecutivePointsSame src) { - ConsecutivePointsSameType dest = factory.createConsecutivePointsSameType(); - dest.setLinearRingId(src.getLinearRingId()); - if (src.getVertex1() != null) { - dest.setVertex1(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex1())); - } - if (src.getVertex2() != null) { - dest.setVertex2(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex2())); - } - return dest; - } - - private TooFewPointsType marshalTooFewPoints(TooFewPoints src) { - TooFewPointsType dest = factory.createTooFewPointsType(); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private RingSelfIntersectionType marshalRingSelfIntersection(RingSelfIntersection src) { - RingSelfIntersectionType dest = factory.createRingSelfIntersectionType(); - dest.setLinearRingId(src.getLinearRingId()); - dest.setType(src.getType()); - if (src.getEdge1() != null) { - dest.setEdge1(marshalEdge(src.getEdge1())); - } - - if (src.getEdge2() != null) { - dest.setEdge2(marshalEdge(src.getEdge2())); - } - - if (src.getVertex1() != null) { - dest.setVertex1(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex1())); - } - - if (src.getVertex2() != null) { - dest.setVertex2(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex2())); - } - return dest; - } - - private EdgeType marshalEdge(Edge src) { - EdgeType dest = new EdgeType(); - if (src.getFrom() != null) { - dest.setFrom(helper.getGMLMarshaller().marshalDirectPosition(src.getFrom())); - } - - if (src.getTo() != null) { - dest.setTo(helper.getGMLMarshaller().marshalDirectPosition(src.getTo())); - } - return dest; - } - - private RingNotClosedType marshalRingNotClosed(RingNotClosed src) { - RingNotClosedType dest = new RingNotClosedType(); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private InteriorDisconnectedType marshalInteriorDisconnected(InteriorDisconnected src) { - InteriorDisconnectedType dest = new InteriorDisconnectedType(); - dest.setPolygonId(src.getPolygonId()); - return dest; - } - - private IntersectingRingsType marshalIntersectingRings(IntersectingRings src) { - IntersectingRingsType dest = new IntersectingRingsType(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId1(src.getLinearRingId1()); - dest.setLinearRingId2(src.getLinearRingId2()); - return dest; - } - - private NonPlanarDistancePlaneType marshalNonPlanarDistancePlane(NonPlanarDistancePlane src) { - NonPlanarDistancePlaneType dest = new NonPlanarDistancePlaneType(); - dest.setPolygonId(src.getPolygonId()); - if (src.getVertex() != null) { - dest.setVertex(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex())); - } - if (src.getDistance() != null) { - dest.setDistance(helper.getGMLMarshaller().marshalLength(src.getDistance())); - } - return dest; - } - - private InnerRingsNestedType marshalInnerRingsNested(InnerRingsNested src) { - InnerRingsNestedType dest = new InnerRingsNestedType(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId1(src.getLinearRingId1()); - dest.setLinearRingId2(src.getLinearRingId2()); - return dest; - } - - private HoleOutsideType marshalHoleOutside(HoleOutside src) { - HoleOutsideType dest = new HoleOutsideType(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private NonPlanarNormalsDeviationType marshalNonPlanarNormalsDeviation(NonPlanarNormalsDeviation src) { - NonPlanarNormalsDeviationType dest = new NonPlanarNormalsDeviationType(); - dest.setPolygonId(src.getPolygonId()); - if (src.getDeviation() != null) { - dest.setDeviation(helper.getGMLMarshaller().marshalAngle(src.getDeviation())); - } - return dest; - } - - private OrientationRingsSameType marshalOrientationRingsSame(OrientationRingsSame src) { - OrientationRingsSameType dest = new OrientationRingsSameType(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private AllPolygonsWrongOrientationType marshalAllPolygonsWrongOrientation(AllPolygonsWrongOrientation src) { - AllPolygonsWrongOrientationType dest = new AllPolygonsWrongOrientationType(); - dest.setGeometryId(src.getGeometryId()); - return dest; - } - - private PolygonWrongOrientationType marshalPolygonWrongOrientation(PolygonWrongOrientation src) { - PolygonWrongOrientationType dest = new PolygonWrongOrientationType(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (Edge e : src.getEdges()) { - edges.add(marshalEdge(e)); - } - } - return dest; - } - - private SolidSelfIntersectionType marshalSolidSelfIntersection(SolidSelfIntersection src) { - SolidSelfIntersectionType dest = new SolidSelfIntersectionType(); - dest.setGeometryId(src.getGeometryId()); - dest.setPolygonId1(src.getPolygonId1()); - dest.setPolygonId2(src.getPolygonId2()); - return dest; - } - - private NonManifoldVertexType marshalNonManifoldVertex(NonManifoldVertex src) { - NonManifoldVertexType dest = new NonManifoldVertexType(); - dest.setGeometryId(src.getGeometryId()); - if (src.getVertex() != null) { - dest.setVertex(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex())); - } - return dest; - } - - private NonManifoldEdgeType marshalNonManifoldEdge(NonManifoldEdge src) { - NonManifoldEdgeType dest = new NonManifoldEdgeType(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (Edge e : src.getEdges()) { - edges.add(marshalEdge(e)); - } - } - return dest; - } - - private SolidNotClosedType marshalSolidNotClosed(SolidNotClosed src) { - SolidNotClosedType dest = new SolidNotClosedType(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (Edge e : src.getEdges()) { - edges.add(marshalEdge(e)); - } - } - return dest; - } - - private TooFewPolygonsType marshalTooFewPolygons(TooFewPolygons src) { - TooFewPolygonsType dest = new TooFewPolygonsType(); - dest.setGeometryId(src.getGeometryId()); - return dest; - } - - private MultipleConnectedComponentsType marshalMultipleConnectedComponents(MultipleConnectedComponents src) { - MultipleConnectedComponentsType dest = new MultipleConnectedComponentsType(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetComponents()) { - dest.getComponents().addAll(src.getComponents()); - } - return dest; - } - - private AttributeWrongValueType marshalAttributeWrongValue(AttributeWrongValue src) { - AttributeWrongValueType dest = new AttributeWrongValueType(); - dest.setAttributeName(src.getAttributeName()); - dest.setChildId(src.getChildId()); - dest.setGeneric(src.isGeneric()); - return dest; - } - - private AttributeMissingType marshalAttributeMissing(AttributeMissing src) { - AttributeMissingType dest = new AttributeMissingType(); - dest.setAttributeName(src.getAttributeName()); - dest.setChildId(src.getChildId()); - dest.setGeneric(src.isGeneric()); - return dest; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeUnmarshaller.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeUnmarshaller.java deleted file mode 100644 index 21f4148313ba71b0d4eb2c3df3ac58176fdcd6eb..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/marshaller/QualityAdeUnmarshaller.java +++ /dev/null @@ -1,374 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.marshaller; - -import java.util.List; -import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.Collectors; - -import javax.xml.bind.JAXBElement; - -import org.citygml4j.builder.jaxb.unmarshal.citygml.ade.ADEUnmarshallerHelper; -import org.citygml4j.model.citygml.ade.binding.ADEModelObject; -import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller; -import org.citygml4j.util.mapper.CheckedTypeMapper; -import org.citygml4j.xml.io.reader.MissingADESchemaException; - -import de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation; -import de.hft.stuttgart.quality.model.AttributeMissing; -import de.hft.stuttgart.quality.model.AttributeWrongValue; -import de.hft.stuttgart.quality.model.ConsecutivePointsSame; -import de.hft.stuttgart.quality.model.Edge; -import de.hft.stuttgart.quality.model.HoleOutside; -import de.hft.stuttgart.quality.model.InnerRingsNested; -import de.hft.stuttgart.quality.model.InteriorDisconnected; -import de.hft.stuttgart.quality.model.IntersectingRings; -import de.hft.stuttgart.quality.model.MultipleConnectedComponents; -import de.hft.stuttgart.quality.model.NonManifoldEdge; -import de.hft.stuttgart.quality.model.NonManifoldVertex; -import de.hft.stuttgart.quality.model.NonPlanarDistancePlane; -import de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation; -import de.hft.stuttgart.quality.model.OrientationRingsSame; -import de.hft.stuttgart.quality.model.PolygonWrongOrientation; -import de.hft.stuttgart.quality.model.RingNotClosed; -import de.hft.stuttgart.quality.model.RingSelfIntersection; -import de.hft.stuttgart.quality.model.SolidNotClosed; -import de.hft.stuttgart.quality.model.SolidSelfIntersection; -import de.hft.stuttgart.quality.model.TooFewPoints; -import de.hft.stuttgart.quality.model.TooFewPolygons; -import de.hft.stuttgart.quality.model.Validation; -import de.hft.stuttgart.quality.model.ValidationError; -import de.hft.stuttgart.quality.model.ValidationResult; -import de.hft.stuttgart.quality.model.jaxb.AllPolygonsWrongOrientationType; -import de.hft.stuttgart.quality.model.jaxb.AttributeMissingType; -import de.hft.stuttgart.quality.model.jaxb.AttributeWrongValueType; -import de.hft.stuttgart.quality.model.jaxb.ConsecutivePointsSameType; -import de.hft.stuttgart.quality.model.jaxb.EdgeType; -import de.hft.stuttgart.quality.model.jaxb.HoleOutsideType; -import de.hft.stuttgart.quality.model.jaxb.InnerRingsNestedType; -import de.hft.stuttgart.quality.model.jaxb.InteriorDisconnectedType; -import de.hft.stuttgart.quality.model.jaxb.IntersectingRingsType; -import de.hft.stuttgart.quality.model.jaxb.MultipleConnectedComponentsType; -import de.hft.stuttgart.quality.model.jaxb.NonManifoldEdgeType; -import de.hft.stuttgart.quality.model.jaxb.NonManifoldVertexType; -import de.hft.stuttgart.quality.model.jaxb.NonPlanarDistancePlaneType; -import de.hft.stuttgart.quality.model.jaxb.NonPlanarNormalsDeviationType; -import de.hft.stuttgart.quality.model.jaxb.OrientationRingsSameType; -import de.hft.stuttgart.quality.model.jaxb.PolygonWrongOrientationType; -import de.hft.stuttgart.quality.model.jaxb.RingNotClosedType; -import de.hft.stuttgart.quality.model.jaxb.RingSelfIntersectionType; -import de.hft.stuttgart.quality.model.jaxb.SolidNotClosedType; -import de.hft.stuttgart.quality.model.jaxb.SolidSelfIntersectionType; -import de.hft.stuttgart.quality.model.jaxb.TooFewPointsType; -import de.hft.stuttgart.quality.model.jaxb.TooFewPolygonsType; -import de.hft.stuttgart.quality.model.jaxb.ValidationErrorType; -import de.hft.stuttgart.quality.model.jaxb.ValidationResultType; -import de.hft.stuttgart.quality.model.jaxb.ValidationType; -import de.hft.stuttgart.quality.util.UncheckedMissingADESchemaException; - -public class QualityAdeUnmarshaller implements ADEUnmarshaller { - - private final ReentrantLock lock = new ReentrantLock(); - private CheckedTypeMapper typeMapper; - private ADEUnmarshallerHelper helper; - - private CheckedTypeMapper getTypeMapper() { - if (typeMapper == null) { - lock.lock(); - try { - if (typeMapper == null) { - typeMapper = CheckedTypeMapper.create() - .with(ValidationType.class, this::unmarshalValidationType) - .with(ValidationResultType.class, this::umarshalValidationResultType) - .with(ConsecutivePointsSameType.class, this::unmarshalConsecutivePointsSameType) - .with(TooFewPointsType.class, this::unmarshalTooFewPointsType) - .with(RingSelfIntersectionType.class, this::unmarshalRingSelfIntersectionType) - .with(RingNotClosedType.class, this::unmarshalRingNotClosedType) - .with(InteriorDisconnectedType.class, this::unmarshalInteriorDisconnectedType) - .with(IntersectingRingsType.class, this::unmarshalIntersectingRingsType) - .with(NonPlanarDistancePlaneType.class, this::unmarshalNonPlanarDistancePlaneType) - .with(InnerRingsNestedType.class, this::unmarshalInnerRingsType) - .with(HoleOutsideType.class, this::unmarshalHoleOutsideType) - .with(OrientationRingsSameType.class, this::unmarshalOrientationRingsSameType) - .with(NonPlanarNormalsDeviationType.class, this::unmarshalNonPlanarNormalsDeviationType) - .with(AllPolygonsWrongOrientationType.class, this::unmarshalAllPolygonsWrongOrientationType) - .with(PolygonWrongOrientationType.class, this::unmarshalPolygonWrongOrientationType) - .with(SolidSelfIntersectionType.class, this::unmarshalSolidSelfIntersectionType) - .with(NonManifoldVertexType.class, this::unmarshalNonManifoldVertexType) - .with(NonManifoldEdgeType.class, this::unmarshalNonManifoldEdgeType) - .with(SolidNotClosedType.class, this::unmarshalSolidNotClosedType) - .with(TooFewPolygonsType.class, this::unmarshalTooFewPolygonsType) - .with(MultipleConnectedComponentsType.class, this::unmarshalMultipleConnectedComponentsType) - .with(AttributeWrongValueType.class, this::unmarshalAttributeWrongValueType) - .with(AttributeMissingType.class, this::unmarshalAttributeMissingType); - - } - } finally { - lock.unlock(); - } - } - - return typeMapper; - } - - @Override - public void setADEUnmarshallerHelper(ADEUnmarshallerHelper helper) { - this.helper = helper; - } - - @Override - public ADEModelObject unmarshal(JAXBElement src) throws MissingADESchemaException { - return unmarshal(src.getValue()); - } - - @Override - public ADEModelObject unmarshal(Object src) throws MissingADESchemaException { - return getTypeMapper().apply(src); - } - - private Validation unmarshalValidationType(ValidationType src) { - Validation dest = new Validation(); - dest.setValidationDate(src.getValidationDate()); - dest.setValidationSoftware(src.getValidationSoftware()); - dest.setValidationPlan(src.getValidationPlan()); - dest.setStatistics(src.getStatistics()); - return dest; - } - - private ValidationResult umarshalValidationResultType(ValidationResultType src) throws MissingADESchemaException { - ValidationResult dest = new ValidationResult(); - dest.setResult(src.getResult()); - if (src.isSetErrors()) { - try { - dest.getErrors() - .addAll(src.getErrors().stream().map(this::unmarshalError).collect(Collectors.toList())); - } catch (UncheckedMissingADESchemaException e) { - throw e.getCause(); - } - } - return dest; - } - - private ValidationError unmarshalError(ValidationErrorType err) { - try { - return (ValidationError) getTypeMapper().apply(err); - } catch (MissingADESchemaException e) { - throw new UncheckedMissingADESchemaException(e); - } - } - - private ConsecutivePointsSame unmarshalConsecutivePointsSameType(ConsecutivePointsSameType src) { - ConsecutivePointsSame dest = new ConsecutivePointsSame(); - dest.setLinearRingId(src.getLinearRingId()); - dest.setVertex1(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex1())); - dest.setVertex2(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex2())); - return dest; - } - - private TooFewPoints unmarshalTooFewPointsType(TooFewPointsType src) { - TooFewPoints dest = new TooFewPoints(); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private RingSelfIntersection unmarshalRingSelfIntersectionType(RingSelfIntersectionType src) { - RingSelfIntersection dest = new RingSelfIntersection(); - if (src.getEdge1() != null) { - dest.setEdge1(unmarshalEdge(src.getEdge1())); - } - - if (src.getEdge2() != null) { - dest.setEdge2(unmarshalEdge(src.getEdge2())); - } - - dest.setLinearRingId(src.getLinearRingId()); - dest.setType(src.getType()); - - if (src.getVertex1() != null) { - dest.setVertex1(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex1())); - } - - if (src.getVertex2() != null) { - dest.setVertex2(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex2())); - } - return dest; - } - - private RingNotClosed unmarshalRingNotClosedType(RingNotClosedType src) { - RingNotClosed dest = new RingNotClosed(); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private Edge unmarshalEdge(EdgeType src) { - Edge dest = new Edge(); - if (src.getFrom() != null) { - dest.setFrom(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getFrom())); - } - if (src.getTo() != null) { - dest.setTo(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getTo())); - } - return dest; - } - - private InteriorDisconnected unmarshalInteriorDisconnectedType(InteriorDisconnectedType src) { - InteriorDisconnected dest = new InteriorDisconnected(); - dest.setPolygonId(src.getPolygonId()); - return dest; - } - - private IntersectingRings unmarshalIntersectingRingsType(IntersectingRingsType src) { - IntersectingRings dest = new IntersectingRings(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId1(src.getLinearRingId1()); - dest.setLinearRingId2(src.getLinearRingId2()); - return dest; - } - - private InnerRingsNested unmarshalInnerRingsType(InnerRingsNestedType src) { - InnerRingsNested dest = new InnerRingsNested(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId1(src.getLinearRingId1()); - dest.setLinearRingId2(src.getLinearRingId2()); - return dest; - } - - private NonPlanarDistancePlane unmarshalNonPlanarDistancePlaneType(NonPlanarDistancePlaneType src) { - NonPlanarDistancePlane dest = new NonPlanarDistancePlane(); - dest.setPolygonId(src.getPolygonId()); - if (src.getVertex() != null) { - dest.setVertex(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex())); - } - if (src.getDistance() != null) { - dest.setDistance(helper.getGMLUnmarshaller().unmarshalLength(src.getDistance())); - } - return dest; - } - - private HoleOutside unmarshalHoleOutsideType(HoleOutsideType src) { - HoleOutside dest = new HoleOutside(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private NonPlanarNormalsDeviation unmarshalNonPlanarNormalsDeviationType(NonPlanarNormalsDeviationType src) { - NonPlanarNormalsDeviation dest = new NonPlanarNormalsDeviation(); - dest.setPolygonId(src.getPolygonId()); - if (src.getDeviation() != null) { - dest.setDeviation(helper.getGMLUnmarshaller().unmarshalAngle(src.getDeviation())); - } - return dest; - } - - private OrientationRingsSame unmarshalOrientationRingsSameType(OrientationRingsSameType src) { - OrientationRingsSame dest = new OrientationRingsSame(); - dest.setPolygonId(src.getPolygonId()); - dest.setLinearRingId(src.getLinearRingId()); - return dest; - } - - private AllPolygonsWrongOrientation unmarshalAllPolygonsWrongOrientationType(AllPolygonsWrongOrientationType src) { - AllPolygonsWrongOrientation dest = new AllPolygonsWrongOrientation(); - dest.setGeometryId(src.getGeometryId()); - return dest; - } - - private PolygonWrongOrientation unmarshalPolygonWrongOrientationType(PolygonWrongOrientationType src) { - PolygonWrongOrientation dest = new PolygonWrongOrientation(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (EdgeType e : src.getEdges()) { - edges.add(unmarshalEdge(e)); - } - } - return dest; - } - - private SolidSelfIntersection unmarshalSolidSelfIntersectionType(SolidSelfIntersectionType src) { - SolidSelfIntersection dest = new SolidSelfIntersection(); - dest.setGeometryId(src.getGeometryId()); - dest.setPolygonId1(src.getPolygonId1()); - dest.setPolygonId2(src.getPolygonId2()); - return dest; - } - - private NonManifoldVertex unmarshalNonManifoldVertexType(NonManifoldVertexType src) { - NonManifoldVertex dest = new NonManifoldVertex(); - dest.setGeometryId(src.getGeometryId()); - if (src.getVertex() != null) { - dest.setVertex(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex())); - } - return dest; - } - - private NonManifoldEdge unmarshalNonManifoldEdgeType(NonManifoldEdgeType src) { - NonManifoldEdge dest = new NonManifoldEdge(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (EdgeType e : src.getEdges()) { - edges.add(unmarshalEdge(e)); - } - } - return dest; - } - - private SolidNotClosed unmarshalSolidNotClosedType(SolidNotClosedType src) { - SolidNotClosed dest = new SolidNotClosed(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetEdges()) { - List edges = dest.getEdges(); - for (EdgeType e : src.getEdges()) { - edges.add(unmarshalEdge(e)); - } - } - return dest; - } - - private TooFewPolygons unmarshalTooFewPolygonsType(TooFewPolygonsType src) { - TooFewPolygons dest = new TooFewPolygons(); - dest.setGeometryId(src.getGeometryId()); - return dest; - } - - private MultipleConnectedComponents unmarshalMultipleConnectedComponentsType(MultipleConnectedComponentsType src) { - MultipleConnectedComponents dest = new MultipleConnectedComponents(); - dest.setGeometryId(src.getGeometryId()); - if (src.isSetComponents()) { - dest.getComponents().addAll(src.getComponents()); - } - return dest; - } - - private AttributeWrongValue unmarshalAttributeWrongValueType(AttributeWrongValueType src) { - AttributeWrongValue dest = new AttributeWrongValue(); - dest.setAttributeName(src.getAttributeName()); - dest.setChildId(src.getChildId()); - dest.setGeneric(src.isGeneric()); - return dest; - } - - private AttributeMissing unmarshalAttributeMissingType(AttributeMissingType src) { - AttributeMissing dest = new AttributeMissing(); - dest.setAttributeName(src.getAttributeName()); - dest.setChildId(src.getChildId()); - dest.setGeneric(src.isGeneric()); - return dest; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeWrongValue.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeWrongValue.java deleted file mode 100644 index b8815593d489b0275de723801031126f4d85b7cb..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeWrongValue.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import org.citygml4j.builder.copy.CopyBuilder; - -public class AttributeWrongValue extends SemanticError { - - private static final long serialVersionUID = -5650985861847806620L; - - private String childId; - private String attributeName; - private boolean generic; - - public String getChildId() { - return childId; - } - - public void setChildId(String childId) { - this.childId = childId; - } - - public String getAttributeName() { - return attributeName; - } - - public void setAttributeName(String attributeName) { - this.attributeName = attributeName; - } - - public boolean isGeneric() { - return generic; - } - - public void setGeneric(boolean generic) { - this.generic = generic; - } - - @Override - public String toString() { - return "AttributeWrongValue [childId=" + childId + ", attributeName=" + attributeName + ", generic=" + generic - + "]"; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new AttributeWrongValue(), copyBuilder); - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ChildObject.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ChildObject.java deleted file mode 100644 index 39aec6d0c286a30c3526f2c39535f820a7cb9d17..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ChildObject.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.citygml.ade.binding.ADEModelObject; -import org.citygml4j.model.common.base.ModelObject; - -public abstract class ChildObject implements ADEModelObject { - - private static final long serialVersionUID = 6726372382501963276L; - - private ModelObject parent; - - @Override - public Object copyTo(Object target, CopyBuilder copyBuilder) { - return target; - } - - @Override - public ModelObject getParent() { - return parent; - } - - @Override - public void setParent(ModelObject parent) { - this.parent = parent; - } - - @Override - public boolean isSetParent() { - return parent != null; - } - - @Override - public void unsetParent() { - parent = null; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/MultipleConnectedComponents.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/MultipleConnectedComponents.java deleted file mode 100644 index c69d6a165db71bb2c1aff9c41fb27b8375799b3d..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/MultipleConnectedComponents.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import java.util.ArrayList; -import java.util.List; - -import org.citygml4j.builder.copy.CopyBuilder; - -import de.hft.stuttgart.quality.model.jaxb.Component; - -public class MultipleConnectedComponents extends SolidError { - - private static final long serialVersionUID = -4199420154182053060L; - - private List components; - - public boolean isSetComponents() { - return components != null && !components.isEmpty(); - } - - public List getComponents() { - if (components == null) { - components = new ArrayList<>(); - } - return components; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new MultipleConnectedComponents(), copyBuilder); - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/OrientationRingsSame.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/OrientationRingsSame.java deleted file mode 100644 index 16ab55ead3b8e69e39f6f620439c592150f2071f..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/OrientationRingsSame.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import org.citygml4j.builder.copy.CopyBuilder; - -public class OrientationRingsSame extends PolygonError { - - private static final long serialVersionUID = -6983324580253488854L; - - private String linearRingId; - - public void setLinearRingId(String linearRingId) { - this.linearRingId = linearRingId; - } - - public String getLinearRingId() { - return linearRingId; - } - - @Override - public String toString() { - return "OrientationRingsSame [polygonId=" + getPolygonId() + ", linearRingId=" + linearRingId + "]"; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new OrientationRingsSame(), copyBuilder); - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonWrongOrientation.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonWrongOrientation.java deleted file mode 100644 index 965491b5be2379387095650269b0ff213dac1bab..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonWrongOrientation.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import java.util.ArrayList; -import java.util.List; - -import org.citygml4j.builder.copy.CopyBuilder; - -public class PolygonWrongOrientation extends SolidError { - - private static final long serialVersionUID = 1128689472694838648L; - - private List edges; - - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); - } - - public List getEdges() { - if (edges == null) { - edges = new ArrayList<>(); - } - return edges; - } - - @Override - public String toString() { - return "PolygonWrongOrientation [geometryId=" + getGeometryId() + ", edges=" + edges + "]"; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new PolygonWrongOrientation(), copyBuilder); - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingNotClosed.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingNotClosed.java deleted file mode 100644 index 4c52b24e2fadf1912c2290232eaea6032df58110..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingNotClosed.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import org.citygml4j.builder.copy.CopyBuilder; - -public class RingNotClosed extends RingError { - - private static final long serialVersionUID = 5502668444088395535L; - - @Override - public String toString() { - return "RingNotClosed [linearRingId=" + getLinearRingId() + "]"; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new RingNotClosed(), copyBuilder); - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SemanticError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SemanticError.java deleted file mode 100644 index b2741c3cc8dd868a0b5725dc4074f05d241cd69a..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SemanticError.java +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -public abstract class SemanticError extends ValidationError { - - private static final long serialVersionUID = 8986289777859562928L; - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidSelfIntersection.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidSelfIntersection.java deleted file mode 100644 index 423512c6a5910d0c63c5d9c073800f6d6a0adb47..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidSelfIntersection.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import org.citygml4j.builder.copy.CopyBuilder; - -public class SolidSelfIntersection extends SolidError { - - private static final long serialVersionUID = 4086097021438848040L; - - private String polygonId1; - private String polygonId2; - - public String getPolygonId1() { - return polygonId1; - } - - public void setPolygonId1(String polygonId1) { - this.polygonId1 = polygonId1; - } - - public String getPolygonId2() { - return polygonId2; - } - - public void setPolygonId2(String polygonId2) { - this.polygonId2 = polygonId2; - } - - @Override - public String toString() { - return "SolidSelfIntersection [geometryId=" + getGeometryId() + ", polygonId1=" + polygonId1 + ", polygonId2=" - + polygonId2 + "]"; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new SolidSelfIntersection(), copyBuilder); - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Validation.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Validation.java deleted file mode 100644 index 2ee30ba0b6f0e4e9cb90aabf9fb996d27fffd63b..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Validation.java +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import java.time.ZonedDateTime; - -import org.citygml4j.builder.copy.CopyBuilder; - -import de.hft.stuttgart.quality.model.jaxb.Statistics; -import de.hft.stuttgart.quality.model.jaxb.ValidationPlan; - -public class Validation extends ChildObject { - - private static final long serialVersionUID = 1738293574859506005L; - - private ZonedDateTime validationDate; - private String validationSoftware; - private ValidationPlan validationPlan; - private Statistics statistics; - - @Override - public Object copy(CopyBuilder copyBuilder) { - return this; - } - - public boolean isSetStatistics() { - return statistics != null; - } - - public void setStatistics(Statistics statistics) { - this.statistics = statistics; - } - - public Statistics getStatistics() { - return statistics; - } - - public boolean isSetValidationPlan() { - return validationPlan != null; - } - - public void setValidationPlan(ValidationPlan validationPlan) { - this.validationPlan = validationPlan; - } - - public ValidationPlan getValidationPlan() { - return validationPlan; - } - - public boolean isSetDateTime() { - return validationDate != null; - } - - public boolean isSetValidationSoftware() { - return validationSoftware != null; - } - - public void setValidationDate(ZonedDateTime validationDate) { - this.validationDate = validationDate; - } - - public ZonedDateTime getValidationDate() { - return validationDate; - } - - public void setValidationSoftware(String validationSoftware) { - this.validationSoftware = validationSoftware; - } - - public String getValidationSoftware() { - return validationSoftware; - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationResult.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationResult.java deleted file mode 100644 index f9c6780b9de9a28bc43c980f59de2a48bf2a11a3..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ValidationResult.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model; - -import java.util.ArrayList; -import java.util.List; - -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.citygml.ade.binding.ADEModelObject; -import org.citygml4j.model.common.visitor.FeatureFunctor; -import org.citygml4j.model.common.visitor.FeatureVisitor; -import org.citygml4j.model.common.visitor.GMLFunctor; -import org.citygml4j.model.common.visitor.GMLVisitor; -import org.citygml4j.model.gml.feature.AbstractFeature; - -import de.hft.stuttgart.quality.model.jaxb.ResultType; - -public class ValidationResult extends AbstractFeature implements ADEModelObject { - - private static final long serialVersionUID = 1180762313908627342L; - - private ResultType result; - - private List errors; - - public boolean hasErrors() { - return errors != null && !errors.isEmpty(); - } - - public List getErrors() { - if (errors == null) { - errors = new ArrayList<>(2); - } - return errors; - } - - public void setResult(ResultType result) { - this.result = result; - } - - public ResultType getResult() { - return result; - } - - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new ValidationResult(), copyBuilder); - } - - @Override - public void accept(FeatureVisitor visitor) { - visitor.visit(this); - } - - @Override - public T accept(FeatureFunctor visitor) { - return visitor.apply(this); - } - - @Override - public void accept(GMLVisitor visitor) { - visitor.visit(this); - } - - @Override - public T accept(GMLFunctor visitor) { - return visitor.apply(this); - } - - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorId.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ErrorId.java similarity index 88% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorId.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ErrorId.java index cb34d11c8af741170f2d89224cee993d8a4cebcd..3154031a58c8ce072b2a036120dd3f271130b2cd 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorId.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ErrorId.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.enums; -import javax.xml.bind.annotation.XmlEnum; - -@XmlEnum public enum ErrorId { GE_R_TOO_FEW_POINTS, GE_R_NOT_CLOSED, GE_R_CONSECUTIVE_POINTS_SAME, GE_R_SELF_INTERSECTION, diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RequirementId.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RequirementId.java similarity index 88% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RequirementId.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RequirementId.java index 851382c29b104f65c000aed4b4a0c5fc806150a2..19a065b8ca0f1395b6d4337fc6510a5214b349cd 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RequirementId.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RequirementId.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.enums; -import javax.xml.bind.annotation.XmlEnum; -@XmlEnum public enum RequirementId { R_GE_R_TOO_FEW_POINTS, R_GE_R_NOT_CLOSED, R_GE_R_CONSECUTIVE_POINTS_SAME, R_GE_R_SELF_INTERSECTION, diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ResultType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ResultType.java similarity index 80% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ResultType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ResultType.java index 70db92cc86dbf718883e15b2158e42cf63562a7c..a35c3164e3f21e241c0da50e584df282ab5280b4 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ResultType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/ResultType.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.enums; -import javax.xml.bind.annotation.XmlEnum; - -@XmlEnum public enum ResultType { OK, ERROR, NOT_CHECKED diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RingSelfIntType.java similarity index 74% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RingSelfIntType.java index 582bcc0c067e7d96bd235e4b8958a5ee930ca0bb..e544927720bf0bb9be40f9facca3791c20cd88d2 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/RingSelfIntType.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.enums; -import javax.xml.bind.annotation.XmlEnum; - -@XmlEnum public enum RingSelfIntType { - DUPLICATE_POINT, POINT_TOUCHES_EDGE, EDGE_INTERSECTS_EDGE + EDGE_INTERSECTION, VERTEX_TOUCHES_EDGE, DUPLICATE_POINT, DEGENERATED_RING } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TopLevelFeatureType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/TopLevelFeatureType.java similarity index 81% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TopLevelFeatureType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/TopLevelFeatureType.java index b0fa42feadfdd2ab14aae4173045474b6a63783e..b046b6eb1328f370430a1f84ca66b6b2b0abe394 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TopLevelFeatureType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/enums/TopLevelFeatureType.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.enums; -import javax.xml.bind.annotation.XmlEnum; - -@XmlEnum public enum TopLevelFeatureType { BUILDING, TRANSPORTATION, VEGETATION, BRIDGE, WATER, LAND diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AllPolygonsWrongOrientationType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AllPolygonsWrongOrientationType.java deleted file mode 100644 index f582f221a54f4c970bf5b76adea520c74ffb8c7e..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AllPolygonsWrongOrientationType.java +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_ALL_POLYGONS_WRONG_ORIENTATION") -public class AllPolygonsWrongOrientationType extends SolidErrorType { - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeMissingType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeMissingType.java deleted file mode 100644 index ce13091d5f2c4ce991088f9e8c8c54039886fef9..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeMissingType.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "SE_ATTRIBUTE_MISSING") -public class AttributeMissingType extends SemanticErrorType { - - private String childId; - private String attributeName; - private boolean generic; - - public String getChildId() { - return childId; - } - - public void setChildId(String childId) { - this.childId = childId; - } - - public String getAttributeName() { - return attributeName; - } - - public void setAttributeName(String attributeName) { - this.attributeName = attributeName; - } - - public boolean isGeneric() { - return generic; - } - - public void setGeneric(boolean generic) { - this.generic = generic; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Checking.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Checking.java deleted file mode 100644 index 75a9e077864f50da6cb400a57fabe7e8f421136a..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Checking.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlValue; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Checking implements Serializable { - - private static final long serialVersionUID = 8429726429709450505L; - - @XmlValue - private TopLevelFeatureType value; - - public Checking() { - } - - public Checking(TopLevelFeatureType value) { - this.value = value; - } - - public void setValue(TopLevelFeatureType value) { - this.value = value; - } - - public TopLevelFeatureType getValue() { - return value; - } - - @Override - public String toString() { - return "Checking [value=" + value + "]"; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ConsecutivePointsSameType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ConsecutivePointsSameType.java deleted file mode 100644 index 4a584f0c1612709bd7bb030f04a91edabdb83584..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ConsecutivePointsSameType.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -import net.opengis.gml.DirectPositionType; - -@XmlRootElement(name = "GE_R_CONSECUTIVE_POINTS_SAME") -public class ConsecutivePointsSameType extends RingErrorType { - - private DirectPositionType vertex1; - private DirectPositionType vertex2; - - public void setVertex1(DirectPositionType vertex1) { - this.vertex1 = vertex1; - } - - public void setVertex2(DirectPositionType vertex2) { - this.vertex2 = vertex2; - } - - public DirectPositionType getVertex1() { - return vertex1; - } - - public DirectPositionType getVertex2() { - return vertex2; - } - - @Override - public String toString() { - return "ConsecutivePointsSameType [linearRingId=" + getLinearRingId() + ", vertex1=" + vertex1 + ", vertex2=" + vertex2 - + "]"; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/EdgeType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/EdgeType.java deleted file mode 100644 index 62af6aa37b1710be6d038cbf89e1c02a06f83b03..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/EdgeType.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; - -import net.opengis.gml.DirectPositionType; - -@XmlAccessorType(XmlAccessType.FIELD) -public class EdgeType { - - private DirectPositionType from; - private DirectPositionType to; - - public void setFrom(DirectPositionType from) { - this.from = from; - } - - public void setTo(DirectPositionType to) { - this.to = to; - } - - public DirectPositionType getFrom() { - return from; - } - - public DirectPositionType getTo() { - return to; - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/HoleOutsideType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/HoleOutsideType.java deleted file mode 100644 index 17d09fcd42b57e81aa43045f7a962e5b61cd8e31..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/HoleOutsideType.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_P_HOLE_OUTSIDE") -public class HoleOutsideType extends PolygonErrorType { - - private String linearRingId; - - public void setLinearRingId(String linearRingId) { - this.linearRingId = linearRingId; - } - - public String getLinearRingId() { - return linearRingId; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InnerRingsNestedType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InnerRingsNestedType.java deleted file mode 100644 index cce7ffe5a8163dce16e2727f41cb4f232841321e..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InnerRingsNestedType.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_P_INNER_RINGS_NESTED") -public class InnerRingsNestedType extends PolygonErrorType { - - private String linearRingId1; - private String linearRingId2; - - public void setLinearRingId1(String linearRingId1) { - this.linearRingId1 = linearRingId1; - } - - public void setLinearRingId2(String linearRingId2) { - this.linearRingId2 = linearRingId2; - } - - public String getLinearRingId1() { - return linearRingId1; - } - - public String getLinearRingId2() { - return linearRingId2; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InteriorDisconnectedType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InteriorDisconnectedType.java deleted file mode 100644 index a8daaf0c305b1f397a5236274dd752016f196039..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/InteriorDisconnectedType.java +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_P_INTERIOR_DISCONNECTED") -public class InteriorDisconnectedType extends PolygonErrorType { - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/IntersectingRingsType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/IntersectingRingsType.java deleted file mode 100644 index 7f47eef519d77e2d9938160a5a1e9732bad6502f..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/IntersectingRingsType.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_P_INTERSECTING_RINGS") -public class IntersectingRingsType extends PolygonErrorType { - - private String linearRingId1; - private String linearRingId2; - - public void setLinearRingId1(String linearRingId1) { - this.linearRingId1 = linearRingId1; - } - - public String getLinearRingId1() { - return linearRingId1; - } - - public void setLinearRingId2(String linearRingId2) { - this.linearRingId2 = linearRingId2; - } - - public String getLinearRingId2() { - return linearRingId2; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/MultipleConnectedComponentsType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/MultipleConnectedComponentsType.java deleted file mode 100644 index 0507eb04aa021306b9c2756c906de508850b730c..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/MultipleConnectedComponentsType.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_MULTIPLE_CONNECTED_COMPONENTS") -public class MultipleConnectedComponentsType extends SolidErrorType { - - @XmlElementWrapper - @XmlElement(name = "component") - private List components; - - public boolean isSetComponents() { - return components != null && !components.isEmpty(); - } - - public List getComponents() { - if (components == null) { - components = new ArrayList<>(); - } - return components; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldEdgeType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldEdgeType.java deleted file mode 100644 index aac1ac8fe9a66c95ab27a81fc51f30e8285e6fc7..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldEdgeType.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_NON_MANIFOLD_EDGE") -public class NonManifoldEdgeType extends SolidErrorType { - - @XmlElementWrapper - @XmlElement(name = "edge") - private List edges; - - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); - } - - public List getEdges() { - if (edges == null) { - edges = new ArrayList<>(); - } - return edges; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldVertexType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldVertexType.java deleted file mode 100644 index 7b8f3a277b86f4e28f128e5eff363f7c04cb274c..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonManifoldVertexType.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -import net.opengis.gml.DirectPositionType; - -@XmlRootElement(name = "GE_S_NON_MANIFOLD_VERTEX") -public class NonManifoldVertexType extends SolidErrorType { - - private DirectPositionType vertex; - - public void setVertex(DirectPositionType vertex) { - this.vertex = vertex; - } - - public DirectPositionType getVertex() { - return vertex; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarDistancePlaneType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarDistancePlaneType.java deleted file mode 100644 index 4e3523b7385bda889276a616382a2cfd4808f1f2..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarDistancePlaneType.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -import net.opengis.gml.DirectPositionType; -import net.opengis.gml.LengthType; - -@XmlRootElement(name = "GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE") -public class NonPlanarDistancePlaneType extends PolygonErrorType { - - private DirectPositionType vertex; - private LengthType distance; - - public void setVertex(DirectPositionType vertex) { - this.vertex = vertex; - } - - public void setDistance(LengthType distance) { - this.distance = distance; - } - - public DirectPositionType getVertex() { - return vertex; - } - - public LengthType getDistance() { - return distance; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarNormalsDeviationType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarNormalsDeviationType.java deleted file mode 100644 index 5471ad6b9a6d68c29bdc42ae0bc2bb18a5dba15c..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/NonPlanarNormalsDeviationType.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -import net.opengis.gml.AngleType; - -@XmlRootElement(name = "GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION") -public class NonPlanarNormalsDeviationType extends PolygonErrorType { - - private AngleType deviation; - - public void setDeviation(AngleType deviation) { - this.deviation = deviation; - } - - public AngleType getDeviation() { - return deviation; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ObjectFactory.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ObjectFactory.java deleted file mode 100644 index 987b4e48fa5d6226e191ffb8db02fc1765847796..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ObjectFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - -import de.hft.stuttgart.quality.QualityADEModule; - -@XmlRegistry -public class ObjectFactory { - - private static final QName VALIDATION_QNAME = new QName(QualityADEModule.NAMESPACE_URI, "validation"); - private static final QName VALIDATION_RESULT_QNAME = new QName(QualityADEModule.NAMESPACE_URI, "validationResult"); - - public ValidationType createValidationType() { - return new ValidationType(); - } - - public ValidationResultType createValidationResultType() { - return new ValidationResultType(); - } - - public ConsecutivePointsSameType createConsecutivePointsSameType() { - return new ConsecutivePointsSameType(); - } - - public TooFewPointsType createTooFewPointsType() { - return new TooFewPointsType(); - } - - @XmlElementDecl(namespace = QualityADEModule.NAMESPACE_URI, name = "validation", substitutionHeadNamespace = "http://www.opengis.net/citygml/2.0", substitutionHeadName = "_GenericApplicationPropertyOfCityModel") - public JAXBElement createValidationType(ValidationType type) { - return new JAXBElement<>(VALIDATION_QNAME, ValidationType.class, type); - } - - @XmlElementDecl(namespace = QualityADEModule.NAMESPACE_URI, name = "validationResult", substitutionHeadNamespace = "http://www.opengis.net/citygml/2.0", substitutionHeadName = "_GenericApplicationPropertyOfCityObject") - public JAXBElement createValidationResultType(ValidationResultType type) { - return new JAXBElement<>(VALIDATION_RESULT_QNAME, ValidationResultType.class, type); - } - - public RingSelfIntersectionType createRingSelfIntersectionType() { - return new RingSelfIntersectionType(); - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonErrorType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonErrorType.java deleted file mode 100644 index aec3160863ce571da00ad381232bbf062db5e664..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonErrorType.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso({ InteriorDisconnectedType.class, IntersectingRingsType.class, HoleOutsideType.class, - InnerRingsNestedType.class, NonPlanarDistancePlaneType.class, NonPlanarNormalsDeviationType.class, - OrientationRingsSameType.class }) - -@XmlRootElement(name = "PolygonError") -public class PolygonErrorType extends ValidationErrorType { - - private String polygonId; - - public void setPolygonId(String polygonId) { - this.polygonId = polygonId; - } - - public String getPolygonId() { - return polygonId; - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonWrongOrientationType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonWrongOrientationType.java deleted file mode 100644 index 7cd6358290b1b0305ef903f97d0f9ac432546a67..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/PolygonWrongOrientationType.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_POLYGON_WRONG_ORIENTATION") -public class PolygonWrongOrientationType extends SolidErrorType { - - @XmlElementWrapper - @XmlElement(name = "edge") - private List edges; - - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); - } - - public List getEdges() { - if (edges == null) { - edges = new ArrayList<>(); - } - return edges; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Requirement.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Requirement.java deleted file mode 100644 index c3a2146e6526fb046896b866de3f1c161468cd89..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Requirement.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name = "requirement") -@XmlAccessorType(XmlAccessType.FIELD) -public class Requirement implements Serializable { - - private static final long serialVersionUID = 8493047783215253763L; - - @XmlAttribute - private RequirementId name; - - @XmlAttribute - private boolean enabled; - - @XmlElement(name = "parameter") - private List parameters; - - public RequirementId getName() { - return name; - } - - public List getParameters() { - if (parameters == null) { - parameters = new ArrayList<>(2); - } - return parameters; - } - - public boolean isEnabled() { - return enabled; - } - - public void setName(RequirementId name) { - this.name = name; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - @Override - public String toString() { - return "Requirement [name=" + name + ", enabled=" + enabled + ", parameters=" + parameters + "]"; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingErrorType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingErrorType.java deleted file mode 100644 index 90e7034c6d39a02dfedbeabe663f22fbd8a517c3..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingErrorType.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso({ ConsecutivePointsSameType.class, RingNotClosedType.class, RingSelfIntersectionType.class, - TooFewPointsType.class }) -@XmlRootElement(name = "RingError") -public class RingErrorType extends ValidationErrorType { - - private String linearRingId; - - public String getLinearRingId() { - return linearRingId; - } - - public void setLinearRingId(String linearRingId) { - this.linearRingId = linearRingId; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingNotClosedType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingNotClosedType.java deleted file mode 100644 index e6b9e259a32fac9c22ffcdc8188c77948e4e3157..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingNotClosedType.java +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_R_NOT_CLOSED") -public class RingNotClosedType extends RingErrorType { - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntersectionType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntersectionType.java deleted file mode 100644 index 5e01f5933b5b6d61de7ea4c3295981d0c0165535..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/RingSelfIntersectionType.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -import net.opengis.gml.DirectPositionType; - -@XmlRootElement(name = "GE_R_SELF_INTERSECTION") -public class RingSelfIntersectionType extends RingErrorType { - - private RingSelfIntType type; - private EdgeType edge1; - private EdgeType edge2; - private DirectPositionType vertex1; - private DirectPositionType vertex2; - - public void setType(RingSelfIntType type) { - this.type = type; - } - - public void setEdge1(EdgeType edge1) { - this.edge1 = edge1; - } - - public void setEdge2(EdgeType edge2) { - this.edge2 = edge2; - } - - public void setVertex1(DirectPositionType vertex1) { - this.vertex1 = vertex1; - } - - public void setVertex2(DirectPositionType vertex2) { - this.vertex2 = vertex2; - } - - public RingSelfIntType getType() { - return type; - } - - public EdgeType getEdge1() { - return edge1; - } - - public EdgeType getEdge2() { - return edge2; - } - - public DirectPositionType getVertex1() { - return vertex1; - } - - public DirectPositionType getVertex2() { - return vertex2; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SemanticErrorType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SemanticErrorType.java deleted file mode 100644 index da2e5a530e4a696fcc7864d16abd743554389a5e..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SemanticErrorType.java +++ /dev/null @@ -1,25 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso({ AttributeWrongValueType.class, AttributeMissingType.class }) -@XmlRootElement(name = "SemanticError") -public class SemanticErrorType extends ValidationErrorType { - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidErrorType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidErrorType.java deleted file mode 100644 index ad57862b1f0a54141462549e57d86f0ac78c6f35..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidErrorType.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso({ SolidNotClosedType.class, AllPolygonsWrongOrientationType.class, PolygonWrongOrientationType.class, - NonManifoldVertexType.class, NonManifoldEdgeType.class, TooFewPolygonsType.class, - MultipleConnectedComponentsType.class, SolidSelfIntersectionType.class }) -@XmlRootElement(name = "SolidError") -public class SolidErrorType extends ValidationErrorType { - - private String geometryId; - - public void setGeometryId(String geometryId) { - this.geometryId = geometryId; - } - - public String getGeometryId() { - return geometryId; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidNotClosedType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidNotClosedType.java deleted file mode 100644 index b2f64ddc4481995952adb1d49608734837c22bf9..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidNotClosedType.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_NOT_CLOSED") -public class SolidNotClosedType extends SolidErrorType { - - @XmlElementWrapper - @XmlElement(name = "edge") - private List edges; - - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); - } - - public List getEdges() { - if (edges == null) { - edges = new ArrayList<>(); - } - return edges; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Statistics.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Statistics.java deleted file mode 100644 index a141b601c9a95c56c117d33afa21977d9ca0a793..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Statistics.java +++ /dev/null @@ -1,98 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Statistics implements Serializable { - - private static final long serialVersionUID = 2250094686994310986L; - - private FeatureStatistics numErrorBuildings; - private FeatureStatistics numErrorVegetation; - private FeatureStatistics numErrorLandObjects; - private FeatureStatistics numErrorBridgeObjects; - private FeatureStatistics numErrorWaterObjects; - private FeatureStatistics numErrorTransportation; - - @XmlElementWrapper(name = "errorStatistics") - @XmlElement(name = "error") - private List errorStatistics; - - public List getErrorStatistics() { - if (errorStatistics == null) { - errorStatistics = new ArrayList<>(); - } - return errorStatistics; - } - - public FeatureStatistics getNumErrorBridgeObjects() { - return numErrorBridgeObjects; - } - - public FeatureStatistics getNumErrorBuildings() { - return numErrorBuildings; - } - - public FeatureStatistics getNumErrorLandObjects() { - return numErrorLandObjects; - } - - public FeatureStatistics getNumErrorTransportation() { - return numErrorTransportation; - } - - public FeatureStatistics getNumErrorVegetation() { - return numErrorVegetation; - } - - public FeatureStatistics getNumErrorWaterObjects() { - return numErrorWaterObjects; - } - - public void setNumErrorBridgeObjects(FeatureStatistics numErrorBridgeObjects) { - this.numErrorBridgeObjects = numErrorBridgeObjects; - } - - public void setNumErrorBuildings(FeatureStatistics numErrorBuildings) { - this.numErrorBuildings = numErrorBuildings; - } - - public void setNumErrorLandObjects(FeatureStatistics numErrorLandObjects) { - this.numErrorLandObjects = numErrorLandObjects; - } - - public void setNumErrorTransportation(FeatureStatistics numErrorTransportation) { - this.numErrorTransportation = numErrorTransportation; - } - - public void setNumErrorVegetation(FeatureStatistics numErrorVegetation) { - this.numErrorVegetation = numErrorVegetation; - } - - public void setNumErrorWaterObjects(FeatureStatistics numErrorWaterObjects) { - this.numErrorWaterObjects = numErrorWaterObjects; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPolygonsType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPolygonsType.java deleted file mode 100644 index 0bac474ebe6f9766353e44ac4dfd0e2f5c590190..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPolygonsType.java +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "GE_S_TOO_FEW_POLYGONS") -public class TooFewPolygonsType extends SolidErrorType { - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationErrorType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationErrorType.java deleted file mode 100644 index 24ca126a93506e3bbc36709a072197cfddc80e10..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationErrorType.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; - -@XmlSeeAlso({ RingErrorType.class, PolygonErrorType.class, SolidErrorType.class, SemanticErrorType.class }) -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "ValidationError") -public abstract class ValidationErrorType { - - @XmlTransient - private String name; - - protected ValidationErrorType() { - name = getClass().getAnnotation(XmlRootElement.class).name(); - } - - public String getName() { - return name; - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationPlan.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationPlan.java deleted file mode 100644 index a947f14f127bcf6a1bac8b4ce231514dd0e7cb62..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationPlan.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlType; - -@XmlType(name = "validationPlan") -@XmlAccessorType(XmlAccessType.FIELD) -public class ValidationPlan implements Serializable { - - private static final long serialVersionUID = 199908444294536261L; - - @XmlElementWrapper(name = "globalParameters") - @XmlElement(name = "parameter") - private List globalParameters; - - @XmlElement(name = "requirement") - private List requirements; - - @XmlElementWrapper(name = "filter") - @XmlElement(name = "checking") - private List filter; - - public List getFilter() { - if (filter == null) { - filter = new ArrayList<>(); - } - return filter; - } - - public List getRequirements() { - if (requirements == null) { - requirements = new ArrayList<>(); - } - return requirements; - } - - public List getGlobalParameters() { - if (globalParameters == null) { - globalParameters = new ArrayList<>(); - } - return globalParameters; - } -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationResultType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationResultType.java deleted file mode 100644 index e1fc8aa63cb4ab7ef9b866e06594358cde133cbc..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationResultType.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package de.hft.stuttgart.quality.model.jaxb; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElementRef; - -import net.opengis.gml.AbstractFeatureType; - -public class ValidationResultType extends AbstractFeatureType { - - @XmlAttribute(name = "result") - private ResultType result; - - @XmlElementRef - private List errors; - - public List getErrors() { - if (errors == null) { - errors = new ArrayList<>(2); - } - return errors; - } - - public void setResult(ResultType result) { - this.result = result; - } - - public ResultType getResult() { - return result; - } - - public boolean isSetErrors() { - return errors != null && !errors.isEmpty(); - } - -} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/package-info.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/package-info.java deleted file mode 100644 index a5e528883a207a8f4ecee41fe1561250baf32fe2..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/*- - * Copyright 2020 Hochschule für Technik Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@javax.xml.bind.annotation.XmlSchema(namespace = "https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, xmlns = { - @javax.xml.bind.annotation.XmlNs(namespaceURI = "https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3", prefix = "qual") }) -package de.hft.stuttgart.quality.model.jaxb; diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..fddacc20482ffbc4ed1b08dca9fe1e35dfc82faf --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractError; + +public class AbstractErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 1411862623125946009L; + + public AbstractErrorProperty() { + super(); + } + + public AbstractErrorProperty(AbstractError ae) { + super(ae); + } + + @Override + public Class getTargetType() { + return AbstractError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractGeometryErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractGeometryErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..152fe5ceb6ab6883514038eb459e6ca2d389acb8 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractGeometryErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractGeometryError; + +public class AbstractGeometryErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 7034671234592671680L; + + public AbstractGeometryErrorProperty() { + super(); + } + + public AbstractGeometryErrorProperty(AbstractGeometryError age) { + super(age); + } + + @Override + public Class getTargetType() { + return AbstractGeometryError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractPolygonErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractPolygonErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..5e55fa6c851742215e21c562d953d3b5a5f54b14 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractPolygonErrorProperty.java @@ -0,0 +1,41 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractPolygonError; + +public class AbstractPolygonErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 70692012962059529L; + + public AbstractPolygonErrorProperty() { + super(); + } + + public AbstractPolygonErrorProperty(AbstractPolygonError ape) { + super(ape); + } + + @Override + public Class getTargetType() { + return AbstractPolygonError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractRingErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractRingErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..6d7fa8185e361bd4141ae1a9ba295c629bc54cfe --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractRingErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractRingError; + +public class AbstractRingErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 6934180997181643185L; + + public AbstractRingErrorProperty() { + super(); + } + + public AbstractRingErrorProperty(AbstractRingError are) { + super(are); + } + + @Override + public Class getTargetType() { + return AbstractRingError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSemanticErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSemanticErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..de05ae87cc2ba8ebad58614dba71b7d56dcfb385 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSemanticErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractSemanticError; + +public class AbstractSemanticErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 8488922114751949334L; + + public AbstractSemanticErrorProperty() { + super(); + } + + public AbstractSemanticErrorProperty(AbstractSemanticError ase) { + super(ase); + } + + @Override + public Class getTargetType() { + return AbstractSemanticError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSolidErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSolidErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..cee12b8c6503d77a0959014498a58004afd951ed --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/AbstractSolidErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.AbstractSolidError; + +public class AbstractSolidErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 4191279461525842687L; + + public AbstractSolidErrorProperty() { + super(); + } + + public AbstractSolidErrorProperty(AbstractSolidError ase) { + super(ase); + } + + @Override + public Class getTargetType() { + return AbstractSolidError.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/CheckingProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/CheckingProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..7512dbe9058caeb02e4a793366d5a090c53f200c --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/CheckingProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Checking; + +public class CheckingProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 2275964563754871682L; + + public CheckingProperty() { + super(); + } + + public CheckingProperty(Checking c) { + super(c); + } + + @Override + public Class getTargetType() { + return Checking.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeListProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeListProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..55733946199899ae00b855c6ffb2b2e61dcd2066 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeListProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.EdgeList; + +public class EdgeListProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 2336457353379630637L; + + public EdgeListProperty() { + super(); + } + + public EdgeListProperty(EdgeList el) { + super(el); + } + + @Override + public Class getTargetType() { + return EdgeList.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/util/UncheckedMissingADESchemaException.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeProperty.java similarity index 52% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/util/UncheckedMissingADESchemaException.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeProperty.java index f710f93e453b449ff57590cadcca0f417687ff87..1eb7302c69b540e156a07e006d1fb93756c11aaa 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/util/UncheckedMissingADESchemaException.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/EdgeProperty.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,24 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.util; +package de.hft.stuttgart.quality.model.properties; -import org.citygml4j.xml.io.reader.MissingADESchemaException; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; -public class UncheckedMissingADESchemaException extends RuntimeException { - - private static final long serialVersionUID = -5684499826072882203L; - - private MissingADESchemaException cause; +import de.hft.stuttgart.quality.model.types.Edge; - public UncheckedMissingADESchemaException(MissingADESchemaException e) { +public class EdgeProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 3087019382945722678L; + + public EdgeProperty() { + super(); + } + + public EdgeProperty(Edge e) { super(e); - this.cause = e; } - + @Override - public synchronized MissingADESchemaException getCause() { - return cause; + public Class getTargetType() { + return Edge.class; } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ErrorProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ErrorProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..0d005f49d61d17a3e8e20db68bafc33a0ff15572 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ErrorProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Error; + +public class ErrorProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 1405693040162674820L; + + public ErrorProperty() { + super(); + } + + public ErrorProperty(Error e) { + super(e); + } + + @Override + public Class getTargetType() { + return Error.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidNotClosed.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FeatureStatisticsProperty.java similarity index 50% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidNotClosed.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FeatureStatisticsProperty.java index 71a9b13521997340c7e9b488cd54f5e7b7eda6b8..8a165dee0a1d65c0ad044c9b215f5df9c3983334 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidNotClosed.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FeatureStatisticsProperty.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,32 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.properties; -import java.util.ArrayList; -import java.util.List; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.types.FeatureStatistics; -public class SolidNotClosed extends SolidError { +public class FeatureStatisticsProperty extends AbstractInlineProperty implements ADEObject { - private static final long serialVersionUID = 4609395125395073697L; + private static final long serialVersionUID = 4725452691563906950L; - private List edges; - - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); + public FeatureStatisticsProperty() { + super(); } - public List getEdges() { - if (edges == null) { - edges = new ArrayList<>(); - } - return edges; + public FeatureStatisticsProperty(FeatureStatistics fs) { + super(fs); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new SolidNotClosed(), copyBuilder); + public Class getTargetType() { + return FeatureStatistics.class; } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FilterProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FilterProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..b3b4630c7e9c68881bfe8d7eeec2acc609752537 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/FilterProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Filter; + +public class FilterProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 2202767186145199981L; + + public FilterProperty() { + super(); + } + + public FilterProperty(Filter f) { + super(f); + } + + @Override + public Class getTargetType() { + return Filter.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/GlobalParametersProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/GlobalParametersProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..3c1e3afc43ea306125bd1aa567dea0fa607481be --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/GlobalParametersProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.GlobalParameters; + +public class GlobalParametersProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 4688667898762529244L; + + public GlobalParametersProperty() { + super(); + } + + public GlobalParametersProperty(GlobalParameters gp) { + super(gp); + } + + @Override + public Class getTargetType() { + return GlobalParameters.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ParameterProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ParameterProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..60fe0a1ff8aa70131249fe6f250133a54c2e61a8 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ParameterProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Parameter; + +public class ParameterProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 3826499653407209573L; + + public ParameterProperty() { + super(); + } + + public ParameterProperty(Parameter p) { + super(p); + } + + @Override + public Class getTargetType() { + return Parameter.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/PolygonIdListProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/PolygonIdListProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..e1a303324d98326275395448e9a7bbdb16ccbac4 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/PolygonIdListProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.PolygonIdList; + +public class PolygonIdListProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 8212792040324739831L; + + public PolygonIdListProperty() { + super(); + } + + public PolygonIdListProperty(PolygonIdList pil) { + super(pil); + } + + @Override + public Class getTargetType() { + return PolygonIdList.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/RequirementProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/RequirementProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..3b54f7f9e8092022a39cd06f80a4d2dd1e06f479 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/RequirementProperty.java @@ -0,0 +1,41 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Requirement; + +public class RequirementProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 1084132873819307011L; + + public RequirementProperty() { + super(); + } + + public RequirementProperty(Requirement r) { + super(r); + } + + @Override + public Class getTargetType() { + return Requirement.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/StatisticsProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/StatisticsProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..5e38899d21312511b25bf48cb7ce3ff6d5af0577 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/StatisticsProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.Statistics; + +public class StatisticsProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 4264016075264322157L; + + public StatisticsProperty() { + super(); + } + + public StatisticsProperty(Statistics s) { + super(s); + } + + @Override + public Class getTargetType() { + return Statistics.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationPlanProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationPlanProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..624a81e3378a159c2e6c0b49395b8f04d6acef16 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationPlanProperty.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineProperty; + +import de.hft.stuttgart.quality.model.types.ValidationPlan; + +public class ValidationPlanProperty extends AbstractInlineProperty implements ADEObject { + + private static final long serialVersionUID = 4542660904311227314L; + + public ValidationPlanProperty() { + super(); + } + + public ValidationPlanProperty(ValidationPlan vp) { + super(vp); + } + + @Override + public Class getTargetType() { + return ValidationPlan.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..8f5a0b64b86308b601ea83fc9ad0cd9342c93297 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationProperty.java @@ -0,0 +1,44 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineOrByReferenceProperty; + +import de.hft.stuttgart.quality.model.types.Validation; + +public class ValidationProperty extends AbstractInlineOrByReferenceProperty implements ADEObject { + + private static final long serialVersionUID = 3423466580266018906L; + + public ValidationProperty() { + super(); + } + + public ValidationProperty(Validation object) { + super(object); + } + + public ValidationProperty(String href) { + super(href); + } + + @Override + public Class getTargetType() { + return Validation.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationResultProperty.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationResultProperty.java new file mode 100644 index 0000000000000000000000000000000000000000..6e1d7918193a670579cf0e5e8026bbd4bf518482 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/properties/ValidationResultProperty.java @@ -0,0 +1,45 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.properties; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.base.AbstractInlineOrByReferenceProperty; + +import de.hft.stuttgart.quality.model.types.ValidationResult; + +public class ValidationResultProperty extends AbstractInlineOrByReferenceProperty + implements ADEObject { + + private static final long serialVersionUID = 480940868730913996L; + + public ValidationResultProperty() { + super(); + } + + public ValidationResultProperty(ValidationResult object) { + super(object); + } + + public ValidationResultProperty(String href) { + super(href); + } + + @Override + public Class getTargetType() { + return ValidationResult.class; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPolygons.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractError.java similarity index 53% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPolygons.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractError.java index 19abc235bc8a9dacf4513b6cd6d8f498d3211688..cb95bcebac6fcce0faeb71472af355f25b382a04 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/TooFewPolygons.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,21 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -public class TooFewPolygons extends SolidError { +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; - private static final long serialVersionUID = -51591095439740599L; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; - @Override - public String toString() { - return "TooFewPolygons [geometryId=" + getGeometryId() + "]"; - } +public abstract class AbstractError extends GMLObject implements ADEObject { - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new TooFewPolygons(), copyBuilder); - } + private static final long serialVersionUID = 4456303926951620441L; + + public void accept(ValidationErrorVisitor visitor) { + visitor.visit(this); + } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractGeometryError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractGeometryError.java new file mode 100644 index 0000000000000000000000000000000000000000..0c6bfe143c5c4f7a6e645a6b8c1cf4f6369fc054 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractGeometryError.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public abstract class AbstractGeometryError extends AbstractError { + + private static final long serialVersionUID = 5584980708521134866L; + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractPolygonError.java similarity index 62% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonError.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractPolygonError.java index 12e9c5eae238e1a222884df32594ab1372f4de11..85ee1ae8e638e62a96ef4024c5548f5e6b135360 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/PolygonError.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractPolygonError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -public abstract class PolygonError extends ValidationError { +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public abstract class AbstractPolygonError extends AbstractGeometryError { + + private static final long serialVersionUID = 8765755615504522764L; - private static final long serialVersionUID = 4694297467768369526L; - private String polygonId; + public String getPolygonId() { + return polygonId; + } + public void setPolygonId(String polygonId) { this.polygonId = polygonId; } - public String getPolygonId() { - return polygonId; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/OrientationRingsSameType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractRingError.java similarity index 64% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/OrientationRingsSameType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractRingError.java index a625724ee85acdbc0001bfc45dbede07a820da75..101f847a7e7deff35a27d242c2e7968f75d100ab 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/OrientationRingsSameType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractRingError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,21 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import javax.xml.bind.annotation.XmlRootElement; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -@XmlRootElement(name = "GE_P_ORIENTATION_RINGS_SAME") -public class OrientationRingsSameType extends PolygonErrorType { +public abstract class AbstractRingError extends AbstractGeometryError { + + private static final long serialVersionUID = 6406932524599157467L; private String linearRingId; + public String getLinearRingId() { + return linearRingId; + } + public void setLinearRingId(String linearRingId) { this.linearRingId = linearRingId; } - public String getLinearRingId() { - return linearRingId; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSemanticError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSemanticError.java new file mode 100644 index 0000000000000000000000000000000000000000..32a9cf8f9434e92c674442854d2dd25d4c442349 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSemanticError.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public abstract class AbstractSemanticError extends AbstractError { + + private static final long serialVersionUID = 3754322190455789991L; + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSolidError.java similarity index 63% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidError.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSolidError.java index d20493c4cfb7d97553a8b140577626d29837bb4b..191d5e2134aab7c4c53b8b9901129cfcabe5e030 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/SolidError.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AbstractSolidError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,18 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public abstract class AbstractSolidError extends AbstractGeometryError { + + private static final long serialVersionUID = 8616094562996823088L; -public abstract class SolidError extends ValidationError { - private static final long serialVersionUID = 6430138970493794998L; - private String geometryId; + public String getGeometryId() { + return geometryId; + } + public void setGeometryId(String geometryId) { this.geometryId = geometryId; } - public String getGeometryId() { - return geometryId; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AllPolygonsOrientedWrongError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AllPolygonsOrientedWrongError.java new file mode 100644 index 0000000000000000000000000000000000000000..fc0f91d41e4a66b85a84ad8f71481c50200160c1 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/AllPolygonsOrientedWrongError.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class AllPolygonsOrientedWrongError extends AbstractSolidError { + + private static final long serialVersionUID = 4295306777217062184L; + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Checking.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Checking.java new file mode 100644 index 0000000000000000000000000000000000000000..e9cb6e2f5532c0ea4845f57c3140364bdaff83f3 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Checking.java @@ -0,0 +1,37 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; + +import de.hft.stuttgart.quality.model.enums.TopLevelFeatureType; + +public class Checking extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 8248598807454312291L; + + private TopLevelFeatureType featureType; + + public TopLevelFeatureType getFeatureType() { + return featureType; + } + + public void setFeatureType(TopLevelFeatureType featureType) { + this.featureType = featureType; + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/CityObjectProperties.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/CityObjectProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..548afc3a2660f55785de2630fb43032cfab18ad9 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/CityObjectProperties.java @@ -0,0 +1,20 @@ +package de.hft.stuttgart.quality.model.types; + +import org.citygml4j.core.model.core.ADEOfAbstractCityObject; + +import de.hft.stuttgart.quality.model.properties.ValidationResultProperty; + +public class CityObjectProperties extends ADEOfAbstractCityObject { + + private static final long serialVersionUID = 1273072314736964714L; + + private ValidationResultProperty validationResult; + + public ValidationResultProperty getValidationResult() { + return validationResult; + } + + public void setValidationResult(ValidationResultProperty validationResult) { + this.validationResult = asChild(validationResult); + } +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ConsecutivePointsSame.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ConsecutivePointsSameError.java similarity index 59% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ConsecutivePointsSame.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ConsecutivePointsSameError.java index 91cb869ba018047a5f6232a27c9f86b7ba6d321d..e71a24f0de786f42a09797d09acc43910276ee31 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/ConsecutivePointsSame.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ConsecutivePointsSameError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,43 +13,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; +import org.xmlobjects.gml.model.geometry.DirectPosition; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class ConsecutivePointsSameError extends AbstractRingError { + + private static final long serialVersionUID = 960107689338308020L; -public class ConsecutivePointsSame extends RingError { - - private static final long serialVersionUID = -838421312521561747L; - private DirectPosition vertex1; private DirectPosition vertex2; - - public void setVertex1(DirectPosition vertex1) { - this.vertex1 = vertex1; - } - - public void setVertex2(DirectPosition vertex2) { - this.vertex2 = vertex2; - } public DirectPosition getVertex1() { return vertex1; } - + + public void setVertex1(DirectPosition vertex1) { + this.vertex1 = asChild(vertex1); + } + public DirectPosition getVertex2() { return vertex2; } + public void setVertex2(DirectPosition vertex2) { + this.vertex2 = asChild(vertex2); + } + @Override - public String toString() { - return "ConsecutivePointsSame [linearRingId=" + getLinearRingId() + ", vertex1=" + vertex1 + ", vertex2=" + vertex2 - + "]"; + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new ConsecutivePointsSame(), copyBuilder); + public String toString() { + return "ConsecutivePointsSameError [vertex1=" + vertex1 + ", vertex2=" + vertex2 + "]"; } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Edge.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Edge.java similarity index 60% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Edge.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Edge.java index d78e694882fe346eac94da0f8ae48fd765e3e7ec..fadd5f63b03ebe41d8285dee990ee7bd501084d5 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/Edge.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Edge.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,33 +13,38 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import java.io.Serializable; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.gml.model.geometry.DirectPosition; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; +public class Edge extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 8021062845313752146L; -public class Edge implements Serializable { - - private static final long serialVersionUID = -5076265818764666094L; - private DirectPosition from; private DirectPosition to; - - public void setFrom(DirectPosition from) { - this.from = from; - } - - public void setTo(DirectPosition to) { - this.to = to; - } - + public DirectPosition getFrom() { return from; } - + + public void setFrom(DirectPosition from) { + this.from = asChild(from); + } + public DirectPosition getTo() { return to; } + public void setTo(DirectPosition to) { + this.to = asChild(to); + } + + @Override + public String toString() { + return "Edge [from=" + from + ", to=" + to + "]"; + } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldEdge.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/EdgeList.java similarity index 51% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldEdge.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/EdgeList.java index 3d07d3111256a064a9de756ffd1870ef891da5c9..a0337bd45a6699ce6fc7cb6ff36e5503e7bbc077 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldEdge.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/EdgeList.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,32 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import java.util.ArrayList; import java.util.List; -import org.citygml4j.builder.copy.CopyBuilder; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; -public class NonManifoldEdge extends SolidError { +import de.hft.stuttgart.quality.model.properties.EdgeProperty; - private static final long serialVersionUID = -4312748985706248178L; +public class EdgeList extends GMLObject implements ADEObject { - private List edges; + private static final long serialVersionUID = 5900643456940461301L; - public boolean isSetEdges() { - return edges != null && !edges.isEmpty(); - } + private List edges; - public List getEdges() { + public List getEdges() { if (edges == null) { - edges = new ArrayList<>(); + edges = new ChildList<>(this); } return edges; } - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new NonPlanarNormalsDeviation(), copyBuilder); + public void setEdges(List edges) { + this.edges = asChild(edges); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorStatistics.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Error.java similarity index 51% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorStatistics.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Error.java index 8b00693904fa0eaa97c7dbf0188770c0edf921d2..b03261e99a843239ffee18950633dc3b49e23916 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ErrorStatistics.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Error.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,45 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import java.io.Serializable; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlValue; +import de.hft.stuttgart.quality.model.enums.ErrorId; -@XmlAccessorType(XmlAccessType.FIELD) -public class ErrorStatistics implements Serializable { - - private static final long serialVersionUID = -1007447539987946146L; +public class Error extends GMLObject implements ADEObject { - @XmlAttribute + private static final long serialVersionUID = 2447962257841143458L; + + private int occurrences; private ErrorId name; - - @XmlValue - private int amount; - - public void setName(ErrorId name) { - this.name = name; + + public int getOccurrences() { + return occurrences; + } + + public void setOccurrences(int occurrences) { + this.occurrences = occurrences; } - + public ErrorId getName() { return name; } - - public void setAmount(int amount) { - this.amount = amount; - } - - public int getAmount() { - return amount; + + public void setName(ErrorId name) { + this.name = name; } @Override public String toString() { - return "ErrorStatistics [name=" + name + ", amount=" + amount + "]"; + return "Error [occurences=" + occurrences + ", name=" + name + "]"; } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/FeatureStatistics.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/FeatureStatistics.java similarity index 61% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/FeatureStatistics.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/FeatureStatistics.java index 3cc3227a54aceae42e7c133b3d1c2f6770705433..ff2e38f504f67efc6382ec80dc6d476cc4e71430 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/FeatureStatistics.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/FeatureStatistics.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,52 +13,41 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import java.io.Serializable; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlValue; +public class FeatureStatistics extends GMLObject implements ADEObject { -@XmlAccessorType(XmlAccessType.FIELD) -public class FeatureStatistics implements Serializable { + private static final long serialVersionUID = 5835765260535725839L; - private static final long serialVersionUID = 5794335930507488398L; - - @XmlAttribute private int numChecked; - - @XmlValue private int numErrors; - + public FeatureStatistics() { + // constructor for serialization } - + public FeatureStatistics(int numChecked, int numErrors) { this.numChecked = numChecked; this.numErrors = numErrors; } - public void setNumChecked(int numChecked) { - this.numChecked = numChecked; - } - - public void setNumErrors(int numErrors) { - this.numErrors = numErrors; - } - public int getNumChecked() { return numChecked; } - + + public void setNumChecked(int numChecked) { + this.numChecked = numChecked; + } + public int getNumErrors() { return numErrors; } - @Override - public String toString() { - return "FeatureStatistics [numChecked=" + numChecked + ", numErrors=" + numErrors + "]"; + public void setNumErrors(int numErrors) { + this.numErrors = numErrors; } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Filter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Filter.java new file mode 100644 index 0000000000000000000000000000000000000000..6575f41e6ce061a4c9aaa5d8204d4112d0f4ed51 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Filter.java @@ -0,0 +1,43 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.properties.CheckingProperty; + +public class Filter extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 2766323821940477659L; + + private List checking; + + public List getChecking() { + if (checking == null) { + checking = new ChildList<>(this); + } + return checking; + } + + public void setChecking(List checking) { + this.checking = asChild(checking); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/GlobalParameters.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/GlobalParameters.java new file mode 100644 index 0000000000000000000000000000000000000000..56e0db5616f8c3aee98b74e4671705f22892fb38 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/GlobalParameters.java @@ -0,0 +1,43 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.properties.ParameterProperty; + +public class GlobalParameters extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 5470016232480954926L; + + private List parameters; + + public List getParameters() { + if (parameters == null) { + parameters = new ChildList<>(this); + } + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = asChild(parameters); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/HoleOutside.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/HoleOutsideError.java similarity index 63% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/HoleOutside.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/HoleOutsideError.java index 4804bb024b25ed1c9859e4fea7ca9e87249ee556..8a82e130d5dbaf8e2b1eab3fc31ae775a9448012 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/HoleOutside.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/HoleOutsideError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,31 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -public class HoleOutside extends PolygonError { +public class HoleOutsideError extends AbstractPolygonError { + + private static final long serialVersionUID = 7823516103018988170L; - private static final long serialVersionUID = -3029497342950689843L; - private String linearRingId; + public String getLinearRingId() { + return linearRingId; + } + public void setLinearRingId(String linearRingId) { this.linearRingId = linearRingId; } - public String getLinearRingId() { - return linearRingId; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override public String toString() { - return "HoleOutside [polygonId=" + getPolygonId() + ", linearRingId=" + linearRingId + "]"; + return "HoleOutsideError [linearRingId=" + linearRingId + "]"; } - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new HoleOutside(), copyBuilder); - } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/IntersectingRings.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InnerRingsNestedError.java similarity index 66% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/IntersectingRings.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InnerRingsNestedError.java index cab11d6863e2f21adb27a9367d1b44f7a3ed1a27..b5cdfe85ebd1a8b02a94f89949b971a5d19ab3f1 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/IntersectingRings.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InnerRingsNestedError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,41 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -public class IntersectingRings extends PolygonError { +public class InnerRingsNestedError extends AbstractPolygonError { + + private static final long serialVersionUID = 6801491749796411678L; - private static final long serialVersionUID = 7668529369582991408L; - private String linearRingId1; private String linearRingId2; + public String getLinearRingId1() { + return linearRingId1; + } + public void setLinearRingId1(String linearRingId1) { this.linearRingId1 = linearRingId1; } - public void setLinearRingId2(String linearRingId2) { - this.linearRingId2 = linearRingId2; + public String getLinearRingId2() { + return linearRingId2; } - public String getLinearRingId1() { - return linearRingId1; + public void setLinearRingId2(String linearRingId2) { + this.linearRingId2 = linearRingId2; } - public String getLinearRingId2() { - return linearRingId2; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override public String toString() { - return "IntersectingRings [polygonId=" + getPolygonId() + ", linearRingId1=" + linearRingId1 + ", linearRingId2=" - + linearRingId2 + "]"; + return "InnerRingsNestedError [linearRingId1=" + linearRingId1 + ", linearRingId2=" + linearRingId2 + "]"; } - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new IntersectingRings(), copyBuilder); - } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InteriorDisconnectedError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InteriorDisconnectedError.java new file mode 100644 index 0000000000000000000000000000000000000000..261d4a6152eb9c6a3a29058183bae988deb39907 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/InteriorDisconnectedError.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class InteriorDisconnectedError extends AbstractPolygonError { + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + + private static final long serialVersionUID = 8270468563578479182L; + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InnerRingsNested.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/IntersectingRingsError.java similarity index 63% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InnerRingsNested.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/IntersectingRingsError.java index b1f886d7fcf62c4f71f5755a7fe577d64dc33c52..8bd213da722046efb03b71efe150d7df0d1c460b 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/InnerRingsNested.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/IntersectingRingsError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,35 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -public class InnerRingsNested extends PolygonError { +public class IntersectingRingsError extends AbstractPolygonError { - private static final long serialVersionUID = 2291087505629924993L; + private static final long serialVersionUID = 4733342962974436966L; private String linearRingId1; private String linearRingId2; + public String getLinearRingId1() { + return linearRingId1; + } + public void setLinearRingId1(String linearRingId1) { this.linearRingId1 = linearRingId1; } - public void setLinearRingId2(String linearRingId2) { - this.linearRingId2 = linearRingId2; + public String getLinearRingId2() { + return linearRingId2; } - public String getLinearRingId1() { - return linearRingId1; + public void setLinearRingId2(String linearRingId2) { + this.linearRingId2 = linearRingId2; } - public String getLinearRingId2() { - return linearRingId2; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new InnerRingsNested(), copyBuilder); + public String toString() { + return "IntersectingRingsError [linearRingId1=" + linearRingId1 + ", linearRingId2=" + linearRingId2 + "]"; } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/MultipleComponentsError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/MultipleComponentsError.java new file mode 100644 index 0000000000000000000000000000000000000000..19f14199a5b7e15897abace85935d3a97cbaa81c --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/MultipleComponentsError.java @@ -0,0 +1,48 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.properties.PolygonIdListProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class MultipleComponentsError extends AbstractSolidError { + + private static final long serialVersionUID = 4322219502819024437L; + + private List components; + + public List getComponents() { + if (components == null) { + components = new ChildList<>(this); + } + return components; + } + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + + public void setComponents(List edges) { + this.components = asChild(edges); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldEdgeError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldEdgeError.java new file mode 100644 index 0000000000000000000000000000000000000000..b926f5a6a33fb2e21c3264bf7357bfc27ac68dd0 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldEdgeError.java @@ -0,0 +1,41 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.properties.EdgeListProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class NonManifoldEdgeError extends AbstractSolidError { + + private static final long serialVersionUID = 3499800929524507025L; + + private EdgeListProperty edges; + + public EdgeListProperty getEdges() { + return edges; + } + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + + public void setEdges(EdgeListProperty edges) { + this.edges = asChild(edges); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldVertex.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldVertexError.java similarity index 55% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldVertex.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldVertexError.java index b1d9b539a62db8f2c4cb86280b97692dff848ad9..c35617cc45b8a5317239bd2ebd0aa262c64dd882 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonManifoldVertex.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/NonManifoldVertexError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,32 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; +import org.xmlobjects.gml.model.geometry.DirectPosition; -public class NonManifoldVertex extends SolidError { +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; - private static final long serialVersionUID = -3434116956866828127L; - - private DirectPosition vertex; +public class NonManifoldVertexError extends AbstractSolidError { - public void setVertex(DirectPosition vertex) { - this.vertex = vertex; - } + private static final long serialVersionUID = 6428627491730618046L; + + private DirectPosition vertex; public DirectPosition getVertex() { return vertex; } - @Override - public String toString() { - return "NonManifoldVertex [geometryId=" + getGeometryId() + ", vertex=" + vertex + "]"; + public void setVertex(DirectPosition vertex) { + this.vertex = asChild(vertex); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new NonManifoldVertex(), copyBuilder); + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/OrientationRingsSameError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/OrientationRingsSameError.java new file mode 100644 index 0000000000000000000000000000000000000000..3b93910f4beaf112829d2aef6d040771959c26dc --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/OrientationRingsSameError.java @@ -0,0 +1,40 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class OrientationRingsSameError extends AbstractPolygonError { + + private static final long serialVersionUID = 5732797947859046889L; + + private String linearRing; + + public String getLinearRing() { + return linearRing; + } + + public void setLinearRing(String linearRing) { + this.linearRing = linearRing; + } + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Parameter.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Parameter.java similarity index 58% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Parameter.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Parameter.java index cb12193ec05223f6d248a2f085abde27d6a3c57e..4156792e5207217bd74ad181386976e03b1aa969 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Parameter.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Parameter.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,58 +13,46 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import java.io.Serializable; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +public class Parameter extends GMLObject implements ADEObject { -@XmlType(name = "parameter") -@XmlAccessorType(XmlAccessType.FIELD) -public class Parameter implements Serializable { + private static final long serialVersionUID = 3493525795867922745L; - private static final long serialVersionUID = 3704749975901280058L; - - @XmlAttribute(name = "name") private String name; - - @XmlAttribute(required = false) private String uom; - - @XmlValue private String value; + public String getName() { + return name; + } + public void setName(String name) { this.name = name; } - public String getName() { - return name; + public String getUom() { + return uom; } public void setUom(String uom) { this.uom = uom; } - public void setValue(String value) { - this.value = value; - } - - public String getUom() { - return uom; - } - public String getValue() { return value; } + public void setValue(String value) { + this.value = value; + } + @Override public String toString() { - return "ParameterType [name=" + name + ", uom=" + uom + ", value=" + value + "]"; + return "Parameter [name=" + name + ", uom=" + uom + ", value=" + value + "]"; } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarDistancePlane.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarDistancePlaneError.java similarity index 57% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarDistancePlane.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarDistancePlaneError.java index fd0292fbc5e762e71c9367bdcead7515c629364e..090acca7fd6111a7b0a389489eca74936b58d64f 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarDistancePlane.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarDistancePlaneError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,43 +13,45 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; -import org.citygml4j.model.gml.measures.Length; +import org.xmlobjects.gml.model.geometry.DirectPosition; +import org.xmlobjects.gml.model.measures.Length; -public class NonPlanarDistancePlane extends PolygonError { +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class PlanarDistancePlaneError extends AbstractPolygonError { + + private static final long serialVersionUID = 9186823395923829178L; - private static final long serialVersionUID = -3428574131554438219L; - private DirectPosition vertex; private Length distance; + public DirectPosition getVertex() { + return vertex; + } public void setVertex(DirectPosition vertex) { - this.vertex = vertex; + this.vertex = asChild(vertex); } - public void setDistance(Length distance) { - this.distance = distance; + public Length getDistance() { + return distance; } - public DirectPosition getVertex() { - return vertex; + public void setDistance(Length distance) { + this.distance = asChild(distance); } - public Length getDistance() { - return distance; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override public String toString() { - return "NonPlanarDistancePlane [polygonId=" + getPolygonId() + ", vertex=" + vertex + ", distance=" + distance + "]"; + return "PlanarDistancePlaneError [vertex=" + vertex + ", distance=" + distance + "]"; } - @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new NonPlanarDistancePlane(), copyBuilder); - } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarNormalsDeviation.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarNormalsDeviationError.java similarity index 54% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarNormalsDeviation.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarNormalsDeviationError.java index faa5a4f11ab035a8b0706cbb9783b2b9cec619f8..dce1c8891e75e76b8138dda588f0320c120e0a8a 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/NonPlanarNormalsDeviation.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PlanarNormalsDeviationError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,32 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.gml.measures.Angle; +import org.xmlobjects.gml.model.measures.Angle; -public class NonPlanarNormalsDeviation extends PolygonError { +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; - private static final long serialVersionUID = -8574024132334399550L; - - private Angle deviation; +public class PlanarNormalsDeviationError extends AbstractPolygonError { - public void setDeviation(Angle deviation) { - this.deviation = deviation; - } + private static final long serialVersionUID = 5914728363336771016L; + + private Angle deviation; public Angle getDeviation() { return deviation; } - @Override - public String toString() { - return "NonPlanarNormalsDeviation [polygonId=" + getPolygonId() + ", deviation=" + deviation + "]"; + public void setDeviation(Angle deviation) { + this.deviation = asChild(deviation); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new NonPlanarNormalsDeviation(), copyBuilder); + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Component.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonIdList.java similarity index 65% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Component.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonIdList.java index f1b220902dc02af373078c9158823815288077e8..a8092b8feaa30eb36394554ae813f2abcd86ede3 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/Component.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonIdList.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,25 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import javax.xml.bind.annotation.XmlElement; +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; -public class Component implements Serializable { +public class PolygonIdList extends GMLObject implements ADEObject { - private static final long serialVersionUID = 75005650370135888L; + private static final long serialVersionUID = 4396447239956257299L; - @XmlElement(name = "polygonId") private List polygonIds; - + public List getPolygonIds() { if (polygonIds == null) { polygonIds = new ArrayList<>(); } return polygonIds; } + + public void setPolygonIds(List polygonIds) { + this.polygonIds = polygonIds; + } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonWrongOrientationError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonWrongOrientationError.java new file mode 100644 index 0000000000000000000000000000000000000000..4033203960276f08468c53e0d3b119d1d9cff5e4 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/PolygonWrongOrientationError.java @@ -0,0 +1,41 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.properties.EdgeListProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class PolygonWrongOrientationError extends AbstractSolidError { + + private static final long serialVersionUID = 4975827693656963892L; + + private EdgeListProperty edges; + + public EdgeListProperty getEdges() { + return edges; + } + + public void setEdges(EdgeListProperty edges) { + this.edges = edges; + } + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Requirement.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Requirement.java new file mode 100644 index 0000000000000000000000000000000000000000..921eb87c9d17cd8ed56ae537ed666b8e53641599 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Requirement.java @@ -0,0 +1,62 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.enums.RequirementId; +import de.hft.stuttgart.quality.model.properties.ParameterProperty; + +public class Requirement extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 4428291416242684642L; + + private boolean enabled; + private RequirementId requirementType; + private List parameters; + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public RequirementId getRequirementType() { + return requirementType; + } + + public void setRequirementType(RequirementId requirementType) { + this.requirementType = requirementType; + } + + public List getParameters() { + if (parameters == null) { + parameters = new ChildList<>(this); + } + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = asChild(parameters); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingNotClosedError.java similarity index 58% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingError.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingNotClosedError.java index d17e5077910c25029d05929979e9f098609e59ab..a45bc0f01a542958d5f53b12d0e8505e181d02a3 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingError.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingNotClosedError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -public abstract class RingError extends ValidationError { - private static final long serialVersionUID = -8610600028811350500L; - - private String linearRingId; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; - public void setLinearRingId(String linearRingId) { - this.linearRingId = linearRingId; +public class RingNotClosedError extends AbstractRingError { + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } - public String getLinearRingId() { - return linearRingId; - } + private static final long serialVersionUID = 3327214274004406000L; + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingSelfIntersection.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingSelfIntersectionError.java similarity index 50% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingSelfIntersection.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingSelfIntersectionError.java index fd11024ea0a336e5573fb1afacf04a75d968dcbe..779008f555277e0081e6c4cad0e22ad58c267628 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/RingSelfIntersection.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingSelfIntersectionError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,71 +13,75 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; -import de.hft.stuttgart.quality.model.jaxb.RingSelfIntType; +import org.xmlobjects.gml.model.geometry.DirectPosition; -public class RingSelfIntersection extends RingError { +import de.hft.stuttgart.quality.model.enums.RingSelfIntType; +import de.hft.stuttgart.quality.model.properties.EdgeProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class RingSelfIntersectionError extends AbstractRingError { + + private static final long serialVersionUID = 9103800366580888883L; - private static final long serialVersionUID = -4426615638983209222L; - private RingSelfIntType type; - private Edge edge1; - private Edge edge2; + private EdgeProperty edge1; + private EdgeProperty edge2; private DirectPosition vertex1; private DirectPosition vertex2; + public RingSelfIntType getType() { + return type; + } + public void setType(RingSelfIntType type) { this.type = type; } - public void setEdge1(Edge edge1) { - this.edge1 = edge1; + public EdgeProperty getEdge1() { + return edge1; } - public void setEdge2(Edge edge2) { - this.edge2 = edge2; + public void setEdge1(EdgeProperty edge1) { + this.edge1 = asChild(edge1); } - public void setVertex1(DirectPosition vertex1) { - this.vertex1 = vertex1; - } - - public void setVertex2(DirectPosition vertex2) { - this.vertex2 = vertex2; + public EdgeProperty getEdge2() { + return edge2; } - public RingSelfIntType getType() { - return type; + public void setEdge2(EdgeProperty edge2) { + this.edge2 = asChild(edge2); } - public Edge getEdge1() { - return edge1; + public DirectPosition getVertex1() { + return vertex1; } - public Edge getEdge2() { - return edge2; + public void setVertex1(DirectPosition vertex1) { + this.vertex1 = asChild(vertex1); } - public DirectPosition getVertex1() { - return vertex1; - } - public DirectPosition getVertex2() { return vertex2; } + public void setVertex2(DirectPosition vertex2) { + this.vertex2 = asChild(vertex2); + } + @Override - public String toString() { - return "RingSelfIntersection [linearRingId=" + getLinearRingId() + ", type=" + type + ", edge1=" + edge1 + ", edge2=" - + edge2 + ", vertex1=" + vertex1 + ", vertex2=" + vertex2 + "]"; + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new RingSelfIntersection(), copyBuilder); + public String toString() { + return "RingSelfIntersectionError [type=" + type + ", edge1=" + edge1 + ", edge2=" + edge2 + ", vertex1=" + + vertex1 + ", vertex2=" + vertex2 + "]"; } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPointsType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingTooFewPointsError.java similarity index 59% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPointsType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingTooFewPointsError.java index b790459367a25644ec613e7b651c17b6470e0186..3940c5437188f7d73485dc79fcc58318c2f1e2fb 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/TooFewPointsType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/RingTooFewPointsError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,16 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import javax.xml.bind.annotation.XmlRootElement; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -@XmlRootElement(name = "GE_R_TOO_FEW_POINTS") -public class TooFewPointsType extends RingErrorType { +public class RingTooFewPointsError extends AbstractRingError { + + private static final long serialVersionUID = 8057350098649982235L; @Override - public String toString() { - return "TooFewPoints [linearRingId=" + getLinearRingId() + "]"; + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeMissing.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeMissingError.java similarity index 72% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeMissing.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeMissingError.java index d3eee9bed63cb30bd106b769eb66035caabd90bb..8d613e73acfdcb94ac84e1664a1a95a5a2229649 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/AttributeMissing.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeMissingError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model; +package de.hft.stuttgart.quality.model.types; -import org.citygml4j.builder.copy.CopyBuilder; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -public class AttributeMissing extends SemanticError { +public class SemanticAttributeMissingError extends AbstractSemanticError { + + private static final long serialVersionUID = 7157884749606290596L; - private static final long serialVersionUID = -5416574100733885169L; - private String childId; private String attributeName; private boolean generic; @@ -50,7 +50,9 @@ public class AttributeMissing extends SemanticError { } @Override - public Object copy(CopyBuilder copyBuilder) { - return copyTo(new AttributeWrongValue(), copyBuilder); + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeWrongValueType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeWrongValueError.java similarity index 71% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeWrongValueType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeWrongValueError.java index a3596b92ee5886aa065df1f5d9bee703e30b0f23..f880417b1d824dea1ec38edfe35a04adb048a929 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/AttributeWrongValueType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SemanticAttributeWrongValueError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import javax.xml.bind.annotation.XmlRootElement; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -@XmlRootElement(name = "SE_ATTRIBUTE_WRONG_VALUE") -public class AttributeWrongValueType extends SemanticErrorType { +public class SemanticAttributeWrongValueError extends AbstractSemanticError { + + private static final long serialVersionUID = 3478578364446339884L; private String childId; private String attributeName; @@ -48,4 +49,10 @@ public class AttributeWrongValueType extends SemanticErrorType { this.generic = generic; } + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidNotClosedError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidNotClosedError.java new file mode 100644 index 0000000000000000000000000000000000000000..c6415ea3aea27ffa7e9bfbe43d22e0e82874131f --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidNotClosedError.java @@ -0,0 +1,41 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.properties.EdgeListProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class SolidNotClosedError extends AbstractSolidError { + + private static final long serialVersionUID = 297029245173578437L; + + private EdgeListProperty edges; + + public EdgeListProperty getEdges() { + return edges; + } + + public void setEdges(EdgeListProperty edges) { + this.edges = asChild(edges); + } + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidSelfIntersectionType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidSelfIntersectionError.java similarity index 68% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidSelfIntersectionType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidSelfIntersectionError.java index 58e37bc4334f62f11b84c902332a51aedb1603cb..46c595ea25e50d71765374991a0ab9a84a267d77 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/SolidSelfIntersectionType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidSelfIntersectionError.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,30 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; -import javax.xml.bind.annotation.XmlRootElement; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; -@XmlRootElement(name = "GE_S_SELF_INTERSECTION") -public class SolidSelfIntersectionType extends SolidErrorType { +public class SolidSelfIntersectionError extends AbstractSolidError { + + private static final long serialVersionUID = 5070991901664859830L; private String polygonId1; private String polygonId2; + public String getPolygonId1() { + return polygonId1; + } + public void setPolygonId1(String polygonId1) { this.polygonId1 = polygonId1; } - public void setPolygonId2(String polygonId2) { - this.polygonId2 = polygonId2; + public String getPolygonId2() { + return polygonId2; } - public String getPolygonId1() { - return polygonId1; + public void setPolygonId2(String polygonId2) { + this.polygonId2 = polygonId2; } - public String getPolygonId2() { - return polygonId2; + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); } } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidTooFewPolygonsError.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidTooFewPolygonsError.java new file mode 100644 index 0000000000000000000000000000000000000000..7dd4bef931224741c1b2dd7a1d49fcf573c8864d --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/SolidTooFewPolygonsError.java @@ -0,0 +1,30 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class SolidTooFewPolygonsError extends AbstractSolidError { + + @Override + public void accept(ValidationErrorVisitor visitor) { + super.accept(visitor); + visitor.visit(this); + } + + private static final long serialVersionUID = 1987841643971824973L; + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Statistics.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Statistics.java new file mode 100644 index 0000000000000000000000000000000000000000..349729e409a03639ed590ad4710e080b1f414ac6 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Statistics.java @@ -0,0 +1,98 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.properties.ErrorProperty; +import de.hft.stuttgart.quality.model.properties.FeatureStatisticsProperty; + +public class Statistics extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 2935590283116950203L; + + private FeatureStatisticsProperty numErrorBuildings; + private FeatureStatisticsProperty numErrorVegetation; + private FeatureStatisticsProperty numErrorLandObjects; + private FeatureStatisticsProperty numErrorBridgeObjects; + private FeatureStatisticsProperty numErrorWaterObjects; + private FeatureStatisticsProperty numErrorTransportation; + private List errors; + + public FeatureStatisticsProperty getNumErrorBuildings() { + return numErrorBuildings; + } + + public void setNumErrorBuildings(FeatureStatisticsProperty numErrorBuildings) { + this.numErrorBuildings = asChild(numErrorBuildings); + } + + public FeatureStatisticsProperty getNumErrorVegetation() { + return numErrorVegetation; + } + + public void setNumErrorVegetation(FeatureStatisticsProperty numErrorVegetation) { + this.numErrorVegetation = asChild(numErrorVegetation); + } + + public FeatureStatisticsProperty getNumErrorLandObjects() { + return numErrorLandObjects; + } + + public void setNumErrorLandObjects(FeatureStatisticsProperty numErrorLandObjects) { + this.numErrorLandObjects = asChild(numErrorLandObjects); + } + + public FeatureStatisticsProperty getNumErrorBridgeObjects() { + return numErrorBridgeObjects; + } + + public void setNumErrorBridgeObjects(FeatureStatisticsProperty numErrorBridgeObjects) { + this.numErrorBridgeObjects = asChild(numErrorBridgeObjects); + } + + public FeatureStatisticsProperty getNumErrorWaterObjects() { + return numErrorWaterObjects; + } + + public void setNumErrorWaterObjects(FeatureStatisticsProperty numErrorWaterObjects) { + this.numErrorWaterObjects = asChild(numErrorWaterObjects); + } + + public FeatureStatisticsProperty getNumErrorTransportation() { + return numErrorTransportation; + } + + public void setNumErrorTransportation(FeatureStatisticsProperty numErrorTransportation) { + this.numErrorTransportation = asChild(numErrorTransportation); + } + + public List getErrors() { + if (errors == null) { + errors = new ChildList<>(this); + } + return errors; + } + + public void setErrors(List errors) { + this.errors = asChild(errors); + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationType.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Validation.java similarity index 55% rename from citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationType.java rename to citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Validation.java index e8ef812dbbfe49ca1e2c7b4376716752ad3de550..2f26c40c470c4211a1d6ffa77ae68344d67e96ba 100644 --- a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/ValidationType.java +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/Validation.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,43 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.hft.stuttgart.quality.model.jaxb; +package de.hft.stuttgart.quality.model.types; import java.time.ZonedDateTime; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.citygml4j.core.model.ade.ADEObject; +import org.citygml4j.core.model.core.AbstractFeature; -import de.hft.stuttgart.quality.marshaller.ZonedDateTimeAdapter; -import net.opengis.gml.AbstractGMLType; +import de.hft.stuttgart.quality.model.properties.StatisticsProperty; +import de.hft.stuttgart.quality.model.properties.ValidationPlanProperty; -@XmlType(name = "validation") -public class ValidationType extends AbstractGMLType { +public class Validation extends AbstractFeature implements ADEObject { - @XmlJavaTypeAdapter(ZonedDateTimeAdapter.class) - private ZonedDateTime validationDate; + private static final long serialVersionUID = 7821104529898548535L; + private ZonedDateTime validationDate; private String validationSoftware; - - private ValidationPlan validationPlan; - - private Statistics statistics; - - public void setStatistics(Statistics statistics) { - this.statistics = statistics; - } - - public Statistics getStatistics() { - return statistics; - } - - public void setValidationPlan(ValidationPlan validationPlan) { - this.validationPlan = validationPlan; - } - - public ValidationPlan getValidationPlan() { - return validationPlan; - } + private StatisticsProperty statistics; + private ValidationPlanProperty validationPlan; public ZonedDateTime getValidationDate() { return validationDate; @@ -67,4 +48,20 @@ public class ValidationType extends AbstractGMLType { this.validationSoftware = validationSoftware; } + public StatisticsProperty getStatistics() { + return statistics; + } + + public void setStatistics(StatisticsProperty statistics) { + this.statistics = asChild(statistics); + } + + public ValidationPlanProperty getValidationPlan() { + return validationPlan; + } + + public void setValidationPlan(ValidationPlanProperty validationPlan) { + this.validationPlan = asChild(validationPlan); + } + } diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationPlan.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationPlan.java new file mode 100644 index 0000000000000000000000000000000000000000..3310549cc79f5a6bf767e38518a1142e48c4879b --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationPlan.java @@ -0,0 +1,64 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.properties.FilterProperty; +import de.hft.stuttgart.quality.model.properties.GlobalParametersProperty; +import de.hft.stuttgart.quality.model.properties.RequirementProperty; + +public class ValidationPlan extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 434443226848485642L; + + private GlobalParametersProperty globalParameters; + private FilterProperty filter; + private List requirement; + + public GlobalParametersProperty getGlobalParameters() { + return globalParameters; + } + + public void setGlobalParameters(GlobalParametersProperty globalParameters) { + this.globalParameters = asChild(globalParameters); + } + + public FilterProperty getFilter() { + return filter; + } + + public void setFilter(FilterProperty filter) { + this.filter = asChild(filter); + } + + public List getRequirements() { + if (requirement == null) { + requirement = new ChildList<>(this); + } + return requirement; + } + + public void setRequirements(List requirement) { + this.requirement = asChild(requirement); + } + + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationResult.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationResult.java new file mode 100644 index 0000000000000000000000000000000000000000..8f0446ccec1c45821021290c28c725ccd19c85e0 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/types/ValidationResult.java @@ -0,0 +1,73 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.types; + +import java.util.List; + +import org.citygml4j.core.model.ade.ADEObject; +import org.xmlobjects.gml.model.GMLObject; +import org.xmlobjects.gml.model.base.Reference; +import org.xmlobjects.model.ChildList; + +import de.hft.stuttgart.quality.model.enums.ResultType; +import de.hft.stuttgart.quality.model.properties.AbstractErrorProperty; +import de.hft.stuttgart.quality.model.walker.ValidationErrorVisitor; + +public class ValidationResult extends GMLObject implements ADEObject { + + private static final long serialVersionUID = 4867627296196445082L; + + private Reference validationPlanID; + private List errors; + private ResultType resultType; + + public Reference getValidationPlanID() { + return validationPlanID; + } + + public void setValidationPlanID(Reference validationPlanID) { + this.validationPlanID = asChild(validationPlanID); + } + + public List getErrors() { + if (errors == null) { + errors = new ChildList<>(this); + } + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + public ResultType getResultType() { + return resultType; + } + + public void setResultType(ResultType resultType) { + this.resultType = resultType; + } + + public void accept(ValidationErrorVisitor visitor) { + for (AbstractErrorProperty errorProp : errors) { + if (errorProp.getObject() == null) { + continue; + } + errorProp.getObject().accept(visitor); + } + } + +} diff --git a/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/walker/ValidationErrorVisitor.java b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/walker/ValidationErrorVisitor.java new file mode 100644 index 0000000000000000000000000000000000000000..e125575a78f1b0977dd5d526c7a69aa7b4ed3d18 --- /dev/null +++ b/citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/walker/ValidationErrorVisitor.java @@ -0,0 +1,156 @@ +/*- + * Copyright 2022 Hochschule für Technik Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.hft.stuttgart.quality.model.walker; + +import de.hft.stuttgart.quality.model.types.AbstractError; +import de.hft.stuttgart.quality.model.types.AbstractGeometryError; +import de.hft.stuttgart.quality.model.types.AbstractPolygonError; +import de.hft.stuttgart.quality.model.types.AbstractRingError; +import de.hft.stuttgart.quality.model.types.AbstractSemanticError; +import de.hft.stuttgart.quality.model.types.AbstractSolidError; +import de.hft.stuttgart.quality.model.types.AllPolygonsOrientedWrongError; +import de.hft.stuttgart.quality.model.types.ConsecutivePointsSameError; +import de.hft.stuttgart.quality.model.types.HoleOutsideError; +import de.hft.stuttgart.quality.model.types.InnerRingsNestedError; +import de.hft.stuttgart.quality.model.types.InteriorDisconnectedError; +import de.hft.stuttgart.quality.model.types.IntersectingRingsError; +import de.hft.stuttgart.quality.model.types.MultipleComponentsError; +import de.hft.stuttgart.quality.model.types.NonManifoldEdgeError; +import de.hft.stuttgart.quality.model.types.NonManifoldVertexError; +import de.hft.stuttgart.quality.model.types.OrientationRingsSameError; +import de.hft.stuttgart.quality.model.types.PlanarDistancePlaneError; +import de.hft.stuttgart.quality.model.types.PlanarNormalsDeviationError; +import de.hft.stuttgart.quality.model.types.PolygonWrongOrientationError; +import de.hft.stuttgart.quality.model.types.RingNotClosedError; +import de.hft.stuttgart.quality.model.types.RingSelfIntersectionError; +import de.hft.stuttgart.quality.model.types.RingTooFewPointsError; +import de.hft.stuttgart.quality.model.types.SemanticAttributeMissingError; +import de.hft.stuttgart.quality.model.types.SemanticAttributeWrongValueError; +import de.hft.stuttgart.quality.model.types.SolidNotClosedError; +import de.hft.stuttgart.quality.model.types.SolidSelfIntersectionError; +import de.hft.stuttgart.quality.model.types.SolidTooFewPolygonsError; + +public interface ValidationErrorVisitor { + + default void visit(AbstractError err) { + + } + + default void visit(AbstractGeometryError err) { + + } + + default void visit(AbstractPolygonError err) { + + } + + default void visit(AbstractRingError err) { + + } + + default void visit(AbstractSemanticError err) { + + } + + default void visit(AbstractSolidError err) { + + } + + default void visit(AllPolygonsOrientedWrongError err) { + + } + + default void visit(ConsecutivePointsSameError err) { + + } + + default void visit(HoleOutsideError err) { + + } + + default void visit(InnerRingsNestedError err) { + + } + + default void visit(IntersectingRingsError err) { + + } + + default void visit(InteriorDisconnectedError err) { + + } + + default void visit(MultipleComponentsError err) { + + } + + default void visit(NonManifoldEdgeError err) { + + } + + default void visit(NonManifoldVertexError err) { + + } + + default void visit(OrientationRingsSameError err) { + + } + + default void visit(PlanarDistancePlaneError err) { + + } + + default void visit(PlanarNormalsDeviationError err) { + + } + + default void visit(PolygonWrongOrientationError err) { + + } + + default void visit(RingNotClosedError err) { + + } + + default void visit(RingSelfIntersectionError err) { + + } + + default void visit(RingTooFewPointsError err) { + + } + + default void visit(SemanticAttributeMissingError err) { + + } + + default void visit(SemanticAttributeWrongValueError err) { + + } + + default void visit(SolidNotClosedError err) { + + } + + default void visit(SolidSelfIntersectionError err) { + + } + + default void visit(SolidTooFewPolygonsError err) { + + } + +} diff --git a/citygml4j-quality-ade/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext b/citygml4j-quality-ade/src/main/resources/META-INF/services/org.citygml4j.core.ade.ADE similarity index 100% rename from citygml4j-quality-ade/src/main/resources/META-INF/services/org.citygml4j.model.citygml.ade.binding.ADEContext rename to citygml4j-quality-ade/src/main/resources/META-INF/services/org.citygml4j.core.ade.ADE diff --git a/citygml4j-quality-ade/src/main/resources/qualityAde.xsd b/citygml4j-quality-ade/src/main/resources/qualityAde.xsd index 2ed1ec60d92f08b45d86f0470e23b600441acd86..0362e46c4c05e506b0bcfa717c2e7737306e4c26 100644 --- a/citygml4j-quality-ade/src/main/resources/qualityAde.xsd +++ b/citygml4j-quality-ade/src/main/resources/qualityAde.xsd @@ -1,584 +1,658 @@ - - - - - - - - - - - - - Enumeration for status of check result - - - - - One or more errors were found - - - - - Feature was not checked - - - - - No errors were found - - - - - - - - - - - - - - - - - - - - - Consecutive point are the same - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A planarity error with a point too far from the - regression plane - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Data structure containing validation results for - features - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Enumeration for available requirements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Requirement structure for configuration purposes - - - - - - - - - - - - Validation plan structure containing information about - the parameters used to perform the checks - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Statistics structure containing information about end - result of checking process - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Data structure containing the validation plan and - statistics of a validation process - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/citygml4j-quality-ade/src/test/java/de/hft/stuttgart/quality/QualityAdeTests.java b/citygml4j-quality-ade/src/test/java/de/hft/stuttgart/quality/QualityAdeTests.java index 1eff2866148f92db5f4fedf0d1da531dbb082b96..51696a95cdbf0406b43a5846ddc1fb5ceab9d7a2 100644 --- a/citygml4j-quality-ade/src/test/java/de/hft/stuttgart/quality/QualityAdeTests.java +++ b/citygml4j-quality-ade/src/test/java/de/hft/stuttgart/quality/QualityAdeTests.java @@ -1,5 +1,5 @@ /*- - * Copyright 2020 Hochschule für Technik Stuttgart + * Copyright 2022 Hochschule für Technik Stuttgart * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,1395 +15,588 @@ */ package de.hft.stuttgart.quality; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; -import java.time.LocalDateTime; -import java.time.ZoneId; +import java.nio.charset.StandardCharsets; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.List; -import java.util.ServiceLoader; - -import org.citygml4j.CityGMLContext; -import org.citygml4j.builder.jaxb.CityGMLBuilder; -import org.citygml4j.builder.jaxb.CityGMLBuilderException; -import org.citygml4j.model.citygml.ade.ADEComponent; -import org.citygml4j.model.citygml.ade.ADEException; -import org.citygml4j.model.citygml.ade.binding.ADEContext; -import org.citygml4j.model.citygml.building.Building; -import org.citygml4j.model.citygml.core.AbstractCityObject; -import org.citygml4j.model.citygml.core.CityModel; -import org.citygml4j.model.citygml.core.CityObjectMember; -import org.citygml4j.model.gml.geometry.primitives.DirectPosition; -import org.citygml4j.model.gml.measures.Angle; -import org.citygml4j.model.gml.measures.Length; -import org.citygml4j.model.module.citygml.CityGMLVersion; -import org.citygml4j.xml.io.CityGMLInputFactory; -import org.citygml4j.xml.io.CityGMLOutputFactory; -import org.citygml4j.xml.io.reader.CityGMLReadException; -import org.citygml4j.xml.io.reader.CityGMLReader; -import org.citygml4j.xml.io.reader.FeatureReadMode; -import org.citygml4j.xml.io.writer.CityGMLWriteException; -import org.citygml4j.xml.io.writer.CityGMLWriter; +import java.util.Locale; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.citygml4j.core.ade.ADEException; +import org.citygml4j.core.ade.ADERegistry; +import org.citygml4j.core.model.CityGMLVersion; +import org.citygml4j.core.model.building.Building; +import org.citygml4j.core.model.core.AbstractCityObjectProperty; +import org.citygml4j.core.model.core.AbstractFeatureProperty; +import org.citygml4j.core.model.core.CityModel; +import org.citygml4j.core.util.CityGMLConstants; +import org.citygml4j.xml.CityGMLContext; +import org.citygml4j.xml.CityGMLContextException; +import org.citygml4j.xml.module.citygml.CoreModule; +import org.citygml4j.xml.schema.CityGMLSchemaHandler; +import org.citygml4j.xml.writer.CityGMLOutputFactory; +import org.citygml4j.xml.writer.CityGMLWriteException; +import org.citygml4j.xml.writer.CityGMLWriter; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; - -import de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation; -import de.hft.stuttgart.quality.model.AttributeMissing; -import de.hft.stuttgart.quality.model.AttributeWrongValue; -import de.hft.stuttgart.quality.model.ConsecutivePointsSame; -import de.hft.stuttgart.quality.model.Edge; -import de.hft.stuttgart.quality.model.HoleOutside; -import de.hft.stuttgart.quality.model.InnerRingsNested; -import de.hft.stuttgart.quality.model.InteriorDisconnected; -import de.hft.stuttgart.quality.model.IntersectingRings; -import de.hft.stuttgart.quality.model.MultipleConnectedComponents; -import de.hft.stuttgart.quality.model.NonManifoldEdge; -import de.hft.stuttgart.quality.model.NonManifoldVertex; -import de.hft.stuttgart.quality.model.NonPlanarDistancePlane; -import de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation; -import de.hft.stuttgart.quality.model.OrientationRingsSame; -import de.hft.stuttgart.quality.model.PolygonWrongOrientation; -import de.hft.stuttgart.quality.model.RingNotClosed; -import de.hft.stuttgart.quality.model.RingSelfIntersection; -import de.hft.stuttgart.quality.model.SolidNotClosed; -import de.hft.stuttgart.quality.model.TooFewPoints; -import de.hft.stuttgart.quality.model.TooFewPolygons; -import de.hft.stuttgart.quality.model.Validation; -import de.hft.stuttgart.quality.model.ValidationError; -import de.hft.stuttgart.quality.model.ValidationResult; -import de.hft.stuttgart.quality.model.jaxb.Checking; -import de.hft.stuttgart.quality.model.jaxb.Component; -import de.hft.stuttgart.quality.model.jaxb.ErrorId; -import de.hft.stuttgart.quality.model.jaxb.ErrorStatistics; -import de.hft.stuttgart.quality.model.jaxb.FeatureStatistics; -import de.hft.stuttgart.quality.model.jaxb.Parameter; -import de.hft.stuttgart.quality.model.jaxb.Requirement; -import de.hft.stuttgart.quality.model.jaxb.RequirementId; -import de.hft.stuttgart.quality.model.jaxb.ResultType; -import de.hft.stuttgart.quality.model.jaxb.RingSelfIntType; -import de.hft.stuttgart.quality.model.jaxb.Statistics; -import de.hft.stuttgart.quality.model.jaxb.TopLevelFeatureType; -import de.hft.stuttgart.quality.model.jaxb.ValidationPlan; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xmlobjects.gml.model.base.Reference; +import org.xmlobjects.gml.model.geometry.DirectPosition; +import org.xmlobjects.gml.model.measures.Angle; +import org.xmlobjects.gml.model.measures.Length; +import org.xmlobjects.schema.SchemaHandlerException; + +import de.hft.stuttgart.quality.model.enums.ErrorId; +import de.hft.stuttgart.quality.model.enums.RequirementId; +import de.hft.stuttgart.quality.model.enums.ResultType; +import de.hft.stuttgart.quality.model.enums.RingSelfIntType; +import de.hft.stuttgart.quality.model.enums.TopLevelFeatureType; +import de.hft.stuttgart.quality.model.properties.AbstractErrorProperty; +import de.hft.stuttgart.quality.model.properties.CheckingProperty; +import de.hft.stuttgart.quality.model.properties.EdgeListProperty; +import de.hft.stuttgart.quality.model.properties.EdgeProperty; +import de.hft.stuttgart.quality.model.properties.ErrorProperty; +import de.hft.stuttgart.quality.model.properties.FeatureStatisticsProperty; +import de.hft.stuttgart.quality.model.properties.FilterProperty; +import de.hft.stuttgart.quality.model.properties.GlobalParametersProperty; +import de.hft.stuttgart.quality.model.properties.ParameterProperty; +import de.hft.stuttgart.quality.model.properties.PolygonIdListProperty; +import de.hft.stuttgart.quality.model.properties.RequirementProperty; +import de.hft.stuttgart.quality.model.properties.StatisticsProperty; +import de.hft.stuttgart.quality.model.properties.ValidationPlanProperty; +import de.hft.stuttgart.quality.model.properties.ValidationResultProperty; +import de.hft.stuttgart.quality.model.types.AllPolygonsOrientedWrongError; +import de.hft.stuttgart.quality.model.types.Checking; +import de.hft.stuttgart.quality.model.types.CityObjectProperties; +import de.hft.stuttgart.quality.model.types.ConsecutivePointsSameError; +import de.hft.stuttgart.quality.model.types.Edge; +import de.hft.stuttgart.quality.model.types.EdgeList; +import de.hft.stuttgart.quality.model.types.FeatureStatistics; +import de.hft.stuttgart.quality.model.types.Filter; +import de.hft.stuttgart.quality.model.types.GlobalParameters; +import de.hft.stuttgart.quality.model.types.HoleOutsideError; +import de.hft.stuttgart.quality.model.types.InnerRingsNestedError; +import de.hft.stuttgart.quality.model.types.InteriorDisconnectedError; +import de.hft.stuttgart.quality.model.types.IntersectingRingsError; +import de.hft.stuttgart.quality.model.types.MultipleComponentsError; +import de.hft.stuttgart.quality.model.types.NonManifoldEdgeError; +import de.hft.stuttgart.quality.model.types.NonManifoldVertexError; +import de.hft.stuttgart.quality.model.types.OrientationRingsSameError; +import de.hft.stuttgart.quality.model.types.Parameter; +import de.hft.stuttgart.quality.model.types.PlanarDistancePlaneError; +import de.hft.stuttgart.quality.model.types.PlanarNormalsDeviationError; +import de.hft.stuttgart.quality.model.types.PolygonIdList; +import de.hft.stuttgart.quality.model.types.PolygonWrongOrientationError; +import de.hft.stuttgart.quality.model.types.Requirement; +import de.hft.stuttgart.quality.model.types.RingNotClosedError; +import de.hft.stuttgart.quality.model.types.RingSelfIntersectionError; +import de.hft.stuttgart.quality.model.types.RingTooFewPointsError; +import de.hft.stuttgart.quality.model.types.SemanticAttributeMissingError; +import de.hft.stuttgart.quality.model.types.SemanticAttributeWrongValueError; +import de.hft.stuttgart.quality.model.types.SolidNotClosedError; +import de.hft.stuttgart.quality.model.types.SolidSelfIntersectionError; +import de.hft.stuttgart.quality.model.types.SolidTooFewPolygonsError; +import de.hft.stuttgart.quality.model.types.Statistics; +import de.hft.stuttgart.quality.model.types.Validation; +import de.hft.stuttgart.quality.model.types.ValidationPlan; +import de.hft.stuttgart.quality.model.types.ValidationResult; class QualityAdeTests { - @Test - void testReadingConsecutiveSameError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_Error_QualityADE.gml"); - testValidationPlan(cityModel); - - List cityObjectMember = cityModel.getCityObjectMember(); - assertEquals(1, cityObjectMember.size()); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - assertNotNull(aco); - assertTrue(aco instanceof Building); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - assertTrue(resultComp instanceof ValidationResult); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - assertEquals(1, errors.size()); - ValidationError validationError = errors.get(0); - assertTrue(validationError instanceof ConsecutivePointsSame); - ConsecutivePointsSame err = (ConsecutivePointsSame) validationError; - assertEquals("_Simple_BD.1_PG.6_LR.1", err.getLinearRingId()); - Double x1 = err.getVertex1().getValue().get(0); - assertEquals(11.5, x1, 0.0000001); - Double x2 = err.getVertex2().getValue().get(0); - assertEquals(11.5, x2, 0.0000001); - } + private static final String CITY_OBJECT_MEMBER = "cityObjectMember"; + private static List chunkProperties = new ArrayList<>(); - @Test - void testReadingTooFewPointsError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_TooFewPoints.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - assertTrue(validationError instanceof TooFewPoints); - TooFewPoints err = (TooFewPoints) validationError; - assertEquals("_Simple_BD.1_PG.6_LR.1", err.getLinearRingId()); + static { + chunkProperties.add(new QName(CityGMLConstants.CITYGML_1_0_CORE_NAMESPACE, CITY_OBJECT_MEMBER)); + chunkProperties.add(new QName(CityGMLConstants.CITYGML_2_0_CORE_NAMESPACE, CITY_OBJECT_MEMBER)); + chunkProperties.add(new QName(CityGMLConstants.CITYGML_3_0_CORE_NAMESPACE, CITY_OBJECT_MEMBER)); } - @Test - void testReadingRingSelfIntersectionError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_RingSelfIntersection.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - assertTrue(validationError instanceof RingSelfIntersection); - RingSelfIntersection err = (RingSelfIntersection) validationError; - assertEquals("_Simple_BD.1_PG.6_LR.1", err.getLinearRingId()); - assertEquals(RingSelfIntType.POINT_TOUCHES_EDGE, err.getType()); - assertNull(err.getEdge2()); - Edge edge1 = err.getEdge1(); - assertEquals(10.0, edge1.getFrom().getValue().get(0), 0.000001); - assertEquals(11.0, edge1.getTo().getValue().get(0), 0.000001); - assertEquals(5.0, err.getVertex1().getValue().get(0)); - assertNull(err.getVertex2()); + @BeforeAll + static void setUsLocale() throws ADEException { + Locale.setDefault(Locale.US); + ADERegistry.getInstance().loadADE(new QualityADEContext()); } @Test - void testReadingRingNotClosedError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_RingNotClosed.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - assertTrue(validationError instanceof RingNotClosed); - RingNotClosed err = (RingNotClosed) validationError; - assertEquals("_Simple_BD.1_PG.6_LR.1", err.getLinearRingId()); - } + void testAllPolygonsOrientedWrong() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { + CityModel model = new CityModel(); + ValidationResult res = fillCityModel(model); - @Test - void testReadingInteriorDisconnectedError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_InteriorDisconnected.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof InteriorDisconnected); - InteriorDisconnected err = (InteriorDisconnected) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - } + AllPolygonsOrientedWrongError err = new AllPolygonsOrientedWrongError(); + err.setGeometryId("geomId"); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testReadingIntersectingRingsError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_IntersectingRings.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof IntersectingRings); - IntersectingRings err = (IntersectingRings) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals("_Simple_BD.1_PG.1_Ring1", err.getLinearRingId1()); - assertEquals("_Simple_BD.1_PG.1_Ring2", err.getLinearRingId2()); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testReadingNonPlanarPolygonDistancePlaneError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_NonPlanarPolygonDistancePlane.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof NonPlanarDistancePlane); - NonPlanarDistancePlane err = (NonPlanarDistancePlane) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals(1.0, err.getVertex().getValue().get(0), 0.000001); - assertEquals(0.001, err.getDistance().getValue(), 0.000001); - assertEquals("m", err.getDistance().getUom()); - } + void testConsecutivePointsSameError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { + CityModel model = new CityModel(); + ValidationResult res = fillCityModel(model); - @Test - void testReadingInnerRingsNestedError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_InnerRingNested.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof InnerRingsNested); - InnerRingsNested err = (InnerRingsNested) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals("_Simple_BD.1_PG.1_Ring1", err.getLinearRingId1()); - assertEquals("_Simple_BD.1_PG.1_Ring2", err.getLinearRingId2()); - } + ConsecutivePointsSameError err = new ConsecutivePointsSameError(); + err.setLinearRingId("ringId"); + err.setVertex1(new DirectPosition(1, 2, 3)); + err.setVertex2(new DirectPosition(5, 6, 7)); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testReadingHoleOutsideError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_HoleOutside.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof HoleOutside); - HoleOutside err = (HoleOutside) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals("_Simple_BD.1_PG.1_Ring1", err.getLinearRingId()); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testReadingNonPlanarNormalsDeviationError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_NonPlanarPolygonNormalsDeviation.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof NonPlanarNormalsDeviation); - NonPlanarNormalsDeviation err = (NonPlanarNormalsDeviation) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals(1.0, err.getDeviation().getValue()); - assertEquals("deg", err.getDeviation().getUom()); - } + void testHoleOutsideError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { + CityModel model = new CityModel(); + ValidationResult res = fillCityModel(model); - @Test - void testReadingOrientationRingsSameError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_OrientationRingsSame.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof OrientationRingsSame); - OrientationRingsSame err = (OrientationRingsSame) validationError; - assertEquals("_Simple_BD.1_PG.1", err.getPolygonId()); - assertEquals("_Simple_BD.1_PG.1_Ring1", err.getLinearRingId()); - } + HoleOutsideError err = new HoleOutsideError(); + err.setLinearRingId("ringId"); + err.setPolygonId("polyId"); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testReadingAllPolygonsWrongOrientationError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_AllPolygonsWrongOrientation.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof AllPolygonsWrongOrientation); - AllPolygonsWrongOrientation err = (AllPolygonsWrongOrientation) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testReadingPolygonWrongOrientationError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_PolygonWrongOrientation.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof PolygonWrongOrientation); - PolygonWrongOrientation err = (PolygonWrongOrientation) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - assertFalse(err.getEdges().isEmpty()); - List edges = err.getEdges(); - Edge edge = edges.get(0); - DirectPosition from = edge.getFrom(); - assertEquals(10.0, from.getValue().get(0), 0.000001); - assertEquals(11.0, edge.getTo().getValue().get(0), 0.000001); - } + void testInnerRingsNestedError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { + CityModel model = new CityModel(); + ValidationResult res = fillCityModel(model); - @Test - void testReadingNonManifoldVertexError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_NonManifoldVertex.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof NonManifoldVertex); - NonManifoldVertex err = (NonManifoldVertex) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - DirectPosition vertex = err.getVertex(); - assertEquals(1.0, vertex.getValue().get(0), 0.000001); - } + InnerRingsNestedError err = new InnerRingsNestedError(); + err.setLinearRingId1("ringId1"); + err.setLinearRingId2("ringId2"); + err.setPolygonId("polyId"); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testReadingNonManifoldEdgeError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_NonManifoldEdge.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof NonManifoldEdge); - NonManifoldEdge err = (NonManifoldEdge) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - assertFalse(err.getEdges().isEmpty()); - List edges = err.getEdges(); - Edge edge = edges.get(0); - DirectPosition from = edge.getFrom(); - assertEquals(10.0, from.getValue().get(0), 0.000001); - assertEquals(11.0, edge.getTo().getValue().get(0), 0.000001); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testReadingSolidNotClosedError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_SolidNotClosed.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof SolidNotClosed); - SolidNotClosed err = (SolidNotClosed) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - assertFalse(err.getEdges().isEmpty()); - List edges = err.getEdges(); - Edge edge = edges.get(0); - DirectPosition from = edge.getFrom(); - assertEquals(10.0, from.getValue().get(0), 0.000001); - assertEquals(11.0, edge.getTo().getValue().get(0), 0.000001); - } + void testInteriorDisconnectedError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { + CityModel model = new CityModel(); + ValidationResult res = fillCityModel(model); - @Test - void testReadingTooFewPolygonsError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_TooFewPolygons.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof TooFewPolygons); - TooFewPolygons err = (TooFewPolygons) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - } + InteriorDisconnectedError err = new InteriorDisconnectedError(); + err.setPolygonId("polyId"); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testReadingMultipleConnectedComponentsError() - throws ADEException, CityGMLBuilderException, CityGMLReadException, FileNotFoundException { - CityModel cityModel = readCityGml("src/test/resources/SimpleSolid_MultipleConnectedComponents.gml"); - - List cityObjectMember = cityModel.getCityObjectMember(); - CityObjectMember com = cityObjectMember.get(0); - AbstractCityObject aco = com.getCityObject(); - Building b = (Building) aco; - - List gen = b.getGenericApplicationPropertyOfCityObject(); - ADEComponent resultComp = gen.get(0); - ValidationResult result = (ValidationResult) resultComp; - assertEquals(ResultType.ERROR, result.getResult()); - assertFalse(result.getErrors().isEmpty()); - List errors = result.getErrors(); - ValidationError validationError = errors.get(0); - - assertTrue(validationError instanceof MultipleConnectedComponents); - MultipleConnectedComponents err = (MultipleConnectedComponents) validationError; - assertEquals("_Simple_BD.1_Geom1", err.getGeometryId()); - assertEquals("_Simple_BD.1_PG.1", err.getComponents().get(0).getPolygonIds().get(0)); - assertEquals("_Simple_BD.1_PG.2", err.getComponents().get(0).getPolygonIds().get(1)); - assertEquals("_Simple_BD.1_PG.3", err.getComponents().get(1).getPolygonIds().get(0)); - assertEquals("_Simple_BD.1_PG.4", err.getComponents().get(1).getPolygonIds().get(1)); - } - - @Test - void testWritingAttributeMissingError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { - CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - AttributeMissing error = new AttributeMissing(); - error.setAttributeName("TestName"); - error.setChildId("TestId"); - error.setGeneric(true); - result.getErrors().add(error); - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - AttributeMissing error2 = (AttributeMissing) valError; - assertEquals(error.getAttributeName(), error2.getAttributeName()); - assertEquals(error.getChildId(), error2.getChildId()); - assertEquals(error.isGeneric(), error2.isGeneric()); - } - - @Test - void testWritingAttributeWrongValueError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { - CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - AttributeWrongValue error = new AttributeWrongValue(); - error.setAttributeName("TestName"); - error.setChildId("TestId"); - error.setGeneric(true); - result.getErrors().add(error); - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - AttributeWrongValue error2 = (AttributeWrongValue) valError; - assertEquals(error.getAttributeName(), error2.getAttributeName()); - assertEquals(error.getChildId(), error2.getChildId()); - assertEquals(error.isGeneric(), error2.isGeneric()); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingMultipleConnectedComponentsError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testIntersectingRingsError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - MultipleConnectedComponents error = new MultipleConnectedComponents(); - error.setGeometryId("TestGeometry"); - Component c1 = new Component(); - c1.getPolygonIds().add("TestPoly"); - error.getComponents().add(c1); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - MultipleConnectedComponents error2 = (MultipleConnectedComponents) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - assertEquals(error.getComponents().get(0).getPolygonIds().get(0), - error2.getComponents().get(0).getPolygonIds().get(0)); - } + ValidationResult res = fillCityModel(model); - @Test - void testWritingTooFewPolygonsError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { - CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - TooFewPolygons error = new TooFewPolygons(); - error.setGeometryId("TestGeometry"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - TooFewPolygons error2 = (TooFewPolygons) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - } + IntersectingRingsError err = new IntersectingRingsError(); + err.setLinearRingId1("ringId1"); + err.setLinearRingId2("ringId2"); + err.setPolygonId("polyId"); + res.getErrors().add(new AbstractErrorProperty(err)); - @Test - void testWritingSolidNotClosedError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { - CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - SolidNotClosed error = new SolidNotClosed(); - error.setGeometryId("TestGeometry"); - DirectPosition from = new DirectPosition(); - from.getValue().add(10.0); - DirectPosition to = new DirectPosition(); - to.getValue().add(11.0); - Edge e = new Edge(); - e.setFrom(from); - e.setTo(to); - error.getEdges().add(e); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - SolidNotClosed error2 = (SolidNotClosed) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - Edge edge = error.getEdges().get(0); - assertEquals(edge.getFrom().getValue().get(0), e.getFrom().getValue().get(0), 0.00001); - assertEquals(edge.getTo().getValue().get(0), e.getTo().getValue().get(0), 0.00001); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingNonManifoldEdgeError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testMultipleComponentsError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - NonManifoldEdge error = new NonManifoldEdge(); - error.setGeometryId("TestGeometry"); - DirectPosition from = new DirectPosition(); - from.getValue().add(10.0); - DirectPosition to = new DirectPosition(); - to.getValue().add(11.0); - Edge e = new Edge(); - e.setFrom(from); - e.setTo(to); - error.getEdges().add(e); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - NonManifoldEdge error2 = (NonManifoldEdge) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - Edge edge = error.getEdges().get(0); - assertEquals(edge.getFrom().getValue().get(0), e.getFrom().getValue().get(0), 0.00001); - assertEquals(edge.getTo().getValue().get(0), e.getTo().getValue().get(0), 0.00001); + ValidationResult res = fillCityModel(model); + + MultipleComponentsError err = new MultipleComponentsError(); + err.setGeometryId("geomId"); + PolygonIdList polygons = new PolygonIdList(); + polygons.getPolygonIds().add("test1"); + polygons.getPolygonIds().add("test2"); + err.getComponents().add(new PolygonIdListProperty(polygons)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingNonManifoldVertexError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testNonManifoldEdgeError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - NonManifoldVertex error = new NonManifoldVertex(); - error.setGeometryId("TestGeometry"); - DirectPosition vertex = new DirectPosition(); - vertex.getValue().add(10.0); - error.setVertex(vertex); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - NonManifoldVertex error2 = (NonManifoldVertex) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - assertEquals(error.getVertex().getValue().get(0), error2.getVertex().getValue().get(0)); + ValidationResult res = fillCityModel(model); + + NonManifoldEdgeError err = new NonManifoldEdgeError(); + err.setGeometryId("geomId"); + EdgeList edges = new EdgeList(); + Edge edge = new Edge(); + edge.setFrom(new DirectPosition(1, 2, 3)); + edge.setTo(new DirectPosition(5, 6, 7)); + edges.getEdges().add(new EdgeProperty(edge)); + err.setEdges(new EdgeListProperty(edges)); + + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingPolygonWrongOrientationError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testNonManifoldVertexError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - PolygonWrongOrientation error = new PolygonWrongOrientation(); - error.setGeometryId("TestGeometry"); - DirectPosition from = new DirectPosition(); - from.getValue().add(10.0); - DirectPosition to = new DirectPosition(); - to.getValue().add(11.0); - Edge e = new Edge(); - e.setFrom(from); - e.setTo(to); - error.getEdges().add(e); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - PolygonWrongOrientation error2 = (PolygonWrongOrientation) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); - Edge edge = error.getEdges().get(0); - assertEquals(edge.getFrom().getValue().get(0), e.getFrom().getValue().get(0), 0.00001); - assertEquals(edge.getTo().getValue().get(0), e.getTo().getValue().get(0), 0.00001); + ValidationResult res = fillCityModel(model); + + NonManifoldVertexError err = new NonManifoldVertexError(); + err.setGeometryId("geomId"); + err.setVertex(new DirectPosition(1, 2, 3)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingAllPolygonsWrongOrientationError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testOrientationRingsSameError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - AllPolygonsWrongOrientation error = new AllPolygonsWrongOrientation(); - error.setGeometryId("TestGeometry"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - AllPolygonsWrongOrientation error2 = (AllPolygonsWrongOrientation) valError; - assertEquals(error.getGeometryId(), error2.getGeometryId()); + ValidationResult res = fillCityModel(model); + + OrientationRingsSameError err = new OrientationRingsSameError(); + err.setLinearRing("ring1"); + err.setPolygonId("polyId"); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingOrientationRingsSameError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testPlanarDistancePlaneError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - OrientationRingsSame error = new OrientationRingsSame(); - error.setPolygonId("TestPolygon"); - error.setLinearRingId("TestRing"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - OrientationRingsSame error2 = (OrientationRingsSame) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); + ValidationResult res = fillCityModel(model); + + PlanarDistancePlaneError err = new PlanarDistancePlaneError(); + err.setPolygonId("polyId"); + err.setDistance(new Length(5d, "m")); + err.setVertex(new DirectPosition(1, 2, 3)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingNonPlanarNormalsDeviationError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testPlanarNormalsDeviationError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - NonPlanarNormalsDeviation error = new NonPlanarNormalsDeviation(); - error.setPolygonId("TestPolygon"); - Angle deviation = new Angle(); - deviation.setValue(1.0); - deviation.setUom("deg"); - error.setDeviation(deviation); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - NonPlanarNormalsDeviation error2 = (NonPlanarNormalsDeviation) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getDeviation().getValue(), error2.getDeviation().getValue()); - assertEquals(error.getDeviation().getUom(), error2.getDeviation().getUom()); + ValidationResult res = fillCityModel(model); + + PlanarNormalsDeviationError err = new PlanarNormalsDeviationError(); + err.setPolygonId("polyId"); + err.setDeviation(new Angle(5d, "deg")); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingHoleOutsideError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testPolygonWrongOrientationError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - HoleOutside error = new HoleOutside(); - error.setPolygonId("TestPolygon"); - error.setLinearRingId("TestRing1"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - HoleOutside error2 = (HoleOutside) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); + ValidationResult res = fillCityModel(model); + + PolygonWrongOrientationError err = new PolygonWrongOrientationError(); + err.setGeometryId("geomId"); + EdgeList edges = new EdgeList(); + Edge edge = new Edge(); + edge.setFrom(new DirectPosition(1, 2, 3)); + edge.setTo(new DirectPosition(5, 6, 7)); + edges.getEdges().add(new EdgeProperty(edge)); + err.setEdges(new EdgeListProperty(edges)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingInnerRingsNestedError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testRingNotClosedError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - InnerRingsNested error = new InnerRingsNested(); - error.setPolygonId("TestPolygon"); - error.setLinearRingId1("TestRing1"); - error.setLinearRingId2("TestRing2"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - InnerRingsNested error2 = (InnerRingsNested) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getLinearRingId1(), error2.getLinearRingId1()); - assertEquals(error.getLinearRingId2(), error2.getLinearRingId2()); + ValidationResult res = fillCityModel(model); + + RingNotClosedError err = new RingNotClosedError(); + err.setLinearRingId("ringId"); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingNonPlanarDistancePlaneError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testRingSelfIntersectionError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - NonPlanarDistancePlane error = new NonPlanarDistancePlane(); - error.setPolygonId("TestPolygon"); - DirectPosition vertex = new DirectPosition(); - vertex.getValue().add(1.0); - error.setVertex(vertex); - Length distance = new Length(0.1); - distance.setUom("m"); - error.setDistance(distance); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - NonPlanarDistancePlane error2 = (NonPlanarDistancePlane) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getVertex().getValue().get(0), error2.getVertex().getValue().get(0), 0.00001); - assertEquals(error.getDistance().getValue(), error2.getDistance().getValue(), 0.00001); + ValidationResult res = fillCityModel(model); + + RingSelfIntersectionError err = new RingSelfIntersectionError(); + err.setLinearRingId("ringId"); + Edge edge = new Edge(); + edge.setFrom(new DirectPosition(1, 2, 3)); + edge.setTo(new DirectPosition(5, 6, 7)); + err.setEdge1(new EdgeProperty(edge)); + err.setEdge2(new EdgeProperty(edge)); + err.setType(RingSelfIntType.EDGE_INTERSECTION); + err.setVertex1(new DirectPosition(1, 2, 3)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } - + @Test - void testWritingIntersectingRingsError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testRingSelfIntersectionErrorDegenerateRing() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - IntersectingRings error = new IntersectingRings(); - error.setPolygonId("TestPolygon"); - error.setLinearRingId1("TestRing1"); - error.setLinearRingId2("TestRing2"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - IntersectingRings error2 = (IntersectingRings) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); - assertEquals(error.getLinearRingId1(), error2.getLinearRingId1()); - assertEquals(error.getLinearRingId2(), error2.getLinearRingId2()); + ValidationResult res = fillCityModel(model); + + RingSelfIntersectionError err = new RingSelfIntersectionError(); + err.setLinearRingId("ringId"); + err.setType(RingSelfIntType.DEGENERATED_RING); + err.setVertex1(new DirectPosition(1, 2, 3)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingInteriorDisconnectedError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testRingTooFewPointsError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - InteriorDisconnected error = new InteriorDisconnected(); - error.setPolygonId("TestPolygon"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - InteriorDisconnected error2 = (InteriorDisconnected) valError; - assertEquals(error.getPolygonId(), error2.getPolygonId()); + ValidationResult res = fillCityModel(model); + + RingTooFewPointsError err = new RingTooFewPointsError(); + err.setLinearRingId("ringId"); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingRingNotClosedError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testSemanticAttributeMissingError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - RingNotClosed error = new RingNotClosed(); - error.setLinearRingId("TestRing"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - RingNotClosed error2 = (RingNotClosed) valError; - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); + ValidationResult res = fillCityModel(model); + + SemanticAttributeMissingError err = new SemanticAttributeMissingError(); + err.setAttributeName("attribute"); + err.setChildId("child"); + err.setGeneric(true); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingTooFewPointsError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testSemanticAttributeWrongValueError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - TooFewPoints error = new TooFewPoints(); - error.setLinearRingId("TestRing"); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - TooFewPoints error2 = (TooFewPoints) valError; - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); + ValidationResult res = fillCityModel(model); + + SemanticAttributeWrongValueError err = new SemanticAttributeWrongValueError(); + err.setAttributeName("attribute"); + err.setChildId("child"); + err.setGeneric(true); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingConsecutiveSameError() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testSolidNotClosedError() throws ADEException, CityGMLContextException, CityGMLWriteException, SAXException, + IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - - ConsecutivePointsSame error = new ConsecutivePointsSame(); - error.setLinearRingId("TestRing"); - DirectPosition vertex1 = new DirectPosition(); - vertex1.getValue().add(10.0); - vertex1.getValue().add(5.0); - vertex1.getValue().add(7.0); - error.setVertex1(vertex1); - DirectPosition vertex2 = new DirectPosition(); - vertex2.getValue().add(15.0); - vertex2.getValue().add(55.0); - vertex2.getValue().add(71.0); - error.setVertex2(vertex2); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - ConsecutivePointsSame error2 = (ConsecutivePointsSame) valError; - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); - assertEquals(error.getVertex1().getValue().get(0), error2.getVertex1().getValue().get(0)); - assertEquals(error.getVertex2().getValue().get(0), error2.getVertex2().getValue().get(0)); + ValidationResult res = fillCityModel(model); + + SolidNotClosedError err = new SolidNotClosedError(); + err.setGeometryId("geomId"); + EdgeList edges = new EdgeList(); + Edge edge = new Edge(); + edge.setFrom(new DirectPosition(1, 2, 3)); + edge.setTo(new DirectPosition(5, 6, 7)); + edges.getEdges().add(new EdgeProperty(edge)); + err.setEdges(new EdgeListProperty(edges)); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingRingSelfIntersection() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testSolidSelfIntersectionError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Building b = new Building(); - model.getCityObjectMember().add(new CityObjectMember(b)); - - ValidationResult result = new ValidationResult(); - result.setResult(ResultType.ERROR); - b.addGenericApplicationPropertyOfCityObject(result); - - RingSelfIntersection error = new RingSelfIntersection(); - error.setType(RingSelfIntType.DUPLICATE_POINT); - error.setLinearRingId("TestRing"); - DirectPosition vertex1 = new DirectPosition(); - vertex1.getValue().add(10.0); - vertex1.getValue().add(5.0); - vertex1.getValue().add(7.0); - error.setVertex1(vertex1); - DirectPosition vertex2 = new DirectPosition(); - vertex2.getValue().add(15.0); - vertex2.getValue().add(55.0); - vertex2.getValue().add(71.0); - error.setVertex2(vertex2); - result.getErrors().add(error); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - AbstractCityObject co = model.getCityObjectMember().get(0).getCityObject(); - List ades = co.getGenericApplicationPropertyOfCityObject(); - ADEComponent adeComponent = ades.get(0); - ValidationResult valRes = (ValidationResult) adeComponent; - assertEquals(ResultType.ERROR, valRes.getResult()); - - ValidationError valError = valRes.getErrors().get(0); - RingSelfIntersection error2 = (RingSelfIntersection) valError; - assertEquals(error.getLinearRingId(), error2.getLinearRingId()); - assertEquals(error.getVertex1().getValue().get(0), error2.getVertex1().getValue().get(0)); - assertEquals(error.getVertex2().getValue().get(0), error2.getVertex2().getValue().get(0)); + ValidationResult res = fillCityModel(model); + + SolidSelfIntersectionError err = new SolidSelfIntersectionError(); + err.setGeometryId("geomId"); + err.setPolygonId1("poly1"); + err.setPolygonId2("poly2"); + res.getErrors().add(new AbstractErrorProperty(err)); + + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } @Test - void testWritingValidationPlan() - throws ADEException, CityGMLBuilderException, CityGMLWriteException, CityGMLReadException { + void testSolidTooFewPolygonsError() throws ADEException, CityGMLContextException, CityGMLWriteException, + SAXException, IOException, SchemaHandlerException { CityModel model = new CityModel(); - Validation val = new Validation(); - model.addGenericApplicationPropertyOfCityModel(val); + ValidationResult res = fillCityModel(model); - ZonedDateTime expectedDate = LocalDateTime.of(2002, 5, 30, 9, 0).atZone(ZoneId.systemDefault()); + SolidTooFewPolygonsError err = new SolidTooFewPolygonsError(); + err.setGeometryId("geomId"); + res.getErrors().add(new AbstractErrorProperty(err)); - val.setValidationDate(expectedDate); - val.setValidationSoftware("CityDoctor2"); - ValidationPlan plan = new ValidationPlan(); - val.setValidationPlan(plan); - - Parameter roundingParameter = new Parameter(); - roundingParameter.setName("numberOfRoundingPlaces"); - roundingParameter.setValue("8"); - plan.getGlobalParameters().add(roundingParameter); - - Parameter minVertexDistance = new Parameter(); - minVertexDistance.setName("minVertexDistance"); - minVertexDistance.setValue("0.0001"); - minVertexDistance.setUom("m"); - plan.getGlobalParameters().add(minVertexDistance); - - Requirement rTooFewPoints = new Requirement(); - rTooFewPoints.setEnabled(true); - rTooFewPoints.setName(RequirementId.R_GE_R_TOO_FEW_POINTS); - plan.getRequirements().add(rTooFewPoints); - - Checking buildingChecking = new Checking(); - buildingChecking.setValue(TopLevelFeatureType.BUILDING); - plan.getFilter().add(buildingChecking); - - Statistics statistics = new Statistics(); - val.setStatistics(statistics); - - FeatureStatistics numErrorBridgeObjects = new FeatureStatistics(); - numErrorBridgeObjects.setNumChecked(0); - numErrorBridgeObjects.setNumErrors(0); - statistics.setNumErrorBridgeObjects(numErrorBridgeObjects); - - FeatureStatistics numErrorBuildings = new FeatureStatistics(); - numErrorBuildings.setNumChecked(1); - numErrorBuildings.setNumErrors(1); - statistics.setNumErrorBuildings(numErrorBuildings); - - FeatureStatistics numErrors = new FeatureStatistics(); - statistics.setNumErrorLandObjects(numErrors); - statistics.setNumErrorTransportation(numErrors); - statistics.setNumErrorVegetation(numErrors); - statistics.setNumErrorWaterObjects(numErrors); - - ErrorStatistics stats1 = new ErrorStatistics(); - stats1.setAmount(1); - stats1.setName(ErrorId.GE_R_CONSECUTIVE_POINTS_SAME); - statistics.getErrorStatistics().add(stats1); - - byte[] gml = writeCityGml(model); - model = readCityGml(gml); - - testValidationPlan(model); + byte[] buf = writeModel(model); + assertTrue(validate(new ByteArrayInputStream(buf))); } - private CityModel readCityGml(InputStream input) - throws ADEException, CityGMLBuilderException, CityGMLReadException { - CityGMLContext context = CityGMLContext.getInstance(); - List adeContexts = context.getADEContexts(); - if (adeContexts.isEmpty()) { - for (ADEContext adeContext : ServiceLoader.load(ADEContext.class)) { - context.registerADEContext(adeContext); + private boolean validate(InputStream stream) + throws SAXException, IOException, CityGMLContextException, SchemaHandlerException { + + CityGMLContext context = CityGMLContext.newInstance(); + + CityGMLSchemaHandler schemaHandler = context.getDefaultSchemaHandler(); + Source[] schemas = schemaHandler.getSchemas(); + + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(schemas); + + Validator validator = schema.newValidator(); + boolean[] foundErrors = new boolean[1]; + foundErrors[0] = false; + + validator.setErrorHandler(new ErrorHandler() { + @Override + public void error(SAXParseException exception) { + String message = "[" + exception.getLineNumber() + ", " + exception.getColumnNumber() + "] " + + exception.getMessage(); + System.out.println(message); + foundErrors[0] = true; } - } - CityGMLBuilder builder = context.createCityGMLBuilder(); - CityGMLInputFactory in = builder.createCityGMLInputFactory(); - in.setProperty(CityGMLInputFactory.USE_VALIDATION, true); - in.setProperty(CityGMLInputFactory.FEATURE_READ_MODE, FeatureReadMode.NO_SPLIT); - in.setValidationEventHandler(event -> { - System.out.print( - "[" + event.getLocator().getLineNumber() + "," + event.getLocator().getColumnNumber() + "] "); - System.out.println(event.getMessage()); - throw new IllegalStateException(event.getLinkedException()); + @Override + public void warning(SAXParseException exception) { + error(exception); + } + + @Override + public void fatalError(SAXParseException exception) { + error(exception); + } }); - CityModel cityModel; - try (CityGMLReader reader = in.createCityGMLReader("?", input)) { - cityModel = (CityModel) reader.nextFeature(); - } - return cityModel; - } - private CityModel readCityGml(File f) - throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { - return readCityGml(new FileInputStream(f)); + validator.validate(new StreamSource(stream)); + return !foundErrors[0]; } - private CityModel readCityGml(String fileName) - throws FileNotFoundException, ADEException, CityGMLBuilderException, CityGMLReadException { - return readCityGml(new File(fileName)); - } + private byte[] writeModel(CityModel model) throws ADEException, CityGMLContextException, CityGMLWriteException { - private CityModel readCityGml(byte[] bytes) throws ADEException, CityGMLBuilderException, CityGMLReadException { - return readCityGml(new ByteArrayInputStream(bytes)); + CityGMLContext context = CityGMLContext.newInstance(); + CityGMLVersion version = CityGMLVersion.v2_0; + CityGMLOutputFactory out = context.createCityGMLOutputFactory(version); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + try (CityGMLWriter writer = out.createCityGMLWriter(outStream, StandardCharsets.UTF_8.name())) { + writer.withIndent(" ") + .withSchemaLocation(QualityADEModule.NAMESPACE_URI, + getClass().getResource("/qualityAde.xsd").toString()) + .withDefaultPrefixes().withDefaultNamespace(CoreModule.of(version).getNamespaceURI()).write(model); + } + return outStream.toByteArray(); } - private void testValidationPlan(CityModel cityModel) { - assertFalse(cityModel.getGenericApplicationPropertyOfCityModel().isEmpty()); - List ades = cityModel.getGenericApplicationPropertyOfCityModel(); - ADEComponent adeComponent = ades.get(0); - assertTrue(adeComponent instanceof Validation); - Validation val = (Validation) adeComponent; - ZonedDateTime expectedDate = LocalDateTime.of(2002, 5, 30, 9, 0).atZone(ZoneId.systemDefault()); - assertTrue(expectedDate.isEqual(val.getValidationDate())); - assertEquals("CityDoctor2", val.getValidationSoftware()); - assertNotNull(val.getValidationPlan()); - ValidationPlan plan = val.getValidationPlan(); - assertNotNull(plan.getGlobalParameters()); - assertFalse(plan.getGlobalParameters().isEmpty()); - List globalParameters = plan.getGlobalParameters(); - Parameter roundingParameter = globalParameters.get(0); - assertEquals("numberOfRoundingPlaces", roundingParameter.getName()); - assertEquals("8", roundingParameter.getValue()); - assertNull(roundingParameter.getUom()); - Parameter minVertexDistance = globalParameters.get(1); - assertEquals("minVertexDistance", minVertexDistance.getName()); - assertEquals("0.0001", minVertexDistance.getValue()); - assertEquals("m", minVertexDistance.getUom()); - - assertNotNull(plan.getRequirements()); - assertFalse(plan.getRequirements().isEmpty()); - - List requirements = plan.getRequirements(); - Requirement rTooFewPoints = requirements.get(0); - assertEquals(RequirementId.R_GE_R_TOO_FEW_POINTS, rTooFewPoints.getName()); - assertTrue(rTooFewPoints.isEnabled()); - - assertNotNull(plan.getFilter()); - assertFalse(plan.getFilter().isEmpty()); - - List filter = plan.getFilter(); - Checking buildingChecking = filter.get(0); - assertEquals(TopLevelFeatureType.BUILDING, buildingChecking.getValue()); - - Statistics statistics = val.getStatistics(); - assertNotNull(statistics); - FeatureStatistics numErrorBridgeObjects = statistics.getNumErrorBridgeObjects(); - assertNotNull(numErrorBridgeObjects); - assertEquals(0, numErrorBridgeObjects.getNumChecked()); - assertEquals(0, numErrorBridgeObjects.getNumErrors()); - - FeatureStatistics numErrorBuildings = statistics.getNumErrorBuildings(); - assertEquals(1, numErrorBuildings.getNumChecked()); - assertEquals(1, numErrorBuildings.getNumErrors()); - - List errorStatistics = statistics.getErrorStatistics(); - assertNotNull(errorStatistics); - assertFalse(errorStatistics.isEmpty()); - ErrorStatistics stats1 = errorStatistics.get(0); - assertEquals(ErrorId.GE_R_CONSECUTIVE_POINTS_SAME, stats1.getName()); - assertEquals(1, stats1.getAmount()); - } + private ValidationResult fillCityModel(CityModel model) { + Validation v = new Validation(); + v.setId("planId"); + model.getFeatureMembers().add(new AbstractFeatureProperty(v)); + v.setValidationSoftware("testSoftware"); + v.setValidationDate(ZonedDateTime.now()); + ValidationPlan plan = new ValidationPlan(); - private byte[] writeCityGml(CityModel model) throws ADEException, CityGMLBuilderException, CityGMLWriteException { - CityGMLContext context = CityGMLContext.getInstance(); - List adeContexts = context.getADEContexts(); - if (adeContexts == null || adeContexts.isEmpty()) { - for (ADEContext adeContext : ServiceLoader.load(ADEContext.class)) { - context.registerADEContext(adeContext); - } - } + Statistics stats = new Statistics(); + FeatureStatistics fStats = new FeatureStatistics(); + fStats.setNumChecked(5); + fStats.setNumErrors(2); + stats.setNumErrorBridgeObjects(new FeatureStatisticsProperty(fStats)); + v.setStatistics(new StatisticsProperty(stats)); + + de.hft.stuttgart.quality.model.types.Error err = new de.hft.stuttgart.quality.model.types.Error(); + err.setName(ErrorId.GE_P_HOLE_OUTSIDE); + err.setOccurrences(1); + stats.getErrors().add(new ErrorProperty(err)); + + Requirement req = new Requirement(); + req.setEnabled(true); + req.setRequirementType(RequirementId.R_GE_P_HOLE_OUTSIDE); + plan.getRequirements().add(new RequirementProperty(req)); + + Checking checking = new Checking(); + checking.setFeatureType(TopLevelFeatureType.BRIDGE); + + Filter filter = new Filter(); + filter.getChecking().add(new CheckingProperty(checking)); + plan.setFilter(new FilterProperty(filter)); + + Parameter param = new Parameter(); + param.setName("test"); + param.setUom("uom"); + param.setValue("5"); + GlobalParameters globalParams = new GlobalParameters(); + globalParams.getParameters().add(new ParameterProperty(param)); + plan.setGlobalParameters(new GlobalParametersProperty(globalParams)); + + v.setValidationPlan(new ValidationPlanProperty(plan)); - CityGMLBuilder builder = context.createCityGMLBuilder(); - - CityGMLOutputFactory outputFactory = builder.createCityGMLOutputFactory(CityGMLVersion.DEFAULT); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (CityGMLWriter writer = outputFactory.createCityGMLWriter(out)) { - writer.setIndentString(" "); - writer.setPrefixes(CityGMLVersion.DEFAULT); - writer.setPrefix("qual", QualityADEModule.NAMESPACE_URI); - writer.setSchemaLocation(QualityADEModule.NAMESPACE_URI, - QualityADEModule.NAMESPACE_URI + "/qualityAde.xsd"); - writer.setSchemaLocations(CityGMLVersion.DEFAULT); - writer.write(model); - return out.toByteArray(); - } - } + Building b = new Building(); + b.setId("testId"); + model.getCityObjectMembers().add(new AbstractCityObjectProperty(b)); + CityObjectProperties props = new CityObjectProperties(); + b.addADEProperty(props); + ValidationResult res = new ValidationResult(); + props.setValidationResult(new ValidationResultProperty(res)); + res.setResultType(ResultType.ERROR); + res.setValidationPlanID(new Reference(v)); + return res; + } } diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_AllPolygonsWrongOrientation.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_AllPolygonsWrongOrientation.gml deleted file mode 100644 index 0ef3a62b964b1cb63ee7ea7282c04e17591a93c7..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_AllPolygonsWrongOrientation.gml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - _Simple_BD.1_Geom1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_Error_QualityADE.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_Error_QualityADE.gml index 3334930d3ee44c59205c842a1ee7bb28787681dd..c62b3696ce8c77b6cc5530708a763a3745b0ee71 100644 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_Error_QualityADE.gml +++ b/citygml4j-quality-ade/src/test/resources/SimpleSolid_Error_QualityADE.gml @@ -1,41 +1,51 @@  - + - -CityGML 2.0 - - -linear ring _Simple_BD.1_PG.6_LR.1 beinhaltet zwei aufeinander folgende Punkte, die identisch sind. - -10.5.2017 -Author: V. Coors, HFT Stuttgart -Lizenz: ---> + Building-Unit-House + + + 457841 5439082 111 + 457854 5439093 121 + + - - - _Simple_BD.1_PG.6_LR.1 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - + + + + + + _Simple_BD.1_PG.6_LR.1 + 11.5 10.0 4.5 + 11.5 10.0 4.5 + + + ERROR + - - - - - - - + + + + + + + @@ -77,7 +87,8 @@ Lizenz: 11.5 15.0 4.5 13.0 15.0 3.0 13.0 15.0 0.0 - 10.0 15.0 0.0 + 10.0 + 15.0 0.0 @@ -124,7 +135,8 @@ Lizenz: 11.5 10.0 4.5 10.0 10.0 3.0 10.0 10.0 0.0 - 13.0 10.0 0.0 + 13.0 + 10.0 0.0 @@ -148,8 +160,9 @@ Lizenz: 11.5 10.0 4.5 11.5 15.0 4.5 10.0 15.0 3.0 - 10.0 10.0 3.0 - + 10.0 + 10.0 3.0 + @@ -199,59 +212,245 @@ Lizenz: - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - + + + 2002-05-30T09:00:00 + CityDoctor2 + + + + + 1 + 1 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 1 + GE_R_CONSECUTIVE_POINTS_SAME + + + + + + + + + + + numberOfRoundingPlaces + 8 + + + + + minVertexDistance + m + 0.0001 + + + + + schematronFile + + + + + + + + + + BUILDING + + + + + TRANSPORTATION + + + + + VEGETATION + + + + + BRIDGE + + + + + WATER + + + + + LAND + + + + + + + true + R_GE_R_TOO_FEW_POINTS + + + + + true + R_GE_R_NOT_CLOSED + + + + + true + R_GE_R_CONSECUTIVE_POINTS_SAME + + + + + true + R_GE_R_SELF_INTERSECTION + + + + + true + R_GE_P_NON_PLANAR + + + type + distance + + + + + distanceTolerance + m + 0.01 + + + + + angleTolerance + deg + 1 + + + + + + + true + R_GE_P_INTERIOR_DISCONNECTED + + + + + true + R_GE_P_INTERSECTING_RINGS + + + + + true + R_GE_P_HOLE_OUTSIDE + + + + + true + R_GE_P_ORIENTATION_RINGS_SAME + + + + + true + R_GE_P_INNER_RINGS_NESTED + + + + + true + R_GE_S_TOO_FEW_POLYGONS + + + + + true + R_GE_S_NOT_CLOSED + + + + + true + R_GE_S_NON_MANIFOLD_EDGE + + + + + true + R_GE_S_POLYGON_WRONG_ORIENTATION + + + + + true + R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION + + + + + true + R_GE_S_NON_MANIFOLD_VERTEX + + + + + true + R_GE_S_SELF_INTERSECTION + + + + + true + R_GE_S_MULTIPLE_CONNECTED_COMPONENTS + + + + + + \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_HoleOutside.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_HoleOutside.gml deleted file mode 100644 index 6c3c99d0c3b531d001502e2049953cb2d66780fd..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_HoleOutside.gml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.1_Ring1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_InnerRingNested.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_InnerRingNested.gml deleted file mode 100644 index 71f5720d1bc66a13f5b822c61c4932aa717abf70..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_InnerRingNested.gml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.1_Ring1 - _Simple_BD.1_PG.1_Ring2 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_InteriorDisconnected.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_InteriorDisconnected.gml deleted file mode 100644 index 580a6efb54a44c95078331f21e0e6c9266738749..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_InteriorDisconnected.gml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_IntersectingRings.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_IntersectingRings.gml deleted file mode 100644 index 4acb0908ce8c823d86610b189a68c157da7bc853..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_IntersectingRings.gml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.1_Ring1 - _Simple_BD.1_PG.1_Ring2 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_MultipleConnectedComponents.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_MultipleConnectedComponents.gml deleted file mode 100644 index 87ae4d3964d2b434399cdd7b9864fceeba015adb..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_MultipleConnectedComponents.gml +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - _Simple_BD.1_Geom1 - - - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.2 - - - _Simple_BD.1_PG.3 - _Simple_BD.1_PG.4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldEdge.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldEdge.gml deleted file mode 100644 index c0c52b980e66b19d8e5e3bd5dbda2b55ed726e65..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldEdge.gml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - _Simple_BD.1_Geom1 - - - 10.0 1.0 2.0 - 11.0 2.0 3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldVertex.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldVertex.gml deleted file mode 100644 index 78ab1d33024611a5664300382bd170328bdd9082..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonManifoldVertex.gml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - _Simple_BD.1_Geom1 - 1.0 2.0 3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonDistancePlane.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonDistancePlane.gml deleted file mode 100644 index df2c5d462a5f90240e89759dae219064e4a5f91d..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonDistancePlane.gml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - 1.0 2.0 3.0 - 0.001 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonNormalsDeviation.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonNormalsDeviation.gml deleted file mode 100644 index 07af13edfd41f9c902dfa77e838649e46bb65364..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_NonPlanarPolygonNormalsDeviation.gml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_OrientationRingsSame.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_OrientationRingsSame.gml deleted file mode 100644 index a5dfffece245fbd7933775498c535044bf49271c..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_OrientationRingsSame.gml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.1_Ring1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_PolygonWrongOrientation.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_PolygonWrongOrientation.gml deleted file mode 100644 index 2ef9c8794665180a1f8d98fc3a9dd4aab00236da..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_PolygonWrongOrientation.gml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - _Simple_BD.1_Geom1 - - - 10.0 1.0 2.0 - 11.0 2.0 3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingNotClosed.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingNotClosed.gml deleted file mode 100644 index f01906282f981e46b3146ce76cc3257858a69a8d..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingNotClosed.gml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.6_LR.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingSelfIntersection.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingSelfIntersection.gml deleted file mode 100644 index 5b036f2ca8783e3b90e7b872a6630238731c5529..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_RingSelfIntersection.gml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.6_LR.1 - POINT_TOUCHES_EDGE - - 10.0 11.0 12.0 - 11.0 4.0 0.0 - - 5.0 6.0 7.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidNotClosed.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidNotClosed.gml deleted file mode 100644 index 9e1267269e03eb3acb3da7c2c1ffe5ac5960500e..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidNotClosed.gml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - _Simple_BD.1_Geom1 - - - 10.0 1.0 2.0 - 11.0 2.0 3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidSelfIntersection.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidSelfIntersection.gml deleted file mode 100644 index 6d55c8adfb63d4423c953369d8ff5c810894d262..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_SolidSelfIntersection.gml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - _Simple_BD.1_Geom1 - _Simple_BD.1_PG.1 - _Simple_BD.1_PG.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPoints.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPoints.gml deleted file mode 100644 index 244901c92c5571a3fd3a5a9c15f65504235c7251..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPoints.gml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - _Simple_BD.1_PG.6_LR.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPolygons.gml b/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPolygons.gml deleted file mode 100644 index af5412489646970541fa822d2524b385e6ff3116..0000000000000000000000000000000000000000 --- a/citygml4j-quality-ade/src/test/resources/SimpleSolid_TooFewPolygons.gml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - _Simple_BD.1_Geom1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0 15.0 0.0 - 13.0 15.0 3.0 - 13.0 10.0 3.0 - 13.0 10.0 0.0 - 13.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 15.0 0.0 - 10.0 15.0 3.0 - 11.5 15.0 4.5 - 13.0 15.0 3.0 - 13.0 15.0 0.0 - 10.0 15.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 10.0 15.0 3.0 - 10.0 15.0 0.0 - 10.0 10.0 0.0 - 10.0 10.0 3.0 - - - - - - - - - - - - - - - - - - - 13.0 10.0 0.0 - 13.0 10.0 3.0 - 11.5 10.0 4.5 - 10.0 10.0 3.0 - 10.0 10.0 0.0 - 13.0 10.0 0.0 - - - - - - - - - - - - - - - - - - - 10.0 10.0 3.0 - 11.5 10.0 4.5 - 11.5 10.0 4.5 - 11.5 15.0 4.5 - 10.0 15.0 3.0 - 10.0 10.0 3.0 - - - - - - - - - - - - 11.5 10.0 4.5 - 13.0 10.0 3.0 - 13.0 15.0 3.0 - 11.5 15.0 4.5 - 11.5 10.0 4.5 - - - - - - - - - - - - - - - - - - - 10.0 10.0 0.0 - 10.0 15.0 0.0 - 13.0 15.0 0.0 - 13.0 10.0 0.0 - 10.0 10.0 0.0 - - - - - - - - - - - - - 2002-05-30T09:00:00 - CityDoctor2 - - - 8 - 0.0001 - - - - - - - - - distance - 0.01 - 1 - 0.0000 - - - - - - - - - - - - - - - - - BUILDING - TRANSPORTATION - VEGETATION - BRIDGE - WATER - LAND - - - - 1 - 0 - 0 - 0 - 0 - 0 - - 1 - - - - \ No newline at end of file diff --git a/public/0.1.4/qualityAde.xsd b/public/0.1.4/qualityAde.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0362e46c4c05e506b0bcfa717c2e7737306e4c26 --- /dev/null +++ b/public/0.1.4/qualityAde.xsd @@ -0,0 +1,658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +