Package org.apache.uima.util

Examples of org.apache.uima.util.XMLInputSource


    AnnotationCheckTreeNode[] children = root.getChildren();
    List<CheckDocument> docs = new ArrayList<CheckDocument>(oldDocs);
    TypeSystemDescription tsd = null;
    try {
      tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(typeSystem.getText()));
      tsd.resolveImports();
    } catch (InvalidXMLException e) {
      RutaAddonsPlugin.error(e);
    } catch (IOException e) {
      RutaAddonsPlugin.error(e);
View Full Code Here


      acView = (AnnotationCheckView) HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench()
              .getActiveWorkbenchWindow().getActivePage().showView(AnnotationCheckView.ID);
      AnnotationCheckComposite composite = (AnnotationCheckComposite) acView.getComposite();
      List<String> types = new ArrayList<String>();
      TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(composite.getTypeSystem())));
      tsd.resolveImports();
      TypeDescription[] systemTypes = tsd.getTypes();
      for (TypeDescription typeDescription : systemTypes) {
        types.add(typeDescription.getName());
      }
View Full Code Here

    try {
      String tsDesc = RutaProjectUtils.getTypeSystemDescriptorPath(location, resource.getProject())
              .toPortableString();

      defaultTypeSystemDescription = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(tsDesc)));
      defaultTypeSystemDescription.resolveImports();
      TypeDescription[] systemTypes = defaultTypeSystemDescription.getTypes();
      for (TypeDescription typeDescription : systemTypes) {
        types.add(typeDescription.getName());
      }
View Full Code Here

    try {
      String tsDesc = RutaProjectUtils.getTypeSystemDescriptorPath(location,
              resource.getProject()).toPortableString();

      defaultTypeSystemDescription = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(tsDesc)));
      defaultTypeSystemDescription.resolveImports();
      TypeDescription[] systemTypes = defaultTypeSystemDescription.getTypes();
      for (TypeDescription typeDescription : systemTypes) {
        types.add(typeDescription.getName());
      }
View Full Code Here

      clearFolder(project, runTestPath);
      runWithJVM(monitor, fScript, cleanInputPath, runTestPath);

      try {
        // * for each (goldFile, runFile)-pair:
        XMLInputSource in = new XMLInputSource(typeSystemDescriptorPath.toPortableString());
        TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(in);
        CAS runCas = CasCreationUtils.createCas(tsd, null, null);
        CAS goldCas = CasCreationUtils.createCas(tsd, null, null);
        for (TestCasData td : testCasData) {
          // init etc
View Full Code Here

    private void writeCleanInputFiles(List<TestCasData> testCasData, IProject project,
            IPath tsDescriptorPath, IPath cleanInputPath, IProgressMonitor monitor) {
      try {
        // create CAS:
        XMLInputSource in = new XMLInputSource(tsDescriptorPath.toPortableString());
        TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(in);

        CAS cleanCas = getEmptyCas(tsd);

        for (TestCasData td : testCasData) {
View Full Code Here

            final TestPageBookView testPageView, final TestViewPage debugPage, IFile fScript,
            final IProject project, final IPath engineDescriptorPath,
            ArrayList<TestCasData> testCasData) {
      try {
        // create AE:
        XMLInputSource in = new XMLInputSource(engineDescriptorPath.toPortableString());
        ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
        AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
        // create (empty) CAS objects:
        String desc = null;
        desc = engineDescriptorPath.toPortableString();
        XMLInputSource in2 = new XMLInputSource(desc);
        Object descriptor = UIMAFramework.getXMLParser().parse(in2);
        CAS runCas = getEmptyCas(descriptor);
        CAS testCas = getEmptyCas(descriptor);

        for (TestCasData td : testCasData) {
View Full Code Here

      }
      setDefaultTypeSystem(documentSource, typeSystem);
      TypeSystemDescription tsd = null;
      try {
        tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
                new XMLInputSource(typeSystem));
        tsd.resolveImports();
      } catch (InvalidXMLException e) {
        RutaAddonsPlugin.error(e);
      } catch (IOException e) {
        RutaAddonsPlugin.error(e);
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
   */
  public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
    XMLInputSource input;

    if (!(editorInput instanceof IFileEditorInput))
      throw new PartInitException(Messages.getString("MultiPageEditor.invalidInputClass")); //$NON-NLS-1$
    fileNeedingContext = file = ((IFileEditorInput) editorInput).getFile();
    String filePathName = file.getLocation().toOSString();

    try {
      input = new XMLInputSource(filePathName);
    } catch (IOException e) {
      String m = Messages.getFormattedString("MultiPageEditor.IOError", //$NON-NLS-1$
              new String[] { AbstractSection.maybeShortenFileName(filePathName) })
              + Messages.getString("MultiPageEditor.10") + getMessagesToRootCause(e); //$NON-NLS-1$
      // skip showing a message because the partInitException
View Full Code Here

      super.setActivePage(sourceIndex);
      return false;
    }

    String filePathName = getFile().getLocation().toString();
    XMLInputSource input = new XMLInputSource(is, new File(filePathName));

    AnalysisEngineDescription oldAe = aeDescription;
    TypeSystemDescription oldTsdWithResolvedImports = mergedTypeSystemDescription;

    try {
View Full Code Here

TOP

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

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.