Examples of XMLizable


Examples of org.apache.uima.util.XMLizable

   * @see org.apache.uima.util.XMLParser#parseCustomResourceSpecifier(org.apache.uima.util.XMLInputSource, org.apache.uima.util.XMLParser.ParsingOptions)
   */
  public CustomResourceSpecifier parseCustomResourceSpecifier(XMLInputSource aInput, ParsingOptions aOptions) throws InvalidXMLException {
    // attempt to locate resource specifier schema
    URL schemaURL = getResourceSpecifierSchemaUrl();
    XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, schemaURL, aOptions);

    if (object instanceof CustomResourceSpecifier) {
      return (CustomResourceSpecifier) object;
    } else {
      throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
              CustomResourceSpecifier.class.getName(), object.getClass().getName() });
    }
  }
View Full Code Here

Examples of org.apache.uima.util.XMLizable

   * @see org.apache.uima.util.XMLParser#parsePearSpecifier(org.apache.uima.util.XMLInputSource, org.apache.uima.util.XMLParser.ParsingOptions)
   */
  public PearSpecifier parsePearSpecifier(XMLInputSource aInput, ParsingOptions aOptions) throws InvalidXMLException {
    // attempt to locate resource specifier schema
    URL schemaURL = getResourceSpecifierSchemaUrl();
    XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, schemaURL, aOptions);

    if (object instanceof PearSpecifier) {
      return (PearSpecifier) object;
    } else {
      throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
              PearSpecifier.class.getName(), object.getClass().getName() });
    }
  }
View Full Code Here

Examples of org.apache.uima.util.XMLizable

   * @see org.apache.uima.util.XMLParser#parseIndexBuildSpecification(org.apache.uima.util.XMLInputSource,
   *      org.apache.uima.util.XMLParser.ParsingOptions)
   */
  public IndexBuildSpecification parseIndexBuildSpecification(XMLInputSource aInput,
          ParsingOptions aOptions) throws InvalidXMLException {
    XMLizable object = parse(aInput, aOptions);

    if (object instanceof IndexBuildSpecification) {
      return (IndexBuildSpecification) object;
    } else {
      throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
          IndexBuildSpecification.class.getName(), object.getClass().getName() });
    }
  }
View Full Code Here

Examples of org.apache.uima.util.XMLizable

        // code to read xml and make cas type instance
        CASImpl casLocal = null;
        // handle classpath
        try {
          XMLInputSource in = new XMLInputSource(url);
          XMLizable specifier = UIMAFramework.getXMLParser().parse(in);

          mergedTypesAddingFeatures.clear();
          if (specifier instanceof AnalysisEngineDescription) {
            AnalysisEngineDescription aeSpecifier = (AnalysisEngineDescription) specifier;
            if (!aeSpecifier.isPrimitive())
View Full Code Here

Examples of org.apache.uima.util.XMLizable

        String[] filterExt = { "*.xml", "*.*" };
        fd.setFilterExtensions(filterExt);
        fd.setFileName(parent.getPreprocessorTMFile());
        String file = fd.open();
        if (file != null) {
          XMLizable descriptor = null;
          try {
            descriptor = UIMAFramework.getXMLParser().parse(new XMLInputSource(file));
          } catch (InvalidXMLException e) {
          } catch (IOException e) {
          }
View Full Code Here

Examples of org.apache.uima.util.XMLizable

          fileList = (String[]) event.data;
        }
        if (fileList.length > 0) {
          for (String string : fileList) {
            if (string.endsWith(".xml")) {
              XMLizable descriptor = null;
              try {
                descriptor = UIMAFramework.getXMLParser().parse(new XMLInputSource(string));
              } catch (InvalidXMLException e) {
              } catch (IOException e) {
              }
View Full Code Here

Examples of org.apache.uima.util.XMLizable

        // code to read xml and make cas type instance
        CASImpl casLocal = null;
        // handle classpath
        try {
          XMLInputSource in = new XMLInputSource(file);
          XMLizable specifier = UIMAFramework.getXMLParser().parse(in);

          mergedTypesAddingFeatures.clear();
          if (specifier instanceof AnalysisEngineDescription) {
            AnalysisEngineDescription aeSpecifier = (AnalysisEngineDescription) specifier;
            if (!aeSpecifier.isPrimitive())
View Full Code Here

Examples of org.apache.uima.util.XMLizable

    extensionEditor = null;
    parseSourceInner(input, filePathName);
  }
 
  private void parseSourceInner(XMLInputSource input, String filePathName) throws PartInitException {
    XMLizable inputDescription = null;
    try {
      inputDescription = AbstractSection.parseDescriptor(input);
      if (inputDescription instanceof AnalysisEngineDescription) {
        validateDescriptorType(DESCRIPTOR_AE);
        setAeDescription((AnalysisEngineDescription) inputDescription);
View Full Code Here

Examples of org.apache.uima.util.XMLizable

  /*
   * This returns the true descriptor, accounting for the "trick" when we put CPM descriptors in the
   * AE descriptor. As a side effect, it updates the CPM descriptors
   */
  private XMLizable getTrueDescriptor() {
    XMLizable thing;
    if (isAeDescriptor())
      thing = aeDescription;
    else if (isTypeSystemDescriptor())
      thing = typeSystemDescription;
    else if (isTypePriorityDescriptor())
View Full Code Here

Examples of org.apache.uima.util.XMLizable

      xmlSerializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", Integer.valueOf(
              MultiPageEditorContributor.getXMLindent()).toString());
      xmlSerializer.setWriter(writer);
      ContentHandler contentHandler = xmlSerializer.getContentHandler();
      contentHandler.startDocument();
      XMLizable trueDescriptor = getTrueDescriptor();
      if (trueDescriptor instanceof AnalysisEngineDescription) {
        AnalysisEngineDescription aed = (AnalysisEngineDescription) trueDescriptor;
        aed.toXML(contentHandler, true, true);
      } else
        trueDescriptor.toXML(contentHandler, true);
      contentHandler.endDocument();
      writer.close();
      parsedText = writer.toString();

    } catch (SAXException 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.