Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.databind.ObjectMapper;

/**
* A {@link SPARQLProtocolSession} subclass which extends the standard SPARQL 1.1 Protocol with additional
Expand Down
6 changes: 4 additions & 2 deletions core/query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson3.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;

/**
* This is an experimental feature. It may be changed, moved or potentially removed in a future release.
Expand All @@ -37,7 +38,12 @@ public ExplanationImpl(GenericPlanNode genericPlanNode, boolean timedOut, Object
}
}

ObjectMapper objectMapper = new ObjectMapper();
ObjectMapper objectMapper = JsonMapper.builder()
.changeDefaultVisibility(vc -> vc
.withVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.PUBLIC_ONLY)
.withVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.NONE))
.changeDefaultPropertyInclusion(incl -> incl.withValueInclusion(JsonInclude.Include.NON_NULL))
.build();

@Override
public Object tupleExpr() {
Expand All @@ -51,16 +57,10 @@ public GenericPlanNode toGenericPlanNode() {

@Override
public String toJson() {
try {
// TODO: Consider removing pretty printer
return this.objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.PUBLIC_ONLY)
.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.NONE)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.writerWithDefaultPrettyPrinter()
.writeValueAsString(toGenericPlanNode());
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
// TODO: Consider removing pretty printer
return this.objectMapper
.writerWithDefaultPrettyPrinter()
.writeValueAsString(toGenericPlanNode());
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion core/queryresultio/sparqljson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson3.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
Loading
Loading