@Test public void testReadFromReader() throws IOException { TopicMapIF tm = new JTMTopicMapReader(new FileReader(file), locator).read(); Assert.assertNotNull(tm); Assert.assertEquals(1, tm.getTopics().size()); }
@Override protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException { TopicMapStoreIF store = store_factory.createStore(); TopicMapIF topicmap = store.getTopicMap(); if ((store instanceof AbstractTopicMapStore) && store.getBaseAddress() == null) ((AbstractTopicMapStore) store).setBaseAddress(getBaseAddress()); try (Reader reader = makeReader((String) null, new JTMEncodingSniffer())) { JTMStreamingParser parser = new JTMStreamingParser(topicmap); parser.parse(reader); } catch (JTMException e) { throw new IOException("Could not deserialize JTM fragment: " + e.getMessage()); } ClassInstanceUtils.resolveAssociations2(topicmap); return topicmap; }
JTMTopicMapReader extends AbstractTopicMapReader { @Override protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException { TopicMapStoreIF store = store_factory.createStore(); TopicMapIF topicmap = store.getTopicMap(); if ((store instanceof AbstractTopicMapStore) && store.getBaseAddress() == null) ((AbstractTopicMapStore) store).setBaseAddress(getBaseAddress()); try (Reader reader = makeReader((String) null, new JTMEncodingSniffer())) { JTMStreamingParser parser = new JTMStreamingParser(topicmap); parser.parse(reader); } catch (JTMException e) { throw new IOException("Could not deserialize JTM fragment: " + e.getMessage()); } ClassInstanceUtils.resolveAssociations2(topicmap); return topicmap; } }
JTMTopicMapReader extends AbstractTopicMapReader { @Override protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException { TopicMapStoreIF store = store_factory.createStore(); TopicMapIF topicmap = store.getTopicMap(); if ((store instanceof AbstractTopicMapStore) && store.getBaseAddress() == null) ((AbstractTopicMapStore) store).setBaseAddress(getBaseAddress()); try (Reader reader = makeReader((String) null, new JTMEncodingSniffer())) { JTMStreamingParser parser = new JTMStreamingParser(topicmap); parser.parse(reader); } catch (JTMException e) { throw new IOException("Could not deserialize JTM fragment: " + e.getMessage()); } ClassInstanceUtils.resolveAssociations2(topicmap); return topicmap; } JTMTopicMapReader(URL url);  JTMTopicMapReader(Reader reader, LocatorIF base_address);  JTMTopicMapReader(InputStream stream, LocatorIF base_address);  JTMTopicMapReader(File file); }
JTMTopicMapReader extends AbstractTopicMapReader { @Override protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException { TopicMapStoreIF store = store_factory.createStore(); TopicMapIF topicmap = store.getTopicMap(); if ((store instanceof AbstractTopicMapStore) && store.getBaseAddress() == null) ((AbstractTopicMapStore) store).setBaseAddress(getBaseAddress()); try (Reader reader = makeReader((String) null, new JTMEncodingSniffer())) { JTMStreamingParser parser = new JTMStreamingParser(topicmap); parser.parse(reader); } catch (JTMException e) { throw new IOException("Could not deserialize JTM fragment: " + e.getMessage()); } ClassInstanceUtils.resolveAssociations2(topicmap); return topicmap; } JTMTopicMapReader(URL url);  JTMTopicMapReader(Reader reader, LocatorIF base_address);  JTMTopicMapReader(InputStream stream, LocatorIF base_address);  JTMTopicMapReader(File file);  }
JTMTopicMapReader extends AbstractTopicMapReader { @Override protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException { TopicMapStoreIF store = store_factory.createStore(); TopicMapIF topicmap = store.getTopicMap(); if ((store instanceof AbstractTopicMapStore) && store.getBaseAddress() == null) ((AbstractTopicMapStore) store).setBaseAddress(getBaseAddress()); try (Reader reader = makeReader((String) null, new JTMEncodingSniffer())) { JTMStreamingParser parser = new JTMStreamingParser(topicmap); parser.parse(reader); } catch (JTMException e) { throw new IOException("Could not deserialize JTM fragment: " + e.getMessage()); } ClassInstanceUtils.resolveAssociations2(topicmap); return topicmap; } JTMTopicMapReader(URL url);  JTMTopicMapReader(Reader reader, LocatorIF base_address);  JTMTopicMapReader(InputStream stream, LocatorIF base_address);  JTMTopicMapReader(File file);   }