Skip to content
Snippets Groups Projects
Commit d01140fb authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Added support to LinkNode in NodeUtils

parent 241471ca
No related branches found
No related tags found
No related merge requests found
Pipeline #2288 passed
...@@ -16,6 +16,7 @@ import java.util.regex.Pattern; ...@@ -16,6 +16,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.ivoa.xml.vospace.v2.ContainerNode; import net.ivoa.xml.vospace.v2.ContainerNode;
import net.ivoa.xml.vospace.v2.DataNode; import net.ivoa.xml.vospace.v2.DataNode;
import net.ivoa.xml.vospace.v2.LinkNode;
import net.ivoa.xml.vospace.v2.StructuredDataNode; import net.ivoa.xml.vospace.v2.StructuredDataNode;
public class NodeUtils { public class NodeUtils {
...@@ -190,6 +191,8 @@ public class NodeUtils { ...@@ -190,6 +191,8 @@ public class NodeUtils {
return "container"; return "container";
} else if (node instanceof DataNode) { } else if (node instanceof DataNode) {
return "data"; return "data";
} else if (node instanceof LinkNode) {
return "link";
} }
throw new UnsupportedOperationException("Unable to retrieve database node type for class " + node.getClass().getCanonicalName()); throw new UnsupportedOperationException("Unable to retrieve database node type for class " + node.getClass().getCanonicalName());
} }
...@@ -228,6 +231,9 @@ public class NodeUtils { ...@@ -228,6 +231,9 @@ public class NodeUtils {
case "structured": case "structured":
node = new StructuredDataNode(); node = new StructuredDataNode();
break; break;
case "link":
node = new LinkNode();
break;
default: default:
throw new UnsupportedOperationException("Node type " + type + " not supported yet"); throw new UnsupportedOperationException("Node type " + type + " not supported yet");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment