Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.toXML()


    // options.put(OPTION_GENERATE_UIMA_LIST_TYPES, Boolean.TRUE);
    TypeSystemDescription tsDesc = ecore2UimaTypeSystem(args[0], options);

    FileOutputStream os = new FileOutputStream(args[1]);
    try {
      tsDesc.toXML(os);
    } finally {
      os.close();
    }

    // test creating a CAS
View Full Code Here


    try {
      typeSystemFile = new File(project.getBuild().getDirectory(), "jcasgen/typesystem.xml");
      getLog().debug("JCasGen: Writing master descriptor to in '" + typeSystemFile + "'");
      typeSystemFile.getParentFile().mkdirs();
      typeSystemOs = new FileOutputStream(typeSystemFile);
      typeSystem.toXML(typeSystemOs);
    } catch (IOException e) {
      throw new MojoExecutionException(e.getMessage(), e.getCause());
    } catch (SAXException e) {
      throw new MojoExecutionException(e.getMessage(), e.getCause());
    } finally {
View Full Code Here

    //test that this is valid by creating a new CAS
    CasCreationUtils.createCas(tsDesc2, null, null);
   
    // Check that can be written (without cluttering up the console)
    StringWriter out = new StringWriter();
    tsDesc2.toXML(out);
  }
}
View Full Code Here

   
    CAS cas = CasCreationUtils.createCas(tsDesc, null, null);   
    //convert that CAS's type system back to a TypeSystemDescription
    TypeSystemDescription tsDesc2 = TypeSystemUtil.typeSystem2TypeSystemDescription(cas.getTypeSystem());
    tsDesc2.toXML(System.out);
    //test that this is valid by creating a new CAS
    CasCreationUtils.createCas(tsDesc2, null, null);
  }
}
View Full Code Here

      // create dir and serialize typesystem
      boolean status = new File((String)casLogDirMap.get(analysisEngineKey)).mkdir();
      TypeSystemDescription tsd = TypeSystemUtil.typeSystem2TypeSystemDescription(cas.getTypeSystem());
      File tsd2xml = new File(((String)casLogDirMap.get(analysisEngineKey))+"/typesystem.xml");
      FileOutputStream os = new FileOutputStream(tsd2xml);
      tsd.toXML(os);
      os.close();
      enableCasLogMap.put(analysisEngineKey, true);
    }
    // create XmiCas file name
    Long now = Long.valueOf((System.nanoTime()-initializationTime)/1000);
View Full Code Here

    TypeDescription[] typeDescArr = new TypeDescription[typeDescs.size()];
    typeDescs.toArray(typeDescArr);
    tsDesc.setTypes(typeDescArr);

    aContentHandler.startDocument();
    tsDesc.toXML(aContentHandler);
    aContentHandler.endDocument();
  }
}
View Full Code Here

          ze.setMethod(ZipEntry.DEFLATED);
          zos.setLevel(9);
          zos.putNextEntry(ze);
          TypeSystem ts = jcas.getTypeSystem();
          TypeSystemDescription tsDesc = TypeSystemUtil.typeSystem2TypeSystemDescription(ts);
          tsDesc.toXML(zos); // Capture type system in XML format
          zos.closeEntry();
        }
      zos.setLevel(zipCompLevel);
        } catch (Exception e) {
          throw new AnalysisEngineProcessException(e);
View Full Code Here

      // create dir and serialize typesystem
      boolean status = new File((String)casLogDirMap.get(analysisEngineKey)).mkdir();
      TypeSystemDescription tsd = TypeSystemUtil.typeSystem2TypeSystemDescription(cas.getTypeSystem());
      File tsd2xml = new File(((String)casLogDirMap.get(analysisEngineKey))+"/typesystem.xml");
      FileOutputStream os = new FileOutputStream(tsd2xml);
      tsd.toXML(os);
      os.close();
      enableCasLogMap.put(analysisEngineKey, true);
    }
    // create XmiCas file name
    Long now = Long.valueOf((System.nanoTime()-initializationTime)/1000);
View Full Code Here

        FileOutputStream out = null;
        try {
            // Save to file
            if (xmlFileName != null && xmlFileName.trim().length() > 0) {
                out = new FileOutputStream (xmlFileName);
                tsd.toXML(out);
                // Trace.trace("*** write to file: " + xmlFileName);
            }
        } catch (SAXException e) {
            e.printStackTrace();
            return -1;
View Full Code Here

    // options.put(OPTION_GENERATE_UIMA_LIST_TYPES, Boolean.TRUE);
    TypeSystemDescription tsDesc = ecore2UimaTypeSystem(args[0], options);

    FileOutputStream os = new FileOutputStream(args[1]);
    try {
      tsDesc.toXML(os);
    } finally {
      os.close();
    }

    // test creating a CAS
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.