in src/main/java/org/apache/sling/feature/ExecutionEnvironmentExtension.java [76:104]
private ExecutionEnvironmentExtension(final JsonStructure structure) {
// get framework
final JsonValue fwk = structure.asJsonObject().getOrDefault("framework", null);
if ( fwk != null ) {
this.framework = new Artifact(fwk);
} else {
this.framework = null;
}
// get version
final JsonValue jv = structure.asJsonObject().getOrDefault("javaVersion", null);
if ( jv != null ) {
if ( jv.getValueType() != ValueType.STRING ) {
throw new IllegalArgumentException("javaVersion is not of type String");
}
this.javaVersion = Version.parseVersion(((JsonString)jv).getString());
} else {
this.javaVersion = null;
}
// get options
final JsonValue jo = structure.asJsonObject().getOrDefault("javaOptions", null);
if ( jo != null ) {
if ( jo.getValueType() != ValueType.STRING ) {
throw new IllegalArgumentException("javaOptions is not of type String");
}
this.javaOptions = ((JsonString)jo).getString();
} else {
this.javaOptions = null;
}
}