public class Annotations extends Object
Constructor and Description |
---|
Annotations() |
Modifier and Type | Method and Description |
---|---|
static void |
clearModified(Document document)
Resets the "modified"-indicator for all annotations of the given document.
|
static void |
clearModified(Page page)
Resets the "modified"-indicator for all annotations of the given page.
|
static Collection<Annotation> |
get(Page page)
Returns a list all annotations of given page.
|
static List<AnnotationCustomizer> |
getAnnotationCustomizers() |
static AnnotationPageSegment |
getAnnotationPageSegment(Page page)
Returns the annotation page segment of given page.
|
static AnnotationPageSegment |
getAnnotationPageSegment(Page page,
boolean create)
Returns the annotation page segment of given page.
|
static AnnotationProfile |
getAnnotationProfile(Document doc,
Page page)
This is a convenience method to retrieve an applicable
AnnotationProfile . |
static AnnotationFontFactory |
getDefaultAnnotationFontFactory()
Returns current registered default
AnnotationFontFactory implementation, default
registered implementation is AnnotationBasicFontFactory . |
static boolean |
isAnnotated(Document document)
Returns whether the given document is annotated.
|
static boolean |
isAnnotated(Page page)
Returns whether the given page is annotated.
|
static boolean |
isModified(Document document)
Returns whether the annotations of given document are modified.
|
static boolean |
isModified(Page page)
Returns whether the annotations of given page are modified.
|
static void |
runCustomizers(Annotation a,
AnnotationPageSegment ps,
Collection<AnnotationCustomizer> customizers)
This method executes all
AnnotationCustomizer implementations with the given annotation
object. |
static void |
setDefaultAnnotationFontFactory(AnnotationFontFactory defaultAnnotationFontFactory)
Register a default
AnnotationFontFactory implementation, null value is not
allowed. |
public static Collection<Annotation> get(Page page)
Caveat: this method simply returns the annotations on the first annotation page
segment found on the given page using the ordering of Page.getPageSegments()
. However,
the latter is problematic as the default implementation does not return the segments in any
predictable order but in order of the hash map they are maintained in. Future implementations
will exhibit a clarified but different behavior.
page
- the page the annotations should be retrievedIllegalArgumentException
- if page is null
public static AnnotationProfile getAnnotationProfile(Document doc, Page page)
AnnotationProfile
.
First of all the page will be examined whether it already provides an annotation profile. If so, it will be returned. Otherwise the document will be checked whether the document provide a profile. If so it will be returned. If not, the annotation default profile will be returned.
Caveat: this method only considers the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
AnnotationProfile.get(Page)
,
AnnotationProfile.get(Document)
and
AnnotationProfile.getDefaultProfile()
public static AnnotationPageSegment getAnnotationPageSegment(Page page)
null
will be returned.
Caveat: this method simply returns the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
page
- the page the annotation page segement should be retrievednull
if not available.IllegalArgumentException
- if page is null
public static AnnotationPageSegment getAnnotationPageSegment(Page page, boolean create)
create
decides whether an annotation page segment for
given page should be created or not.
Caveat: this method simply returns the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.page
- the page the annotation page segment should be retrievedcreate
- whether an annotation page segment should be createdcreate
is true
, a new one will be created and returned. Otherwise
null
will be returned.IllegalArgumentException
- if page is null
public static boolean isAnnotated(Document document)
Caveat: this method only considers the first annotation page segment found on the
document's pages using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
document
- the document the annotation lookup should be done fortrue
if at least one page of the document has annotationsIllegalArgumentException
- if document is null
public static boolean isAnnotated(Page page)
Caveat: this method only considers the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
page
- the page the annotation lookup should be done fortrue
if at least one annotation is contained in the pageIllegalArgumentException
- if page is null
public static boolean isModified(Document document)
Caveat: this method only considers the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
document
- the document the annotation lookup should be done fortrue
if at least one page contains modified annotationsIllegalArgumentException
- if document is null
public static boolean isModified(Page page)
Caveat: this method only considers the first annotation page segment found on the
given page using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
page
- the page the annotation lookup should be done fortrue
if the page contains at least one modified annotationIllegalArgumentException
- if page is null
public static void clearModified(Document document)
This method should not be used for FileNet based annotation formats (IS, P8). In that case the annotations should be reloaded from the archive to obtain changes made by the archive / developer during the saving process. Make sure to remove the annotations from the whole document before reloading.
Caveat: this method only resets the first annotation page segment found on the given
document's pages using the ordering of Page.getPageSegments()
. However, the latter is
problematic as the default implementation does not return the segments in any predictable order
but in order of the hash map they are maintained in. Future implementations will exhibit a
clarified but different behavior.
document
- the document holding the annotations on which the operation shall be performedIllegalArgumentException
- if document is null
public static void clearModified(Page page)
This method should not be used for FileNet based annotation formats (IS, P8). In that case the annotations should be reloaded from the archive to obtain changes made by the archive / developer during the saving process. Make sure to remove the annotations from the whole document before reloading.
Caveat: this method only resets the first annotation page segment found on the given
page using the ordering of Page.getPageSegments()
. However, the latter is problematic
as the default implementation does not return the segments in any predictable order but in
order of the hash map they are maintained in. Future implementations will exhibit a clarified
but different behavior.
page
- the page holding the annotations on which the operation shall be performedIllegalArgumentException
- if page is null
public static List<AnnotationCustomizer> getAnnotationCustomizers()
public static void runCustomizers(Annotation a, AnnotationPageSegment ps, Collection<AnnotationCustomizer> customizers)
AnnotationCustomizer
implementations with the given annotation
object.a
- Annotation
objectps
- AnnotationPageSegment
instance (may be null
)customizers
- Collection containing AnnotationCustomizer
implementationspublic static AnnotationFontFactory getDefaultAnnotationFontFactory()
AnnotationFontFactory
implementation, default
registered implementation is AnnotationBasicFontFactory
.AnnotationFontFactory
implementationpublic static void setDefaultAnnotationFontFactory(AnnotationFontFactory defaultAnnotationFontFactory)
AnnotationFontFactory
implementation, null
value is not
allowed.Copyright © 2024 levigo holding gmbh. All rights reserved.