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
-
Constructor Summary
ConstructorDescriptionDocumentUimaImpl
(CAS cas, org.eclipse.core.resources.IFile casFile, String typeSystemText) Initializes a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeatureStructure
(FeatureStructure annotation) Adds the given annotation to theCAS
.void
addFeatureStructures
(Collection<? extends FeatureStructure> annotations) Adds theFeatureStructure
s.void
changed()
The document was changed.getAnnotations
(Type type) Retrieves annotations of the given type from theCAS
.getCAS()
Retrieves theCAS
.static ClassLoader
getProjectClassLoader
(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 CAS
getVirginCAS
(org.eclipse.core.resources.IFile extensionTypeSystemFile) Gets the virgin CAS.void
removeFeatureStructure
(FeatureStructure annotation) Removes the annotations from theCAS
.void
removeFeatureStructures
(Collection<? extends FeatureStructure> annotationsToRemove) Removes the given annotations from theCAS
.void
serialize
(OutputStream out) Serializes theCAS
to the givenOutputStream
in the XCAS format.void
switchView
(String viewName) Switches the view of the underlying CAS to the provided view name.void
update
(FeatureStructure annotation) Notifies clients about the changed annotation.void
updateFeatureStructure
(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:ICasDocument
Retrieves the string representation of the applied type system.- Specified by:
getTypeSystemText
in interfaceICasDocument
- Overrides:
getTypeSystemText
in 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:ICasDocument
Adds theFeatureStructure
s.- 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:ICasDocument
The 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:ICasDocument
Switches the view of the underlying CAS to the provided view name.- Parameters:
viewName
- the view name
-
serialize
Serializes theCAS
to the givenOutputStream
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
-