it.uniroma2.art.sheet2rdf.header.NodeConversion Maven / Gradle / Ivy
package it.uniroma2.art.sheet2rdf.header;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import it.uniroma2.art.sheet2rdf.coda.CODAConverter;
public class NodeConversion {
private String nodeId; //id of the node produced by the conversion
private CODAConverter converter;
private boolean memoize = false;
public String getNodeId() {
return nodeId;
}
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
public CODAConverter getConverter() {
return converter;
}
public void setConverter(CODAConverter converter) {
this.converter = converter;
}
public boolean isMemoize() {
return memoize;
}
public void setMemoize(boolean memoize) {
this.memoize = memoize;
}
/**
* Check if the node conversion contains a reference to another node id in its converter.
* This is useful in order to avoid the serialization in the pearl of a node definition that contains a reference
* to another node still not defined
* @return
*/
public boolean containsNodeReference() {
return converter.containsNodeReference();
}
public JsonNode toJson() {
return new ObjectMapper().valueToTree(this);
}
public String toString() {
String s = "";
s += "nodeId:\t" + this.nodeId + "\n";
s += "conv:\n" + this.converter + "\n";
s += "memo:\t" + this.memoize;
return s;
}
}