Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
QualityADE
Commits
38715130
Commit
38715130
authored
Feb 02, 2023
by
Matthias Betz
Browse files
Merge branch 'citygml3'
parents
6cf1abce
bd8f73de
Pipeline
#7210
passed with stage
in 7 seconds
Changes
191
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/PolygonIdListPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
PolygonIdListProperty
>
{
@Override
public
PolygonIdListProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
PolygonIdListProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/RequirementPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
RequirementProperty
>
{
@Override
public
RequirementProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
RequirementProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/StatisticsPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
StatisticsProperty
>
{
@Override
public
StatisticsProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
StatisticsProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPlanPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
ValidationPlanProperty
>
{
@Override
public
ValidationPlanProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
ValidationPlanProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
ValidationProperty
>
{
@Override
public
ValidationProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
ValidationProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/properties/ValidationResultPropertyAdapter.java
0 → 100644
View file @
38715130
/*-
* 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
<
ValidationResultProperty
>
{
@Override
public
ValidationResultProperty
createObject
(
QName
name
,
Object
parent
)
throws
ObjectBuildException
{
return
new
ValidationResultProperty
();
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractErrorAdapter.java
0 → 100644
View file @
38715130
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
<
T
extends
AbstractError
>
implements
ObjectBuilder
<
T
>,
ObjectSerializer
<
T
>
{
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractGeometryErrorAdapter.java
0 → 100644
View file @
38715130
package
de.hft.stuttgart.quality.adapter.types
;
import
de.hft.stuttgart.quality.model.types.AbstractGeometryError
;
public
abstract
class
AbstractGeometryErrorAdapter
<
T
extends
AbstractGeometryError
>
extends
AbstractErrorAdapter
<
T
>
{
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractPolygonErrorAdapter.java
0 → 100644
View file @
38715130
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
<
T
extends
AbstractPolygonError
>
extends
AbstractGeometryErrorAdapter
<
T
>
{
@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
()));
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractRingErrorAdapter.java
0 → 100644
View file @
38715130
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
<
T
extends
AbstractRingError
>
extends
AbstractGeometryErrorAdapter
<
T
>
{
@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
()));
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSemanticErrorAdapter.java
0 → 100644
View file @
38715130
package
de.hft.stuttgart.quality.adapter.types
;
import
de.hft.stuttgart.quality.model.types.AbstractSemanticError
;
public
abstract
class
AbstractSemanticErrorAdapter
<
T
extends
AbstractSemanticError
>
extends
AbstractErrorAdapter
<
T
>
{
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AbstractSolidErrorAdapter.java
0 → 100644
View file @
38715130
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
<
T
extends
AbstractSolidError
>
extends
AbstractGeometryErrorAdapter
<
T
>
{
@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
()));
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/AllPolygonsOrientedWrongErrorAdapter.java
0 → 100644
View file @
38715130
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
<
AllPolygonsOrientedWrongError
>
{
@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"
);
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CheckingAdapter.java
0 → 100644
View file @
38715130
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
<
Checking
>,
ObjectSerializer
<
Checking
>
{
@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
()));
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/CityObjectPropertiesAdapter.java
0 → 100644
View file @
38715130
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
<
CityObjectProperties
>,
ObjectSerializer
<
CityObjectProperties
>
{
@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
);
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ConsecutivePointsSameErrorAdapter.java
0 → 100644
View file @
38715130
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
<
ConsecutivePointsSameError
>
{
@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
);
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeAdapter.java
0 → 100644
View file @
38715130
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
<
Edge
>,
ObjectSerializer
<
Edge
>
{
@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
);
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/EdgeListAdapter.java
0 → 100644
View file @
38715130
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
<
EdgeList
>,
ObjectSerializer
<
EdgeList
>
{
@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
);
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/ErrorAdapter.java
0 → 100644
View file @
38715130
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
<
Error
>,
ObjectSerializer
<
Error
>
{
@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
()));
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/adapter/types/FeatureStatisticsAdapter.java
0 → 100644
View file @
38715130
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
<
FeatureStatistics
>,
ObjectSerializer
<
FeatureStatistics
>
{
@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
())));
}
}
Prev
1
2
3
4
5
6
…
10
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment