Class DocumentUimaImpl

java.lang.Object
org.apache.uima.caseditor.editor.AbstractDocument
org.apache.uima.caseditor.editor.DocumentUimaImpl
All Implemented Interfaces:
ICasDocument

public class DocumentUimaImpl extends AbstractDocument
This document implementation is based on an uima cas object.
  • Field Details

  • Constructor Details

    • DocumentUimaImpl

      public DocumentUimaImpl(CAS cas, org.eclipse.core.resources.IFile casFile, String typeSystemText) throws org.eclipse.core.runtime.CoreException
      Initializes a new instance.
      Parameters:
      cas - the cas
      casFile - the cas file
      typeSystemText - type system string
      Throws:
      org.eclipse.core.runtime.CoreException - the core exception
  • Method Details

    • getCAS

      public CAS getCAS()
      Retrieves the CAS.
      Returns:
      the cas
    • getTypeSystemText

      public String getTypeSystemText()
      Description copied from interface: ICasDocument
      Retrieves the string representation of the applied type system.
      Specified by:
      getTypeSystemText in interface ICasDocument
      Overrides:
      getTypeSystemText in class AbstractDocument
      Returns:
      the string representation of the applied type system
    • addFeatureStructure

      public void addFeatureStructure(FeatureStructure annotation)
      Adds the given annotation to the CAS.
      Parameters:
      annotation - the annotation
    • addFeatureStructures

      public void addFeatureStructures(Collection<? extends FeatureStructure> annotations)
      Description copied from interface: ICasDocument
      Adds the FeatureStructures.
      Parameters:
      annotations - the structures
    • removeFeatureStructure

      public void removeFeatureStructure(FeatureStructure annotation)
      Removes the annotations from the CAS.
      Parameters:
      annotation - the annotation
    • removeFeatureStructures

      public void removeFeatureStructures(Collection<? extends FeatureStructure> annotationsToRemove)
      Removes the given annotations from the CAS.
      Parameters:
      annotationsToRemove - the annotations to remove
    • update

      public void update(FeatureStructure annotation)
      Notifies clients about the changed annotation.
      Parameters:
      annotation - the annotation
    • updateFeatureStructure

      public void updateFeatureStructure(Collection<? extends FeatureStructure> annotations)
      Notifies clients about the changed annotation.
      Parameters:
      annotations - the annotations
    • changed

      public void changed()
      Description copied from interface: ICasDocument
      The document was changed. Its unknown what changed.
    • getAnnotations

      public Collection<AnnotationFS> getAnnotations(Type type)
      Retrieves annotations of the given type from the CAS.
      Parameters:
      type - the type
      Returns:
      the annotations
    • getType

      public Type getType(String type)
      Retrieves the given type from the TypeSystem.
      Parameters:
      type - the type
      Returns:
      the type
    • switchView

      public void switchView(String viewName)
      Description copied from interface: ICasDocument
      Switches the view of the underlying CAS to the provided view name.
      Parameters:
      viewName - the view name
    • serialize

      public void serialize(OutputStream out) throws org.eclipse.core.runtime.CoreException
      Serializes the CAS to the given OutputStream in the XCAS format.
      Parameters:
      out - the out
      Throws:
      org.eclipse.core.runtime.CoreException - the core exception
    • getVirginCAS

      public static CAS getVirginCAS(org.eclipse.core.resources.IFile extensionTypeSystemFile) throws org.eclipse.core.runtime.CoreException
      Gets the virgin CAS.
      Parameters:
      extensionTypeSystemFile - the type system file
      Returns:
      the virgin CAS
      Throws:
      org.eclipse.core.runtime.CoreException - the core exception
    • getProjectClassLoader

      public static ClassLoader getProjectClassLoader(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException
      Gets the project class loader.
      Parameters:
      project - the project
      Returns:
      the project class loader
      Throws:
      org.eclipse.core.runtime.CoreException - the core exception