public class Annotation extends Object
IAnnotationModel
.
Annotations are typed, can have an associated text and can be marked as persistent and
deleted. Annotations which are not explicitly initialized with an annotation
type are of type "org.eclipse.text.annotation.unknown"
.
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_UNKNOWN
Constant for unknown annotation types.
|
Modifier | Constructor and Description |
---|---|
protected |
Annotation()
Creates a new annotation that is not persistent and type less.
|
|
Annotation(boolean isPersistent)
Creates a new annotation with the given persistence state.
|
|
Annotation(String type,
boolean isPersistent,
String text)
Creates a new annotation with the given properties.
|
Modifier and Type | Method and Description |
---|---|
String |
getText()
Returns the text associated with this annotation.
|
String |
getType()
Returns the type of the annotation.
|
boolean |
isMarkedDeleted()
Returns whether this annotation is marked as deleted.
|
boolean |
isPersistent()
Returns whether this annotation is persistent.
|
void |
markDeleted(boolean deleted)
Marks this annotation deleted according to the value of the
deleted parameter. |
void |
setText(String text)
Sets the text associated with this annotation.
|
void |
setType(String type)
Sets the type of this annotation.
|
public static final String TYPE_UNKNOWN
Value: "org.eclipse.text.annotation.unknown"
protected Annotation()
public Annotation(String type, boolean isPersistent, String text)
type
- the unique name of this annotation typeisPersistent
- true
if this annotation is
persistent, false
otherwisetext
- the text associated with this annotationpublic Annotation(boolean isPersistent)
isPersistent
- true
if persistent, false
otherwisepublic boolean isPersistent()
true
if this annotation is persistent, false
otherwisepublic void setType(String type)
type
- the annotation typepublic String getType()
public void markDeleted(boolean deleted)
deleted
parameter.deleted
- true
if annotation should be marked as deletedpublic boolean isMarkedDeleted()
true
if annotation is marked as deleted, false
otherwisepublic void setText(String text)
text
- the text associated with this annotationpublic String getText()
null
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.