SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record
Interface Annotatable

All Known Subinterfaces:
Annotation, Attribute, AttributeValue, Literal, MObject
All Known Implementing Classes:
AnnotatableImpl, AnnotationImpl, AttributeImpl, AttributeValueImpl, ExtensionAdapter, LiteralImpl, MObjectImpl, PipeletInstance, ProcessingServiceInvoker

public interface Annotatable

common interface of record parts that can have annotations.

Author:
jschumacher

Method Summary
 void addAnnotation(java.lang.String name, Annotation annotation)
          add a single annotation for the specified name.
 int annotationsSize()
          get number of annotations.
 Annotation getAnnotation(java.lang.String name)
          get the first annotation for the specified name.
 java.util.Iterator<java.lang.String> getAnnotationNames()
          get an iterator on the names of all attached annotations.
 java.util.Collection<Annotation> getAnnotations(java.lang.String name)
          get the list of annotations for the specified name.
 boolean hasAnnotation(java.lang.String name)
          Check if this object has an annotation of the specified name.
 boolean hasAnnotations()
          Check if this object has annotations attached.
 void removeAnnotations()
          remove all current annotations.
 void removeAnnotations(java.lang.String name)
          remove all current annotations of the specified name.
 void setAnnotation(java.lang.String name, Annotation annotation)
          set a single annotation for the specified name.
 void setAnnotations(java.lang.String name, java.util.Collection<? extends Annotation> annotations)
          set the list of annotations for a given name.
 

Method Detail

hasAnnotations

boolean hasAnnotations()
Check if this object has annotations attached.

Returns:
true if annotations are attached, else false.

hasAnnotation

boolean hasAnnotation(java.lang.String name)
Check if this object has an annotation of the specified name.

Parameters:
name - name of annotation to check for.
Returns:
true if an annotation of this name exists, else false.

annotationsSize

int annotationsSize()
get number of annotations.

Returns:
number of annotations.

getAnnotationNames

java.util.Iterator<java.lang.String> getAnnotationNames()
get an iterator on the names of all attached annotations.

Returns:
an iterator on annotation names.

getAnnotations

java.util.Collection<Annotation> getAnnotations(java.lang.String name)
get the list of annotations for the specified name.

Parameters:
name - name of annotation.
Returns:
list of annotations with this name. Null, if no annotations of this name exists.

getAnnotation

Annotation getAnnotation(java.lang.String name)
get the first annotation for the specified name. Makes usually only sense if is sure that only one annotation with this name can exist, because some implementations might not be able to guarantee the order of annotations.

Parameters:
name - name of annotation.
Returns:
the first annotation in the list of known annotations. Null, if no annotations of this name exist.

setAnnotations

void setAnnotations(java.lang.String name,
                    java.util.Collection<? extends Annotation> annotations)
set the list of annotations for a given name. All existing annotations of this name are replaced.

Parameters:
name - name of annotation
annotations - new list of annotations to set

setAnnotation

void setAnnotation(java.lang.String name,
                   Annotation annotation)
set a single annotation for the specified name. All existing annotations of this name are replaced.

Parameters:
name - name of annotation
annotation - new annotation to set.

addAnnotation

void addAnnotation(java.lang.String name,
                   Annotation annotation)
add a single annotation for the specified name. The list of currently existing annotation is extended.

Parameters:
name - name of annotation
annotation - new annotation to add.

removeAnnotations

void removeAnnotations(java.lang.String name)
remove all current annotations of the specified name.

Parameters:
name - name of annotation

removeAnnotations

void removeAnnotations()
remove all current annotations.


SMILA (incubation) API documentation