Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
8129283a
Commit
8129283a
authored
Dec 02, 2025
by
Luna Riegel
Browse files
Feat: Implement PicoCLI interface
parent
63e0db04
Changes
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/CityDoctorValidationCLI.java
View file @
8129283a
package
de.hft.stuttgart.citydoctor2
;
import
java.util.concurrent.Callable
;
import
de.hft.stuttgart.citydoctor2.check.ValidationConfiguration
;
import
de.hft.stuttgart.citydoctor2.exceptions.CityDoctorWriteException
;
import
de.hft.stuttgart.citydoctor2.parser.CityGmlParseException
;
import
de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException
;
import
picocli.CommandLine
;
import
picocli.CommandLine.Command
;
import
picocli.CommandLine.Option
;
import
java.io.File
;
import
java.io.IOException
;
@Command
(
name
=
"citydoctor2"
,
mixinStandardHelpOptions
=
true
,
description
=
"Validates CityGML files according to a provided validation-plan."
)
public
class
CityDoctorValidationCLI
implements
Callable
<
Integer
>
{
public
class
CityDoctorValidationCLI
implements
Runnable
{
@Option
(
names
=
{
"-i"
,
"--in"
,
"--input"
},
description
=
"Filepath of the CityGML file."
,
...
...
@@ -15,23 +22,41 @@ public class CityDoctorValidationCLI implements Callable<Integer> {
@Option
(
names
=
{
"-c"
,
"--config"
,
"--configuration"
,
"--plan"
},
description
=
"Filepath of the validation configuration .yml"
,
required
=
true
)
private
String
config
;
defaultValue
=
Option
.
NULL_VALUE
)
private
File
config
;
@Option
(
names
=
{
"-x"
,
"--xml"
,
"--xmlReport"
},
description
=
"Create a XML validation report at target location"
)
description
=
"Create a XML validation report at target location"
,
defaultValue
=
Option
.
NULL_VALUE
)
private
String
xmlReport
;
@Option
(
names
=
{
"-p"
,
"--pdf"
,
"--pdfReport"
},
description
=
"Create a PDF validation report at target location"
)
description
=
"Create a PDF validation report at target location"
,
defaultValue
=
Option
.
NULL_VALUE
)
private
String
pdfReport
;
@Option
(
names
=
{
"-o"
,
"--out"
,
"--output"
},
description
=
"Create a validated copy of the CityGML input with QualityADE at target location."
)
description
=
"Create a validated copy of the CityGML input with QualityADE at target location."
,
defaultValue
=
Option
.
NULL_VALUE
)
private
String
output
;
@Override
public
Integer
call
()
throws
Exception
{
return
0
;
public
void
run
(){
try
{
ValidationConfiguration
valConfig
;
if
(
config
==
null
){
valConfig
=
ValidationConfiguration
.
loadStandardValidationConfig
();
}
else
{
valConfig
=
ValidationConfiguration
.
loadValidationConfig
(
config
.
getAbsolutePath
());
}
CityDoctorValidation
.
startValidationProcess
(
input
,
xmlReport
,
pdfReport
,
valConfig
,
output
);
}
catch
(
CityDoctorWriteException
|
CityGmlParseException
|
IOException
|
InvalidGmlFileException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
public
static
void
main
(
String
[]
args
)
{
int
exitCode
=
new
CommandLine
(
new
CityDoctorValidationCLI
()).
execute
(
args
);
System
.
exit
(
exitCode
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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