Package net.sf.okapi.common.resource
Interface IWithAnnotations
-
- All Known Subinterfaces:
IMultilingual
,INameable
,IResource
,ITextUnit
- All Known Implementing Classes:
BaseNameable
,BaseReferenceable
,Custom
,DocumentPart
,Ending
,EndSubfilter
,MultiEvent
,PipelineParameters
,RawDocument
,Segment
,StartDocument
,StartGroup
,StartSubDocument
,StartSubfilter
,StorageList
,TextContainer
,TextPart
,TextUnit
public interface IWithAnnotations
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Iterator<IAnnotation>
annotationIterator()
Gets an iterator of the annotations for this resource.default void
clear()
Empty allIAnnotation
'sstatic void
copy(IWithAnnotations from, IWithAnnotations to)
Copy allIWithAnnotations
Unless destination already has the annotation.default <A extends IAnnotation>
AgetAnnotation(Class<A> annotationType)
Gets the annotation object for a given class for this resource.Annotations
getAnnotations()
default Set<Class<? extends IAnnotation>>
getAnnotationsTypesAsSet()
default <A extends IAnnotation>
booleanhasAnnotation(Class<A> annotationType)
Does this resource have any annotations?default boolean
hasAnnotations()
Does this resource have any annotations?default <A extends IAnnotation>
voidremove(Class<A> annotationType)
Remove the designatedIAnnotation
default void
setAnnotation(IAnnotation annotation)
Sets an annotation object for this resource.
-
-
-
Method Detail
-
copy
static void copy(IWithAnnotations from, IWithAnnotations to)
Copy allIWithAnnotations
Unless destination already has the annotation.WARNING: Annotations are not cloned before copying.
IAnnotation
should define a clone method- Parameters:
from
- source ofIWithAnnotations
to
- destination ofIWithAnnotations
-
getAnnotations
Annotations getAnnotations()
- Returns:
Annotations
for the implementer of interface
-
getAnnotation
default <A extends IAnnotation> A getAnnotation(Class<A> annotationType)
Gets the annotation object for a given class for this resource.- Type Parameters:
A
-- Parameters:
annotation
-- Returns:
-
setAnnotation
default void setAnnotation(IAnnotation annotation)
Sets an annotation object for this resource.- Parameters:
annotation
- the annotation object to set.
-
annotationIterator
default Iterator<IAnnotation> annotationIterator()
Gets an iterator of the annotations for this resource.- Returns:
- an iterator list of the annotations for this resource.
-
getAnnotationsTypesAsSet
default Set<Class<? extends IAnnotation>> getAnnotationsTypesAsSet()
- Returns:
-
remove
default <A extends IAnnotation> void remove(Class<A> annotationType)
Remove the designatedIAnnotation
- Type Parameters:
A
-- Parameters:
annotationType
- the class of the annotation object to retrieve.
-
hasAnnotations
default boolean hasAnnotations()
Does this resource have any annotations?- Returns:
- true if there are annotations on this
IResource
-
hasAnnotation
default <A extends IAnnotation> boolean hasAnnotation(Class<A> annotationType)
Does this resource have any annotations?- Type Parameters:
A
-- Returns:
- true if there are annotations on this
IResource
-
clear
default void clear()
Empty allIAnnotation
's
-
-