Commit d01140fb authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Added support to LinkNode in NodeUtils

parent 241471ca
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import net.ivoa.xml.vospace.v2.ContainerNode;
import net.ivoa.xml.vospace.v2.DataNode;
import net.ivoa.xml.vospace.v2.LinkNode;
import net.ivoa.xml.vospace.v2.StructuredDataNode;

public class NodeUtils {
@@ -190,6 +191,8 @@ public class NodeUtils {
            return "container";
        } else if (node instanceof DataNode) {
            return "data";
        } else if (node instanceof LinkNode) {
            return "link";
        }
        throw new UnsupportedOperationException("Unable to retrieve database node type for class " + node.getClass().getCanonicalName());
    }
@@ -228,6 +231,9 @@ public class NodeUtils {
            case "structured":
                node = new StructuredDataNode();
                break;
            case "link":
                node = new LinkNode();
                break;
            default:
                throw new UnsupportedOperationException("Node type " + type + " not supported yet");
        }