Interface AuthorPersistentHighlight
- All Superinterfaces:
AuthorPersistentHighlightConstants
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface AuthorPersistentHighlight
extends AuthorPersistentHighlightConstants
Defines the Author Persistent Highlight which get serialized in the XML as
processing instruction.
The Author Persistent Highlight has one of the following types defined in
AuthorPersistentHighlight.PersistentHighlightType
:
-
AuthorPersistentHighlight.PersistentHighlightType.CUSTOM_HIGHLIGHT
represents theCustom defined highlights
that can be managed by using theAuthorPersistentHighlighter
. The name of the processing instruction markers corresponding to this type of highlight areoxy_custom_start
andoxy_custom_end
-
AuthorPersistentHighlight.PersistentHighlightType.COMMENT
represents theComment highlights
which get serialized using theoxy_comment_start
andoxy_comment_end
processing instruction names. -
AuthorPersistentHighlight.PersistentHighlightType.CHANGE_INSERT
represents theInsert highlight from Change Tracking
, with theoxy_insert_start
andoxy_insert_end
corresponding processing instruction names. -
AuthorPersistentHighlight.PersistentHighlightType.CHANGE_DELETE
represents theDelete highlight from Change Tracking
, which get serialized by using theoxy_delete
processing instruction name.
Comment
, Insert
and Delete
persistent highlights can be accessed and customized by using the
AuthorReviewController
.- Since:
- 12
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
TheAuthor Persistent Highlight
type. -
Field Summary
Fields inherited from interface ro.sync.ecss.extensions.api.highlights.AuthorPersistentHighlightConstants
ATTR_NAME_ATTRIBUTE, AUTHOR_NAME_ATTRIBUTE, COMMENT_ATTRIBUTE, COMMENT_ID, COMMENT_PARENT_ID, CONTENT_ATTRIBUTE, DONE_ATTRIBUTE_VALUE, EMPTY_MARKER_ATTRIBUTE, FLAG_ATTRIBUTE, MID_ATTRIBUTE, MODIFICATION_TIME, TYPE_ATTRIBUTE
-
Method Summary
Modifier and TypeMethodDescriptionClone the highlight to a new content.Returns a copy of the internal properties map.int
Get the highlight end offset.Provides an iterator over the current properties map.getProperty
(String key) Get the value of a propertyint
Get the highlight start offset.getType()
The persistent highlight type.boolean
isEmpty()
Check if the marker is over content.
-
Method Details
-
getStartOffset
int getStartOffset()Get the highlight start offset.- Returns:
- The start offset (inclusive).
-
getEndOffset
int getEndOffset()Get the highlight end offset.Note: empty persistent highlights have
startOffset == endOffset & isEmpty() == true
- Returns:
- The end offset (inclusive).
-
getClonedProperties
LinkedHashMap<String,String> getClonedProperties()Returns a copy of the internal properties map. The properties can contain details about the highlight author or the highlight modification timestamp, depending on the highlight type:
- The properties names for change tracking highlights are:
AuthorPersistentHighlightConstants.AUTHOR_NAME_ATTRIBUTE
,AuthorPersistentHighlightConstants.MODIFICATION_TIME
- For comment highlights the properties names are:
AuthorPersistentHighlightConstants.AUTHOR_NAME_ATTRIBUTE
,AuthorPersistentHighlightConstants.MODIFICATION_TIME
,AuthorPersistentHighlightConstants.COMMENT_ATTRIBUTE
andAuthorPersistentHighlightConstants.COMMENT_PARENT_ID
(if it is a reply) - Both comment highlights and insert and delete highlights
can also have the
AuthorPersistentHighlightConstants.COMMENT_ID
property set - The properties for custom persistent highlights are specified
when the highlight is added (@see
AuthorPersistentHighlighter.addHighlight(int, int, LinkedHashMap)
) and can be changed using theAuthorPersistentHighlighter.setProperties(AuthorPersistentHighlight, LinkedHashMap)
method.
- Returns:
- The copy of highlight properties.
- The properties names for change tracking highlights are:
-
getType
The persistent highlight type.- Returns:
- The
AuthorPersistentHighlight.PersistentHighlightType
corresponding to this author persistent highlight.
-
isEmpty
boolean isEmpty()Check if the marker is over content.- Returns:
true
if the marker is not over any content.
-
clone
Clone the highlight to a new content.- Parameters:
content
- The new content in which to clone the current highlight.- Returns:
- The clone of the hightlight. Never
null
- Throws:
CloneNotSupportedException
- If various errors are encountered during the cloning procedure- Since:
- 21.1
-
getPropertiesIterator
Provides an iterator over the current properties map.- Returns:
- iterator over the current properties map.
- Since:
- 24
-
getProperty
Get the value of a property- Parameters:
key
- The property key.- Returns:
- The property value or
null
. - Since:
- 24
-