test_class.declarator: graphMLDocStart =
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
            + "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
            + "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">"
test_class.modifier: static final
test_class.original_string: static final String graphMLDocStart =
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
            + "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
            + "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">";
test_class.type: String
test_class.var_name: graphMLDocStart
test_class.declarator: reader
test_class.modifier: private
test_class.original_string: private GraphMLReader2<MutableNetwork<DummyNode, DummyEdge>, DummyNode, DummyEdge> reader;
test_class.type: GraphMLReader2<MutableNetwork<DummyNode, DummyEdge>, DummyNode, DummyEdge>
test_class.var_name: reader
test_class.file: jung-io/src/test/java/edu/uci/ics/jung/io/graphml/TestGraphMLReader2.java
test_class.identifier: TestGraphMLReader2
test_case.body: @Test(expected = GraphIOException.class)
    public void testEdgeWithInvalidNode() throws Exception {
  
      String xml =
          graphMLDocStart
              + "<key id=\"d0\" for=\"node\" attr.name=\"color\" attr.type=\"string\">"
              + "<default>yellow</default>"
              + "</key>"
              + "<key id=\"d1\" for=\"edge\" attr.name=\"weight\" attr.type=\"double\"/>"
              + "<graph id=\"G\" edgedefault=\"undirected\">"
              + "<node id=\"n0\">"
              + "<data key=\"d0\">green</data>"
              + "</node>"
              + "<node id=\"n1\"/>"
              + "<node id=\"n2\">"
              + "<data key=\"d0\">blue</data>"
              + "</node>"
              + "<edge id=\"e0\" source=\"n0\" target=\"n3\">"
              + // Invalid
              // node: n3
              "<data key=\"d1\">1.0</data>"
              + "</edge>"
              + "</graphml>";
  
      readGraph(
          xml,
          new DummyGraphObjectBase.UndirectedNetworkFactory(),
          new DummyNode.Factory(),
          new DummyEdge.EdgeFactory()); // , new DummyEdge.HyperEdgeFactory());
    }
