Package org.apache.poi.xssf.model
Class CommentsTable
java.lang.Object
org.apache.poi.ooxml.POIXMLDocumentPart
org.apache.poi.xssf.model.CommentsTable
- All Implemented Interfaces:
Comments
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommentUpdated(XSSFComment comment) Called after the comment is updated, so that we can reflect that in our cachecreateNewComment(ClientAnchor clientAnchor) Create a new comment and add to the CommentTable.intfindAuthor(String author) findCellComment(CellAddress cellAddress) Finds the cell comment at cellAddress, if one existsgetAuthor(long authorId) Returns all cell addresses that have comments.Returns the underlying CTComments list xmlbeanintintnewComment(CellAddress ref) Create a new comment located at cell addressvoidreadFrom(InputStream is) voidreferenceUpdated(CellAddress oldReference, XSSFComment comment) Called after the reference is updated, so that we can reflect that in our cachevoidreferenceUpdated(CellAddress oldReference, CTComment comment) Deprecated.booleanremoveComment(CellAddress cellRef) Remove the comment at cellRef location, if one existsvoidThis method is for internal POI use only.voidwriteTo(OutputStream out) Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommitted, setCommitted, toString
-
Field Details
-
DEFAULT_AUTHOR
- See Also:
-
DEFAULT_AUTHOR_ID
public static final int DEFAULT_AUTHOR_ID- See Also:
-
-
Constructor Details
-
CommentsTable
public CommentsTable() -
CommentsTable
- Throws:
IOException- Since:
- POI 3.14-Beta1
-
-
Method Details
-
readFrom
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
setSheet
Description copied from interface:CommentsThis method is for internal POI use only. POI uses it to link the sheet and comments table. This method will not move comments from one sheet to another (if a user tries to use this method for that purpose). -
referenceUpdated
@Deprecated @Removal(version="6.0.0") public void referenceUpdated(CellAddress oldReference, CTComment comment) Deprecated.Called after the reference is updated, so that we can reflect that in our cache- Parameters:
oldReference- the comment to remove from the commentRefs mapcomment- the comment to replace in the commentRefs map
-
referenceUpdated
Called after the reference is updated, so that we can reflect that in our cache- Specified by:
referenceUpdatedin interfaceComments- Parameters:
oldReference- the comment to remove from the commentRefs mapcomment- the comment to replace in the commentRefs map- Since:
- POI 5.2.0
- See Also:
-
commentUpdated
Called after the comment is updated, so that we can reflect that in our cache- Specified by:
commentUpdatedin interfaceComments- Parameters:
comment- the comment to replace in the commentRefs map- Since:
- POI 5.2.0
- See Also:
-
getNumberOfComments
public int getNumberOfComments()- Specified by:
getNumberOfCommentsin interfaceComments
-
getNumberOfAuthors
public int getNumberOfAuthors()- Specified by:
getNumberOfAuthorsin interfaceComments
-
getAuthor
-
findAuthor
- Specified by:
findAuthorin interfaceComments
-
findCellComment
Finds the cell comment at cellAddress, if one exists- Specified by:
findCellCommentin interfaceComments- Parameters:
cellAddress- the address of the cell to find a comment- Returns:
- cell comment if one exists, otherwise returns null
-
getCellAddresses
Returns all cell addresses that have comments.- Specified by:
getCellAddressesin interfaceComments- Returns:
- An iterator to traverse all cell addresses that have comments.
- Since:
- 4.0.0
-
createNewComment
Create a new comment and add to the CommentTable.- Specified by:
createNewCommentin interfaceComments- Parameters:
clientAnchor- the anchor for this comment- Returns:
- new XSSFComment
- Since:
- POI 5.2.0
-
newComment
Create a new comment located at cell address- Parameters:
ref- the location to add the comment- Returns:
- a new CTComment located at ref with default author
-
removeComment
Remove the comment at cellRef location, if one exists- Specified by:
removeCommentin interfaceComments- Parameters:
cellRef- the location of the comment to remove- Returns:
- returns true if a comment was removed
-
getCTComments
Returns the underlying CTComments list xmlbean- Returns:
- underlying comments list xmlbean
-
referenceUpdated(CellAddress, XSSFComment)