public final class PathedURL extends MultiFormatMapper {
private final UrlBuilder urlBuilder;
- private final JsonParser parser;
private final Loader loader;
private boolean includeUrl = false;
public PathedURL(Loader loader, UrlBuilder urlBuilder) throws AAIException {
this.urlBuilder = urlBuilder;
- this.parser = new JsonParser();
this.loader = loader;
}
public PathedURL(Builder builder) {
this.urlBuilder = builder.getUrlBuilder();
- this.parser = new JsonParser();
this.loader = builder.getLoader();
this.isTree = builder.isTree();
this.includeUrl = builder.isIncludeUrl();
searchResult.setValue("resource-version", v.value(AAIProperties.RESOURCE_VERSION));
final String json = searchResult.marshal(false);
- return Optional.of(this.parser.parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
throw new RuntimeException("Fatal error - result-data does not exist!", e);