test_case.class_method_signature: TestGraphMLReader2.testEdgeWithInvalidNode()
test_case.full_signature: @Test(expected = GraphIOException.class) public void testEdgeWithInvalidNode()
test_case.identifier: testEdgeWithInvalidNode
test_case.invocations: readGraph
test_case.modifiers: @Test(expected = GraphIOException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEdgeWithInvalidNode()
focal_class.declarator: xmlEventReader
focal_class.modifier: protected
focal_class.original_string: protected XMLEventReader xmlEventReader;
focal_class.type: XMLEventReader
focal_class.var_name: xmlEventReader
focal_class.declarator: fileReader
focal_class.modifier: protected
focal_class.original_string: protected Reader fileReader;
focal_class.type: Reader
focal_class.var_name: fileReader
focal_class.declarator: graphTransformer
focal_class.modifier: protected
focal_class.original_string: protected Function<GraphMetadata, G> graphTransformer;
focal_class.type: Function<GraphMetadata, G>
focal_class.var_name: graphTransformer
focal_class.declarator: nodeTransformer
focal_class.modifier: protected
focal_class.original_string: protected Function<NodeMetadata, N> nodeTransformer;
focal_class.type: Function<NodeMetadata, N>
focal_class.var_name: nodeTransformer
focal_class.declarator: edgeTransformer
focal_class.modifier: protected
focal_class.original_string: protected Function<EdgeMetadata, E> edgeTransformer;
focal_class.type: Function<EdgeMetadata, E>
focal_class.var_name: edgeTransformer
focal_class.declarator: initialized
focal_class.modifier: protected
focal_class.original_string: protected boolean initialized;
focal_class.type: boolean
focal_class.var_name: initialized
focal_class.declarator: document = new GraphMLDocument()
focal_class.modifier: protected final
focal_class.original_string: protected final GraphMLDocument document = new GraphMLDocument();
focal_class.type: GraphMLDocument
focal_class.var_name: document
focal_class.declarator: parserRegistry
focal_class.modifier: protected final
focal_class.original_string: protected final ElementParserRegistry<G, N, E> parserRegistry;
focal_class.type: ElementParserRegistry<G, N, E>
focal_class.var_name: parserRegistry
focal_class.declarator: inputStream
focal_class.modifier: private
focal_class.original_string: private InputStream inputStream;
focal_class.type: InputStream
focal_class.var_name: inputStream
focal_class.file: jung-io/src/main/java/edu/uci/ics/jung/io/graphml/GraphMLReader2.java
focal_class.identifier: GraphMLReader2
focal_class.interfaces: implements GraphReader<G, N, E>
focal_class.class_method_signature: GraphMLReader2.GraphMLReader2(
        Reader fileReader,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.full_signature: public  GraphMLReader2(
        Reader fileReader,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.identifier: GraphMLReader2
focal_class.modifiers: public
focal_class.parameters: (
        Reader fileReader,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.signature:  GraphMLReader2(
        Reader fileReader,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.class_method_signature: GraphMLReader2.GraphMLReader2(
        InputStream inputStream,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.full_signature: public  GraphMLReader2(
        InputStream inputStream,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.identifier: GraphMLReader2
focal_class.modifiers: public
focal_class.parameters: (
        InputStream inputStream,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.signature:  GraphMLReader2(
        InputStream inputStream,
        Function<GraphMetadata, G> graphTransformer,
        Function<NodeMetadata, N> nodeTransformer,
        Function<EdgeMetadata, E> edgeTransformer)
focal_class.class_method_signature: GraphMLReader2.getGraphTransformer()
focal_class.full_signature: public Function<GraphMetadata, G> getGraphTransformer()
focal_class.identifier: getGraphTransformer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Function<GraphMetadata, G>
focal_class.signature: Function<GraphMetadata, G> getGraphTransformer()
focal_class.class_method_signature: GraphMLReader2.getNodeTransformer()
focal_class.full_signature: public Function<NodeMetadata, N> getNodeTransformer()
focal_class.identifier: getNodeTransformer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Function<NodeMetadata, N>
focal_class.signature: Function<NodeMetadata, N> getNodeTransformer()
focal_class.class_method_signature: GraphMLReader2.getEdgeTransformer()
focal_class.full_signature: public Function<EdgeMetadata, E> getEdgeTransformer()
focal_class.identifier: getEdgeTransformer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Function<EdgeMetadata, E>
focal_class.signature: Function<EdgeMetadata, E> getEdgeTransformer()
focal_class.class_method_signature: GraphMLReader2.init()
focal_class.full_signature: public void init()
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: GraphMLReader2.close()
focal_class.full_signature: public void close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: GraphMLReader2.getGraphMLDocument()
focal_class.full_signature: public GraphMLDocument getGraphMLDocument()
focal_class.identifier: getGraphMLDocument
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GraphMLDocument
focal_class.signature: GraphMLDocument getGraphMLDocument()
focal_class.class_method_signature: GraphMLReader2.readGraph()
focal_class.full_signature: @SuppressWarnings("unchecked") public G readGraph()
focal_class.identifier: readGraph
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: ()
focal_class.return: G
focal_class.signature: G readGraph()
focal_method.body: @SuppressWarnings("unchecked")
    public G readGraph() throws GraphIOException {
  
      try {
  
        // Initialize if not already.
        init();
  
        while (xmlEventReader.hasNext()) {
  
          XMLEvent event = xmlEventReader.nextEvent();
          if (event.isStartElement()) {
            StartElement element = (StartElement) event;
            String name = element.getName().getLocalPart();
  
            // The element should be one of: key, graph, graphml
            if (GraphMLConstants.KEY_NAME.equals(name)) {
  
              // Parse the key object.
              Key key = (Key) parserRegistry.getParser(name).parse(xmlEventReader, element);
  
              // Add the key to the key map.
              document.getKeyMap().addKey(key);
  
            } else if (GraphMLConstants.GRAPH_NAME.equals(name)) {
  
              // Parse the graph.
              GraphMetadata graph =
                  (GraphMetadata) parserRegistry.getParser(name).parse(xmlEventReader, element);
  
              // Add it to the graph metadata list.
              document.getGraphMetadata().add(graph);
  
              // Return the graph object.
              return (G) graph.getGraph();
  
            } else if (GraphMLConstants.GRAPHML_NAME.equals(name)) {
              // Ignore the graphML object.
            } else {
  
              // Encounted an unknown element - just skip by it.
              parserRegistry.getUnknownElementParser().parse(xmlEventReader, element);
            }
  
          } else if (event.isEndDocument()) {
            break;
          }
        }
  
      } 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");
    }
focal_method.class_method_signature: GraphMLReader2.readGraph()
focal_method.full_signature: @SuppressWarnings("unchecked") public G readGraph()
focal_method.identifier: readGraph
focal_method.invocations: init hasNext nextEvent isStartElement getLocalPart getName equals parse getParser addKey getKeyMap equals parse getParser add getGraphMetadata getGraph equals parse getUnknownElementParser isEndDocument convert
focal_method.modifiers: @SuppressWarnings("unchecked") public
focal_method.parameters: ()
focal_method.return: G
focal_method.signature: G readGraph()