Package org.apache.uima.util

Examples of org.apache.uima.util.InvalidXMLException


          success = true;
          break;
        }
      }
      if (!success) {
        throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT, new Object[] {
            comparatorStr, "comparator" });
      }
    } else {
      // for all other attributes, use the default superclass behavior
      super.readPropertyValueFromXMLElement(aPropXmlInfo, aElement, aParser, aOptions);
View Full Code Here


   */
  public void buildFromXMLElement(Element aElement, XMLParser aParser,
          XMLParser.ParsingOptions aOptions) throws InvalidXMLException {
    String names = aElement.getAttribute("names");
    if (names.length() == 0) {
      throw new InvalidXMLException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING, new Object[] {
          "names", "configurationGroup" });
    }
    // treat names as a space-separated list
    StringTokenizer tokenizer = new StringTokenizer(names, " \t");
    List<String> nameList = new ArrayList<String>();
View Full Code Here

      if (!aAlreadyImportedFsIndexURLs.contains(url.toString())) {
        aAlreadyImportedFsIndexURLs.add(url.toString());
        try {
          resolveImport(url, aAlreadyImportedFsIndexURLs, importedIndexes, 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

          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

        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

            // 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

      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

        ((MetaDataObject_impl) result).setSourceUrl(urlToParse);
      }
      return result;
    } catch (Exception e) {
      String sourceFile = urlToParse != null ? urlToParse.toString() : "<unknown source>";
      throw new InvalidXMLException(InvalidXMLException.INVALID_DESCRIPTOR_FILE,
              new Object[] { sourceFile }, 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.