Package org.apache.uima.caseditor.editor
Class DocumentUimaImpl
java.lang.Object
org.apache.uima.caseditor.editor.AbstractDocument
org.apache.uima.caseditor.editor.DocumentUimaImpl
- All Implemented Interfaces:
ICasDocument
This document implementation is based on an uima cas object.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDocumentUimaImpl(CAS cas, org.eclipse.core.resources.IFile casFile, String typeSystemText) Initializes a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeatureStructure(FeatureStructure annotation) Adds the given annotation to theCAS.voidaddFeatureStructures(Collection<? extends FeatureStructure> annotations) Adds theFeatureStructures.voidchanged()The document was changed.getAnnotations(Type type) Retrieves annotations of the given type from theCAS.getCAS()Retrieves theCAS.static ClassLoadergetProjectClassLoader(org.eclipse.core.resources.IProject project) Gets the project class loader.Retrieves the given type from theTypeSystem.Retrieves the string representation of the applied type system.static CASgetVirginCAS(org.eclipse.core.resources.IFile extensionTypeSystemFile) Gets the virgin CAS.voidremoveFeatureStructure(FeatureStructure annotation) Removes the annotations from theCAS.voidremoveFeatureStructures(Collection<? extends FeatureStructure> annotationsToRemove) Removes the given annotations from theCAS.voidserialize(OutputStream out) Serializes theCASto the givenOutputStreamin the XCAS format.voidswitchView(String viewName) Switches the view of the underlying CAS to the provided view name.voidupdate(FeatureStructure annotation) Notifies clients about the changed annotation.voidupdateFeatureStructure(Collection<? extends FeatureStructure> annotations) Notifies clients about the changed annotation.Methods inherited from class org.apache.uima.caseditor.editor.AbstractDocument
addChangeListener, fireAddedFeatureStructure, fireAddedFeatureStructure, fireChanged, fireRemovedFeatureStructure, fireRemovedFeatureStructure, fireUpdatedFeatureStructure, fireUpdatedFeatureStructure, fireViewChanged, removeChangeListener
-
Field Details
-
JAVA_NATURE
The Constant JAVA_NATURE.- See Also:
-
-
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 cascasFile- the cas filetypeSystemText- type system string- Throws:
org.eclipse.core.runtime.CoreException- the core exception
-
-
Method Details
-
getCAS
Retrieves theCAS.- Returns:
- the cas
-
getTypeSystemText
Description copied from interface:ICasDocumentRetrieves the string representation of the applied type system.- Specified by:
getTypeSystemTextin interfaceICasDocument- Overrides:
getTypeSystemTextin classAbstractDocument- Returns:
- the string representation of the applied type system
-
addFeatureStructure
Adds the given annotation to theCAS.- Parameters:
annotation- the annotation
-
addFeatureStructures
Description copied from interface:ICasDocumentAdds theFeatureStructures.- Parameters:
annotations- the structures
-
removeFeatureStructure
Removes the annotations from theCAS.- Parameters:
annotation- the annotation
-
removeFeatureStructures
Removes the given annotations from theCAS.- Parameters:
annotationsToRemove- the annotations to remove
-
update
Notifies clients about the changed annotation.- Parameters:
annotation- the annotation
-
updateFeatureStructure
Notifies clients about the changed annotation.- Parameters:
annotations- the annotations
-
changed
public void changed()Description copied from interface:ICasDocumentThe document was changed. Its unknown what changed. -
getAnnotations
Retrieves annotations of the given type from theCAS.- Parameters:
type- the type- Returns:
- the annotations
-
getType
Retrieves the given type from theTypeSystem.- Parameters:
type- the type- Returns:
- the type
-
switchView
Description copied from interface:ICasDocumentSwitches the view of the underlying CAS to the provided view name.- Parameters:
viewName- the view name
-
serialize
Serializes theCASto the givenOutputStreamin 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
-