Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.FsIndexCollection.resolveImports()


    while (it.hasNext()) {
      FsIndexCollection indexColl = it.next();

      if (indexColl != null) {
        try {
          indexColl.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        FsIndexDescription[] indexes = indexColl.getFsIndexes();
        for (int i = 0; i < indexes.length; i++) {
View Full Code Here


    while (it.hasNext()) {
      FsIndexCollection indexColl = (FsIndexCollection) it.next();

      if (indexColl != null) {
        try {
          indexColl.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        FsIndexDescription[] indexes = indexColl.getFsIndexes();
        for (int i = 0; i < indexes.length; i++) {
View Full Code Here

      assertEquals(2, indexes.length);

      // resolving imports without setting data path should fail
      InvalidXMLException ex = null;
      try {
        ic.resolveImports();
      } catch (InvalidXMLException e) {
        ex = e;
      }
      assertNotNull(ex);
      assertEquals(2, ic.getFsIndexes().length); // should be no side effects when exception is
View Full Code Here

      // set data path correctly and it should work
      ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
      resMgr.setDataPath(JUnitExtension.getFile("FsIndexCollectionImplTest/dataPathDir")
              .getAbsolutePath());
      ic.resolveImports(resMgr);

      indexes = ic.getFsIndexes();
      assertEquals(4, indexes.length);

      // test that circular imports don't crash
View Full Code Here

      assertEquals(4, indexes.length);

      // test that circular imports don't crash
      descriptor = JUnitExtension.getFile("FsIndexCollectionImplTest/Circular1.xml");
      ic = UIMAFramework.getXMLParser().parseFsIndexCollection(new XMLInputSource(descriptor));
      ic.resolveImports();
      assertEquals(2, ic.getFsIndexes().length);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
  }
View Full Code Here

    while (it.hasNext()) {
      FsIndexCollection indexColl = (FsIndexCollection) it.next();

      if (indexColl != null) {
        try {
          indexColl.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        FsIndexDescription[] indexes = indexColl.getFsIndexes();
        for (int i = 0; i < indexes.length; i++) {
View Full Code Here

    while (it.hasNext()) {
      FsIndexCollection indexColl = it.next();

      if (indexColl != null) {
        try {
          indexColl.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        FsIndexDescription[] indexes = indexColl.getFsIndexes();
        for (int i = 0; i < indexes.length; i++) {
View Full Code Here

    while (it.hasNext()) {
      FsIndexCollection indexColl = (FsIndexCollection) it.next();

      if (indexColl != null) {
        try {
          indexColl.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        FsIndexDescription[] indexes = indexColl.getFsIndexes();
        for (int i = 0; i < indexes.length; i++) {
View Full Code Here

  private void resolveImport(URL aURL, Collection aAlreadyImportedFsIndexCollectionURLs,
          Collection aResults, ResourceManager aResourceManager) throws InvalidXMLException,
          IOException {
    XMLInputSource input = new XMLInputSource(aURL);
    FsIndexCollection desc = UIMAFramework.getXMLParser().parseFsIndexCollection(input);
    desc.resolveImports(aAlreadyImportedFsIndexCollectionURLs, aResourceManager);
    aResults.addAll(Arrays.asList(desc.getFsIndexes()));
  }

  protected XmlizationInfo getXmlizationInfo() {
    return XMLIZATION_INFO;
View Full Code Here

    List<FsIndexDescription> fsIndexList = new ArrayList<FsIndexDescription>();
    for (String location : scanIndexDescriptors()) {
      try {
        XMLInputSource xmlInput = new XMLInputSource(location);
        FsIndexCollection fsIdxCol = getXMLParser().parseFsIndexCollection(xmlInput);
        fsIdxCol.resolveImports();
        fsIndexList.addAll(asList(fsIdxCol.getFsIndexes()));
        LogFactory.getLog(FsIndexFactory.class).debug("Detected index at [" + location + "]");
      } catch (IOException e) {
        throw new ResourceInitializationException(e);
      } catch (InvalidXMLException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.