gpt4 book ai didi

net.ontopia.topicmaps.xml.XTMTopicMapReader.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 20:31:40 27 4
gpt4 key购买 nike

本文整理了Java中net.ontopia.topicmaps.xml.XTMTopicMapReader.<init>()方法的一些代码示例,展示了XTMTopicMapReader.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XTMTopicMapReader.<init>()方法的具体详情如下:
包路径:net.ontopia.topicmaps.xml.XTMTopicMapReader
类名称:XTMTopicMapReader
方法名:<init>

XTMTopicMapReader.<init>介绍

[英]PUBLIC: Creates a topic map reader bound to the file given in the arguments.
[中]PUBLIC:创建绑定到参数中给定文件的主题图读取器。

代码示例

代码示例来源:origin: ontopia/ontopia

@Override
protected TopicMapReaderIF getFragmentReader(InputStream stream, LocatorIF base_address) {
  return new XTMTopicMapReader(stream, base_address);
}

代码示例来源:origin: ontopia/ontopia

private void loadXTM(String request, String params, boolean compress,
           TopicMapIF topicmap)
 throws IOException {
 InputSource src = getInputSource(request, params, compress);
 String baseuri = viewBaseuri == null ? editBaseuri : viewBaseuri;
 LocatorIF base = new URILocator(baseuri + request);
 XTMTopicMapReader reader = new XTMTopicMapReader(src, base);
 reader.setExternalReferenceHandler(new NullResolvingExternalReferenceHandler());
 reader.setValidation(false); // means we don't need Jing
 reader.importInto(topicmap);
}

代码示例来源:origin: ontopia/ontopia

@Override
protected void setUp() {
 if (tm == null) {
  try {
   TopicMapReaderIF reader =
    new XTMTopicMapReader(TestFileUtils.getTestInputURL(testdataDirectory, "package-test.xtm"));
   tm = reader.read();
   base = tm.getStore().getBaseAddress();
  }
  catch (java.io.IOException e) {
   throw new RuntimeException("IMPOSSIBLE ERROR! " + e.getMessage());
  }
 }
}

代码示例来源:origin: ontopia/ontopia

protected TopicMapIF readTopicMap(String dir, String filename)
  throws IOException {
 filename = TestFileUtils.getTestInputFile(dir, filename);
 return new XTMTopicMapReader(TestFileUtils.getTestInputURL(filename)).read();
}

代码示例来源:origin: ontopia/ontopia

private void reload(boolean validate) throws IOException {
 export();
 XTMTopicMapReader reader = new XTMTopicMapReader(tmfile);
 reader.setValidation(validate);
 topicmap = reader.read();
}

代码示例来源:origin: net.ontopia/ontopia-tmrap

private void loadXTM(String request, String params, boolean compress,
           TopicMapIF topicmap)
 throws IOException {
 InputSource src = getInputSource(request, params, compress);
 String baseuri = viewBaseuri == null ? editBaseuri : viewBaseuri;
 LocatorIF base = new URILocator(baseuri + request);
 XTMTopicMapReader reader = new XTMTopicMapReader(src, base);
 reader.setExternalReferenceHandler(new NullResolvingExternalReferenceHandler());
 reader.setXMLReaderFactory(xmlReaderFactory);
 reader.setValidation(false); // means we don't need Jing
 reader.importInto(topicmap);
}

代码示例来源:origin: ontopia/ontopia

protected TopicMapIF readTopicMap(String dir, String subdir, String filename)
  throws IOException {
 filename = TestFileUtils.getTestInputFile(dir, subdir, filename);
 return new XTMTopicMapReader(TestFileUtils.getTestInputURL(filename)).read();
}

代码示例来源:origin: ontopia/ontopia

private TopicMapIF load(String dir, String file) throws IOException {
  return new XTMTopicMapReader(TestFileUtils.getTestInputURL(TestFileUtils.getTestInputFile(dir, file))).read();
 }
}

代码示例来源:origin: ontopia/ontopia

@Override
protected void setUp() {
 XTMTopicMapReader reader  = null;
 try {
  reader = new XTMTopicMapReader(TestFileUtils.getTestInputURL("various", "stats.xtm"));
  tm = reader.read();
 } catch (IOException e) {
  fail("Error reading file\n" + e);
 }
}

代码示例来源:origin: ontopia/ontopia

@Test
public void testReadFromInputSource() throws IOException {
 TestFileUtils.transferTestInputDirectory("various");
 File file = TestFileUtils.getTransferredTestInputFile("various", "jill.xtm");
 TopicMapIF tm = new XTMTopicMapReader(new InputSource(new FileReader(file)), new URILocator(file)).read();
 Assert.assertNotNull(tm);
 Assert.assertEquals(39, tm.getTopics().size());
}

代码示例来源:origin: ontopia/ontopia

@Test
public void testReadFromReader() throws IOException {
 TestFileUtils.transferTestInputDirectory("various");
 File file = TestFileUtils.getTransferredTestInputFile("various", "jill.xtm");
 TopicMapIF tm = new XTMTopicMapReader(new FileReader(file), new URILocator(file)).read();
 Assert.assertNotNull(tm);
 Assert.assertEquals(39, tm.getTopics().size());
}

代码示例来源:origin: ontopia/ontopia

protected Collection readTopicMaps(String filename) throws IOException {
 filename = TestFileUtils.getTestInputFile(testdataDirectory, "in", filename);
 XTMTopicMapReader reader = new XTMTopicMapReader(TestFileUtils.getTestInputURL(filename));
 reader.setValidation(false);
 return reader.readAll();
}

代码示例来源:origin: ontopia/ontopia

@Test
public void testReadFromInputStream() throws IOException {
 TestFileUtils.transferTestInputDirectory("various");
 File file = TestFileUtils.getTransferredTestInputFile("various", "jill.xtm");
 TopicMapIF tm = new XTMTopicMapReader(new FileInputStream(file), new URILocator(file)).read();
 Assert.assertNotNull(tm);
 Assert.assertEquals(39, tm.getTopics().size());
}

代码示例来源:origin: ontopia/ontopia

@Test
public void testReadFromURL() throws IOException {
 TopicMapIF tm = new XTMTopicMapReader(TestFileUtils.getTestInputURL("various", "jill.xtm")).read();
 Assert.assertNotNull(tm);
 Assert.assertEquals(39, tm.getTopics().size());
 
}

代码示例来源:origin: ontopia/ontopia

@Test
public void testReadFromFile() throws IOException {
 TestFileUtils.transferTestInputDirectory("various");
 TopicMapIF tm = new XTMTopicMapReader(TestFileUtils.getTransferredTestInputFile("various", "jill.xtm")).read();
 Assert.assertNotNull(tm);
 Assert.assertEquals(39, tm.getTopics().size());
}

代码示例来源:origin: ontopia/ontopia

protected CountingRefHandler readTestFile(String fileName) {
 CountingRefHandler extRefHandler = new CountingRefHandler();
 try {
  String testfile = TestFileUtils.getTestInputFile(testdataDirectory, fileName);
  XTMTopicMapReader reader = new XTMTopicMapReader(TestFileUtils.getTestInputURL(testfile));
  reader.setExternalReferenceHandler(extRefHandler);
  reader.read();
 } catch (MalformedURLException ex) {
  Assert.fail("MalformedURLException initialising base address of test file.");
 } catch (IOException ex) {
  Assert.fail("IOException parsing test file." + ex.toString());
 }
 return extRefHandler;
}

代码示例来源:origin: ontopia/ontopia

protected TopicMapIF readTopicMap(String filename) throws IOException {
 filename = TestFileUtils.getTestInputFile(testdataDirectory, "in", filename);
 XTMTopicMapReader reader = new XTMTopicMapReader(TestFileUtils.getTestInputURL(filename));
 reader.setValidation(false);
 TopicMapIF tm = reader.read();
 Assert.assertTrue(
   "attempting to read second (non-existent) topic map did not give null",
   reader.read() == null);
 return tm;
}

代码示例来源:origin: ontopia/ontopia

@Override
protected void canonicalize(URL infile, File outfile)
 throws IOException {
 TopicMapStoreFactoryIF sfactory = getStoreFactory();
 XTMTopicMapReader reader = new XTMTopicMapReader(infile);
 reader.setValidation(false);
 // FIXME: should we do a setXTM2Required(true) or something?
 reader.setStoreFactory(sfactory);
 TopicMapIF source = reader.read();
 CanonicalXTMWriter cwriter = new CanonicalXTMWriter(outfile);
 cwriter.write(source);
 source.getStore().close();
}

代码示例来源:origin: ontopia/ontopia

@Override
protected void canonicalize(URL infile, File outfile)
 throws IOException {
 TopicMapStoreFactoryIF sfactory = getStoreFactory();
 XTMTopicMapReader reader = new XTMTopicMapReader(infile);
 reader.setValidation(false);
 // FIXME: should we do a setXTM2Required(true) or something?
 reader.setStoreFactory(sfactory);
 TopicMapIF source = reader.read();
 CanonicalXTMWriter cwriter = new CanonicalXTMWriter(outfile);
 cwriter.write(source);
 source.getStore().close();
}

代码示例来源:origin: ontopia/ontopia

@Override
protected void canonicalize(URL infile, File outfile) throws IOException {
 TopicMapStoreFactoryIF sfactory = getStoreFactory();
 XTMTopicMapReader reader = new XTMTopicMapReader(infile);
 reader.setValidation(false);
 reader.setStoreFactory(sfactory);
 TopicMapIF source = reader.read();
 CanonicalTopicMapWriter cwriter = new CanonicalTopicMapWriter(outfile);
 cwriter.setBaseLocator(new URILocator(infile));
 cwriter.write(source);
 source.getStore().close();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com