Search in sources :

Example 1 with CommentsDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument in project poi by apache.

the class CommentsTable method readFrom.

public void readFrom(InputStream is) throws IOException {
    try {
        CommentsDocument doc = CommentsDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
        comments = doc.getComments();
    } catch (XmlException e) {
        throw new IOException(e.getLocalizedMessage());
    }
}
Also used : XmlException(org.apache.xmlbeans.XmlException) IOException(java.io.IOException) CommentsDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument)

Example 2 with CommentsDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument in project poi by apache.

the class CommentsTable method writeTo.

public void writeTo(OutputStream out) throws IOException {
    CommentsDocument doc = CommentsDocument.Factory.newInstance();
    doc.setComments(comments);
    doc.save(out, DEFAULT_XML_OPTIONS);
}
Also used : CommentsDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument)

Aggregations

CommentsDocument (org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument)2 IOException (java.io.IOException)1 XmlException (org.apache.xmlbeans.XmlException)1