|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.POIXMLDocumentPart
public class POIXMLDocumentPart
Represents an entry of a OOXML package.
Each POIXMLDocumentPart keeps a reference to the underlying a PackagePart
.
Field Summary | |
---|---|
static org.apache.xmlbeans.XmlOptions |
DEFAULT_XML_OPTIONS
|
Constructor Summary | |
---|---|
POIXMLDocumentPart()
Creates new POIXMLDocumentPart - called by client code to create new parts from scratch. |
|
POIXMLDocumentPart(org.openxml4j.opc.Package pkg)
Construct POIXMLDocumentPart representing a "core document" package part. |
|
POIXMLDocumentPart(org.openxml4j.opc.PackagePart part,
org.openxml4j.opc.PackageRelationship rel)
Creates an POIXMLDocumentPart representing the given package part and relationship. |
Method Summary | |
---|---|
protected void |
addRelation(POIXMLDocumentPart part)
Add a new child POIXMLDocumentPart |
protected void |
commit()
Save the content in the underlying package part. |
protected POIXMLDocumentPart |
createRelationship(POIXMLRelation descriptor,
POIXMLFactory factory)
Create a new child POIXMLDocumentPart |
protected POIXMLDocumentPart |
createRelationship(POIXMLRelation descriptor,
POIXMLFactory factory,
int idx)
|
protected POIXMLDocumentPart |
createRelationship(POIXMLRelation descriptor,
POIXMLFactory factory,
int idx,
boolean noRelation)
Create a new child POIXMLDocumentPart |
org.openxml4j.opc.PackagePart |
getPackagePart()
Provides access to the underlying PackagePart |
org.openxml4j.opc.PackageRelationship |
getPackageRelationship()
Provides access to the PackageRelationship that identifies this POIXMLDocumentPart |
POIXMLDocumentPart |
getParent()
Returns the parent POIXMLDocumentPart. |
java.util.List<POIXMLDocumentPart> |
getRelations()
Returns the list of child relations for this POIXMLDocumentPart |
protected void |
onDocumentCreate()
Fired when a new package part is created |
protected void |
onDocumentRead()
Fired when a package part is read |
protected void |
onSave()
Save changes in the underlying OOXML package. |
protected void |
read(POIXMLFactory factory)
Iterate through the underlying PackagePart and create child POIXMLFactory instances using the specified factory |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.xmlbeans.XmlOptions DEFAULT_XML_OPTIONS
Constructor Detail |
---|
public POIXMLDocumentPart(org.openxml4j.opc.Package pkg)
public POIXMLDocumentPart()
createRelationship(POIXMLRelation, POIXMLFactory, int, boolean)
public POIXMLDocumentPart(org.openxml4j.opc.PackagePart part, org.openxml4j.opc.PackageRelationship rel)
read(POIXMLFactory)
when reading in an exisiting file.
part
- - The package part that holds xml data represenring this sheet.rel
- - the relationship of the given package partread(POIXMLFactory)
Method Detail |
---|
public final org.openxml4j.opc.PackagePart getPackagePart()
public final org.openxml4j.opc.PackageRelationship getPackageRelationship()
public final java.util.List<POIXMLDocumentPart> getRelations()
protected final void addRelation(POIXMLDocumentPart part)
part
- the child to addpublic final POIXMLDocumentPart getParent()
null
for the root element.public java.lang.String toString()
toString
in class java.lang.Object
protected void commit() throws java.io.IOException
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();
}
java.io.IOException
protected final void onSave() throws java.io.IOException
commit()
for each package part
java.io.IOException
protected final POIXMLDocumentPart createRelationship(POIXMLRelation descriptor, POIXMLFactory factory)
descriptor
- the part descriptorfactory
- the factory that will create an instance of the requested relation
protected final POIXMLDocumentPart createRelationship(POIXMLRelation descriptor, POIXMLFactory factory, int idx)
protected final POIXMLDocumentPart createRelationship(POIXMLRelation descriptor, POIXMLFactory factory, int idx, boolean noRelation)
descriptor
- the part descriptorfactory
- the factory that will create an instance of the requested relationidx
- part numbernoRelation
- if true, then no relationship is added.
protected final void read(POIXMLFactory factory) throws org.openxml4j.exceptions.OpenXML4JException
factory
- the factory object that creates POIXMLFactory instances
org.openxml4j.exceptions.OpenXML4JException
protected void onDocumentCreate() throws java.io.IOException
java.io.IOException
protected void onDocumentRead() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |