org.apache.poi
Class POIXMLFactory

java.lang.Object
  extended by org.apache.poi.POIXMLFactory
Direct Known Subclasses:
XDGFFactory, XSLFFactory, XSSFFactory, XWPFFactory

public abstract class POIXMLFactory
extends java.lang.Object

Defines a factory API that enables sub-classes to create instances of POIXMLDocumentPart


Constructor Summary
POIXMLFactory()
           
 
Method Summary
protected abstract  POIXMLDocumentPart createDocumentPart(java.lang.Class<? extends POIXMLDocumentPart> cls, java.lang.Class<?>[] classes, java.lang.Object[] values)
          Need to delegate instantiation to sub class because of constructor visibility
 POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent, PackagePart part)
          Create a POIXMLDocumentPart from existing package part and relation.
 POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent, PackageRelationship rel, PackagePart part)
          Deprecated. in POI 3.14, scheduled for removal in POI 3.16
protected abstract  POIXMLRelation getDescriptor(java.lang.String relationshipType)
          returns the descriptor for the given relationship type
protected  PackageRelationship getPackageRelationship(POIXMLDocumentPart parent, PackagePart part)
          Retrieves the package relationship of the child part within the parent
 POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor)
          Create a new POIXMLDocumentPart using the supplied descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POIXMLFactory

public POIXMLFactory()
Method Detail

createDocumentPart

public POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent,
                                             PackagePart part)
Create a POIXMLDocumentPart from existing package part and relation. This method is called from POIXMLDocument.load(POIXMLFactory) when parsing a document

Parameters:
parent - parent part
part - the PackagePart representing the created instance
Returns:
A new instance of a POIXMLDocumentPart.
Since:
by POI 3.14-Beta1

createDocumentPart

protected abstract POIXMLDocumentPart createDocumentPart(java.lang.Class<? extends POIXMLDocumentPart> cls,
                                                         java.lang.Class<?>[] classes,
                                                         java.lang.Object[] values)
                                                  throws java.lang.SecurityException,
                                                         java.lang.NoSuchMethodException,
                                                         java.lang.InstantiationException,
                                                         java.lang.IllegalAccessException,
                                                         java.lang.reflect.InvocationTargetException
Need to delegate instantiation to sub class because of constructor visibility

Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
Since:
POI 3.14-Beta1

getDescriptor

protected abstract POIXMLRelation getDescriptor(java.lang.String relationshipType)
returns the descriptor for the given relationship type

Returns:
the descriptor or null if type is unknown
Since:
POI 3.14-Beta1

createDocumentPart

@Deprecated
public final POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent,
                                                              PackageRelationship rel,
                                                              PackagePart part)
Deprecated. in POI 3.14, scheduled for removal in POI 3.16

Create a POIXMLDocumentPart from existing package part and relation. This method is called from POIXMLDocument.load(POIXMLFactory) when parsing a document

Parameters:
parent - parent part
rel - the package part relationship
part - the PackagePart representing the created instance
Returns:
A new instance of a POIXMLDocumentPart.

newDocumentPart

public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor)
Create a new POIXMLDocumentPart using the supplied descriptor. This method is used when adding new parts to a document, for example, when adding a sheet to a workbook, slide to a presentation, etc.

Parameters:
descriptor - describes the object to create
Returns:
A new instance of a POIXMLDocumentPart.

getPackageRelationship

protected PackageRelationship getPackageRelationship(POIXMLDocumentPart parent,
                                                     PackagePart part)
Retrieves the package relationship of the child part within the parent

Since:
POI 3.14-Beta1


Copyright 2016 The Apache Software Foundation or its licensors, as applicable.