@Internal public class CommentsTable extends POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_AUTHOR |
static int |
DEFAULT_AUTHOR_ID |
Constructor and Description |
---|
CommentsTable() |
CommentsTable(PackagePart part) |
CommentsTable(PackagePart part,
PackageRelationship rel)
Deprecated.
in POI 3.14, scheduled for removal in POI 3.16
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Save the content in the underlying package part.
|
int |
findAuthor(java.lang.String author) |
XSSFComment |
findCellComment(CellAddress cellAddress)
Finds the cell comment at cellAddress, if one exists
|
XSSFComment |
findCellComment(java.lang.String cellRef)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use
findCellComment(CellAddress) instead |
java.lang.String |
getAuthor(long authorId) |
java.util.Map<CellAddress,XSSFComment> |
getCellComments()
Returns all cell comments on this sheet.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment |
getCTComment(CellAddress cellRef)
Get the underlying CTComment xmlbean for a comment located at cellRef, if it exists
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment |
getCTComment(java.lang.String ref)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use
getCTComment(CellAddress) instead |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments |
getCTComments()
Returns the underlying CTComments list xmlbean
|
int |
getNumberOfAuthors() |
int |
getNumberOfComments() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment |
newComment(CellAddress ref)
Create a new comment located` at cell address
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment |
newComment(java.lang.String ref)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use
newComment(CellAddress) instead |
void |
readFrom(java.io.InputStream is) |
void |
referenceUpdated(CellAddress oldReference,
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment comment)
Called after the reference is updated, so that
we can reflect that in our cache
|
void |
referenceUpdated(java.lang.String oldReference,
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment comment)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use
referenceUpdated(CellAddress, CTComment) instead |
boolean |
removeComment(CellAddress cellRef)
Remove the comment at cellRef location, if one exists
|
boolean |
removeComment(java.lang.String cellRef)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use
removeComment(CellAddress) instead |
void |
writeTo(java.io.OutputStream out) |
_invokeOnDocumentRead, addRelation, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelationParts, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, toString
public static final java.lang.String DEFAULT_AUTHOR
public static final int DEFAULT_AUTHOR_ID
public CommentsTable()
public CommentsTable(PackagePart part) throws java.io.IOException
java.io.IOException
@Deprecated public CommentsTable(PackagePart part, PackageRelationship rel) throws java.io.IOException
java.io.IOException
public void readFrom(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
protected void commit() throws java.io.IOException
POIXMLDocumentPart
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
bean.save(out, DEFAULT_XML_OPTIONS);
out.close();
}
commit
in class POIXMLDocumentPart
java.io.IOException
public void referenceUpdated(java.lang.String oldReference, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment comment)
referenceUpdated(CellAddress, CTComment)
insteadpublic void referenceUpdated(CellAddress oldReference, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment comment)
oldReference
- the comment to remove from the commentRefs mapcomment
- the comment to replace in the commentRefs mappublic int getNumberOfComments()
public int getNumberOfAuthors()
public java.lang.String getAuthor(long authorId)
public int findAuthor(java.lang.String author)
public XSSFComment findCellComment(java.lang.String cellRef)
findCellComment(CellAddress)
insteadcellRef
- the address of the cell to find a commentpublic XSSFComment findCellComment(CellAddress cellAddress)
cellAddress
- the address of the cell to find a comment@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment getCTComment(java.lang.String ref)
getCTComment(CellAddress)
insteadref
- the location of the cell comment@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment getCTComment(CellAddress cellRef)
cellRef
- the location of the cell commentpublic java.util.Map<CellAddress,XSSFComment> getCellComments()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment newComment(java.lang.String ref)
newComment(CellAddress)
insteadref
- the location to add the comment@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment newComment(CellAddress ref)
ref
- the location to add the commentpublic boolean removeComment(java.lang.String cellRef)
removeComment(CellAddress)
insteadcellRef
- the location of the comment to removepublic boolean removeComment(CellAddress cellRef)
cellRef
- the location of the comment to remove@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments getCTComments()
Copyright 2017 The Apache Software Foundation or its licensors, as applicable.