|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.annotation.Annotations
public class Annotations
This class contains various utility methods for annotations.
Constructor Summary | |
---|---|
Annotations()
|
Method Summary | |
---|---|
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 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Annotations()
Method Detail |
---|
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 retrieved
IllegalArgumentException
- 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 retrieved
null
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 created
create
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 for
true
if at least one page of the document has annotations
IllegalArgumentException
- 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 for
true
if at least one annotation is contained in the page
IllegalArgumentException
- 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 for
true
if at least one page contains modified annotations
IllegalArgumentException
- 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 for
true
if the page contains at least one modified annotation
IllegalArgumentException
- 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 performed
IllegalArgumentException
- 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 performed
IllegalArgumentException
- 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
implementations
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |