Package org.apache.uima.util

Examples of org.apache.uima.util.XMLizable


        // write the value (must be XMLizable or an array of XMLizable)
        Object val = curEntry.getValue();
        if (val.getClass().isArray()) {
          Object[] arr = (Object[]) val;
          for (int j = 0; j < arr.length; j++) {
            XMLizable elem = (XMLizable) arr[j];
            elem.toXML(aContentHandler);
          }
        } else {
          ((XMLizable) val).toXML(aContentHandler);
        }
View Full Code Here


    m_bIsInited = true;
  }

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

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

      xmlSerializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", new Integer(
              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

        return null;
    }

    try {
      XMLInputSource input = new XMLInputSource(iFile.getLocation().toFile());
      XMLizable inputDescription = AbstractSection.parseDescriptor(input);
      if (inputDescription instanceof AnalysisEngineDescription
              || inputDescription instanceof CasConsumerDescription
              || inputDescription instanceof FlowControllerDescription)
        return (ResourceCreationSpecifier) inputDescription;
      else if (inputDescription instanceof ResourceServiceSpecifier)
View Full Code Here

    if (null == keyName) {
      setFlowControllerDeclaration(oldFcd); // revert
      return;
    }

    XMLizable inputDescription = readImport(imp, fullPathFileName, isImportByName);
    if (null == inputDescription) {
      setFlowControllerDeclaration(oldFcd); // revert
      return;
    }
View Full Code Here

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

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

            MultiPageEditorContributor.getXMLindent()).toString());
      xmlSerializer.setIndent(true);
      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

        return null;
    }

    try {
      XMLInputSource input = new XMLInputSource(iFile.getLocation().toFile());
      XMLizable inputDescription = AbstractSection.parseDescriptor(input);
      if (inputDescription instanceof AnalysisEngineDescription
              || inputDescription instanceof CasConsumerDescription
              || inputDescription instanceof FlowControllerDescription)
        return (ResourceCreationSpecifier) inputDescription;
      else if (inputDescription instanceof ResourceServiceSpecifier)
View Full Code Here

TOP

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

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.