public final class XSSFVMLDrawing extends POIXMLDocumentPart
In Excel 2007 VML drawings are used to describe properties of cell comments, although the spec says that VML is deprecated:
The VML format is a legacy format originally introduced with Office 2000 and is included and fully defined in this Standard for backwards compatibility reasons. The DrawingML format is a newer and richer format created with the goal of eventually replacing any uses of VML in the Office Open XML formats. VML should be considered a deprecated format included in Office Open XML for legacy reasons only and new applications that need a file format for drawings are strongly encouraged to use preferentially DrawingML
Warning - Excel is known to put invalid XML into these files! For example, >br< without being closed or escaped crops up.
See 6.4 VML - SpreadsheetML Drawing in Office Open XML Part 4 - Markup Language Reference.pdf (表示 SpreadsheetML VML 绘图。在 Excel 2007 中,VML 绘图用于描述单元格注释的属性,尽管规范说 VML 已被弃用:VML 格式是最初随 Office 2000 引入的旧格式,出于向后兼容性的原因,在本标准中包含并完全定义。 DrawingML 格式是一种更新、更丰富的格式,其目标是最终取代 Office Open XML 格式中对 VML 的任何使用。仅出于遗留原因,VML 应被视为 Office Open XML 中已弃用的格式,强烈建议需要绘图文件格式的新应用程序优先使用 DrawingML 警告 - 众所周知,Excel 会将无效的 XML 放入这些文件中!例如,>br< 没有被关闭或逃脱的突然出现。请参阅 6.4 VML - Office Open XML 中的 SpreadsheetML 绘图第 4 部分 - 标记语言参考.pdf)POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
static javax.xml.namespace.QName |
QNAME_VMLDRAWING
to actually process the namespace-less vmldrawing, we've introduced a proxy namespace.
(为了实际处理无命名空间的 vmldrawing,我们引入了代理命名空间。)
|
Modifier | Constructor and Description |
---|---|
protected |
XSSFVMLDrawing()
Create a new SpreadsheetML drawing
(创建新的 SpreadsheetML 绘图)
|
protected |
XSSFVMLDrawing(PackagePart part)
Construct a SpreadsheetML drawing from a package part
(从包部件构造 SpreadsheetML 绘图)
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Save the content in the underlying package part.
(将内容保存在底层包部分中。)
|
com.microsoft.schemas.vml.CTShape |
findCommentShape(int row, int col)
Find a shape with ClientData of type "NOTE" and the specified row and column
(查找类型为“NOTE”的 ClientData 以及指定的行和列的形状)
|
org.apache.poi.schemas.vmldrawing.XmlDocument |
getDocument() |
protected java.util.List<org.apache.xmlbeans.XmlObject> |
getItems() |
protected com.microsoft.schemas.vml.CTShape |
newCommentShape() |
protected void |
read(java.io.InputStream is) |
protected boolean |
removeCommentShape(int row, int col) |
protected void |
write(java.io.OutputStream out) |
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
public static final javax.xml.namespace.QName QNAME_VMLDRAWING
protected XSSFVMLDrawing()
XSSFSheet.createDrawingPatriarch()
protected XSSFVMLDrawing(PackagePart part) throws java.io.IOException, org.apache.xmlbeans.XmlException
part
- the package part holding the drawing data, the content type must be
application/vnd.openxmlformats-officedocument.drawing+xml
(part - 包含绘图数据的包部分,内容类型必须是 application/vnd.openxmlformats-officedocument.drawing+xml)
java.io.IOException
(java.io.IOException)
org.apache.xmlbeans.XmlException
(org.apache.xmlbeans.XmlException)
public org.apache.poi.schemas.vmldrawing.XmlDocument getDocument()
protected void read(java.io.InputStream is) throws java.io.IOException, org.apache.xmlbeans.XmlException
java.io.IOException
(java.io.IOException)
org.apache.xmlbeans.XmlException
(org.apache.xmlbeans.XmlException)
protected java.util.List<org.apache.xmlbeans.XmlObject> getItems()
protected void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
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(); }(将内容保存在底层包部分中。默认实现是空的,这意味着包部分保持不变。子类应覆盖并添加逻辑以将“模型”编组到 Ooxml4J。例如,保存通用 XML 条目的代码可能如下所示: protected void commit() throws IOException { PackagePart part = getPackagePart();输出流输出 = part.getOutputStream(); XmlObject bean = getXmlBean(); //保存内存变化的“模型” bean.save(out, DEFAULT_XML_OPTIONS); out.close(); })
commit
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
protected com.microsoft.schemas.vml.CTShape newCommentShape()
public com.microsoft.schemas.vml.CTShape findCommentShape(int row, int col)
null
(评论形状或空)
protected boolean removeCommentShape(int row, int col)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.