All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.uniroma2.art.sheet2rdf.header.NodeConversion Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version
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;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy