Package edu.uci.ics.jung.io

Examples of edu.uci.ics.jung.io.GraphIOException


            if (fileReader != null) {
                fileReader.close();
            }

        } catch (IOException e) {
            throw new GraphIOException(e);
        } catch (XMLStreamException e) {
            throw new GraphIOException(e);
        } finally {
            fileReader = null;
            xmlEventReader = null;
            graphTransformer = null;
            vertexTransformer = null;
View Full Code Here


        } catch (Exception e) {
            ExceptionConverter.convert(e);
        }

        // We didn't read anything from the document.
        throw new GraphIOException("Unable to read Graph from document - the document could be empty");
    }   
View Full Code Here

        if (e instanceof RuntimeException) {

            // If the cause was an XMLStreamException, throw a GraphReaderException
            if (e.getCause() instanceof XMLStreamException) {
                throw new GraphIOException(e.getCause());
            }

            throw (RuntimeException) e;
        }

        throw new GraphIOException(e);
    }
View Full Code Here

                }
            }

            // Make sure the source and target have been been set.
            if (edge.getSource() == null || edge.getTarget() == null) {
                throw new GraphIOException(
                        "Element 'edge' is missing attribute 'source' or 'target'");
            }

            while (xmlEventReader.hasNext()) {
View Full Code Here

            throws GraphIOException {

        String startName = start.getName().getLocalPart();
        String endName = end.getName().getLocalPart();
        if (!startName.equals(endName)) {
            throw new GraphIOException(
                    "Failed parsing document: Start/end tag mismatch! "
                            + "StartTag:" + startName + ", EndTag: "
                            + endName);
        }
    }
View Full Code Here

                }
            }

            // Make sure the name has been set.
            if (node.getId() == null) {
                throw new GraphIOException(
                        "Element 'node' is missing attribute 'id'");
            }

            while (xmlEventReader.hasNext()) {
View Full Code Here

                }
            }

            // Make sure the graphdefault has been set.
            if (graphMetadata.getEdgeDefault() == null) {
                throw new GraphIOException(
                        "Element 'graph' is missing attribute 'edgedefault'");
            }
           
            Map<String, V> idToVertexMap = new HashMap<String, V>();
            Collection<EdgeMetadata> edgeMetadata = new LinkedList<EdgeMetadata>();
View Full Code Here

           
            // Get the verticies.
            V source = idToVertexMap.get(emd.getSource());
            V target = idToVertexMap.get(emd.getTarget());
            if (source == null || target == null) {
                throw new GraphIOException(
                        "edge references undefined source or target vertex. "
                                + "Source: " + emd.getSource()
                                + ", Target: " + emd.getTarget());
            }
View Full Code Here

            List<V> verticies = new ArrayList<V>();
            List<EndpointMetadata> endpoints = emd.getEndpoints();
            for (EndpointMetadata ep : endpoints) {
                V v = idToVertexMap.get(ep.getNode());
                if (v == null) {
                    throw new GraphIOException(
                            "hyperedge references undefined vertex: "
                                    + ep.getNode());
                }
                verticies.add(v);
            }
View Full Code Here

                }
            }

            // Make sure the key has been set.
            if (data.getKey() == null) {
                throw new GraphIOException(
                        "Element 'data' is missing attribute 'key'");
            }

            while (xmlEventReader.hasNext()) {
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.io.GraphIOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.