Package org.apache.uima.util

Examples of org.apache.uima.util.InvalidXMLException


            // get text of element
            String elemText = XMLUtils.getText(curElem, aOptions.expandEnvVarRefs);
            valueList.add(elemText);
          } else
            // element type does not match
            throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TYPE, new Object[] {
                aPropXmlInfo.arrayElementTagName, curElem.getTagName() });
        }
      }
      // set property
      String[] overridesArray = new String[valueList.size()];
View Full Code Here


          XMLParser.ParsingOptions aOptions) throws InvalidXMLException {
    super.buildFromXMLElement(aElement, aParser, aOptions);
    try {
      validateConfigurationParameterSettings();
    } catch (ResourceConfigurationException e) {
      throw new InvalidXMLException(e);
    }
  }
View Full Code Here

          XMLParser aParser, ParsingOptions aOptions) throws InvalidXMLException {
    // Catch the case where both fsIndexes and fsIndexCollection are specified
    if ("fsIndexes".equals(aPropXmlInfo.xmlElementName)
            || "fsIndexCollection".equals(aPropXmlInfo.xmlElementName)) {
      if (mFsIndexCollection != null) {
        throw new InvalidXMLException(InvalidXMLException.FS_INDEXES_OUTSIDE_FS_INDEX_COLLECTION,
                null);
      }
    }
    super.readPropertyValueFromXMLElement(aPropXmlInfo, aElement, aParser, aOptions);
  }
View Full Code Here

          ParsingOptions aOptions, List<String> aKnownPropertyNames) throws InvalidXMLException {
    // Catch the case where both fsIndexes and fsIndexCollection are specified
    if ("fsIndexes".equals(aElement.getTagName())
            || "fsIndexCollection".equals(aElement.getTagName())) {
      if (mFsIndexCollection != null) {
        throw new InvalidXMLException(InvalidXMLException.FS_INDEXES_OUTSIDE_FS_INDEX_COLLECTION,
                null);
      }
    }
    super.readUnknownPropertyValueFromXMLElement(aElement, aParser, aOptions, aKnownPropertyNames);
  }
View Full Code Here

      if (!aAlreadyImportedTypeSystemURLs.contains(url.toString())) {
        aAlreadyImportedTypeSystemURLs.add(url.toString());
        try {
          resolveImport(url, aAlreadyImportedTypeSystemURLs, importedTypes, aResourceManager);
        } catch (IOException e) {
          throw new InvalidXMLException(InvalidXMLException.IMPORT_FAILED_COULD_NOT_READ_FROM_URL,
                  new Object[] { url, imports[i].getSourceUrlString() }, e);
        }
      }
    }
    // update this object
View Full Code Here

        XMLInputSource input = new XMLInputSource(url);
        ResourceSpecifier spec = UIMAFramework.getXMLParser().parseResourceSpecifier(input);
        setSpecifier(spec);
        setImport(null);
      } catch (IOException e) {
        throw new InvalidXMLException(e);
      } finally {
        try {
          if (stream != null) {
            stream.close();
          }
View Full Code Here

        URL url = aeImport.findAbsoluteUrl(aResourceManager);

        // check for resursive import
        if (aEnclosingAggregateAeUrls.contains(url.toString())) {
          String name = getMetaData() == null ? "<null>" : getMetaData().getName();
          throw new InvalidXMLException(InvalidXMLException.CIRCULAR_AE_IMPORT, new Object[] {
              name, url });
        }

        // parse import target
        XMLInputSource input;
        try {
          input = new XMLInputSource(url);
        } catch (IOException e) {
          throw new InvalidXMLException(InvalidXMLException.IMPORT_FAILED_COULD_NOT_READ_FROM_URL,
                  new Object[] { url, aeImport.getSourceUrlString() }, e);
        }
        ResourceSpecifier spec = UIMAFramework.getXMLParser().parseResourceSpecifier(input);

        // update entry in derived mDelegateAnalysisEngineSpecifiers map.
View Full Code Here

      o = UIMAFramework.getXMLParser().parse(aInput);
      if (o instanceof CpeDescription) {
        return (CpeDescription) o;
      }
    } catch (Exception e) {
      throw new InvalidXMLException(e);
    }

    throw new InvalidXMLException(new Exception("Unexpected Object Type Produced By the XMLParser"));
  }
View Full Code Here

    try {
      setName(aElement.getAttribute("name"));
      field = "deployment";
      setDeployment(aElement.getAttribute("deployment"));
    } catch (Exception e) {
      throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
              "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
                  Thread.currentThread().getName(), "casProcessor", field, "casProcessor" });

    }
  }
View Full Code Here

  public void testParameterGroups() throws Exception {
    // Check that both groups parameters and non-group parameters are validated
    XMLInputSource in = new XMLInputSource(
            JUnitExtension.getFile("TextAnalysisEngineImplTest/AnnotatorWithGroupParameterError.xml"));
    AnalysisEngineDescription desc = null;
    InvalidXMLException ex = null;
    //try {
      desc = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(in);
    //} catch (InvalidXMLException e) {
      //ex = e;
    //}
View Full Code Here

TOP

Related Classes of org.apache.uima.util.InvalidXMLException

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.