|
TPTP 4.6.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IAnnotation
An IAnnotation is a model element that annotates another model element with
some data that is not described directly by the model. Collections of
anotations are available on instances of all IAction
Annotations can currently be only files. File Annotations are annotations that are files which are attached to the model and persisted within the same resource as the model element to which the annotation applies. In order to annotate a model element with a File Annotation, you must first create the Annotation object (using HyadesFactory.INSTANCE.createAnnotation()). You must then add that Annotation object to the collection of annotation objects for the model element you are annotating. Then you can call putFileAnnotation(URI file) on the Annotation object, passing the URI of the file you want to annotate the model object with. This will ensure that the specified file is copied into the resource when the resource is saved.
When looking at a model element that currently contains one or more Annotations in its annotation collection, you may simply retrieve the Annotation object, and call getFileAnnotation(). This returns a file URI to a location from which the file annotation may currently be read.
When removing a file annotaion from a model element's annotation collection, be sure to first call removeFileAnnotation() on the Annotation object in order to free up the file from the collection of files that will be persisted with the element's resource.
You must use FacadeResourceFactoryImpl as the registered factory for
any resources that will contain annotated model elements. You also must
ensure that you call Resource.unload() on all resources with annotated model
elements when you have finished with the resource. Failing to do so will result
in orphaned temporary files.
For examples of how to use the methods of this class, please see ValidateFacadeImpl.testPutAnnotations(), testGutAnnotations(), testRemoveAnnotations()
In the mapping of the behavioral facade to the Test Model, an IAnnotation is a CMNAnnotation.
| Method Summary | |
|---|---|
org.eclipse.emf.common.util.URI |
getFileAnnotation()
|
java.lang.String |
getType()
|
boolean |
isFileAnnotation()
|
void |
putFileAnnotation(org.eclipse.emf.common.util.URI file)
|
void |
removeFileAnnotation()
|
| Method Detail |
|---|
java.lang.String getType()
boolean isFileAnnotation()
void putFileAnnotation(org.eclipse.emf.common.util.URI file)
throws java.lang.UnsupportedOperationException,
java.io.IOException
java.lang.UnsupportedOperationException
java.io.IOException
org.eclipse.emf.common.util.URI getFileAnnotation()
throws java.lang.UnsupportedOperationException,
java.io.IOException
java.lang.UnsupportedOperationException
java.io.IOException
void removeFileAnnotation()
throws java.lang.UnsupportedOperationException,
java.io.IOException
java.lang.UnsupportedOperationException
java.io.IOException
|
TPTP 4.6.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||