Package org.apache.poi.ooxml
Class POIXMLRelation
java.lang.Object
org.apache.poi.ooxml.POIXMLRelation
- Direct Known Subclasses:
XDGFRelation
,XSLFRelation
,XSSFBRelation
,XSSFRelation
,XWPFRelation
Represents a descriptor of a OOXML relation.
-
Constructor Summary
ConstructorsConstructorDescriptionPOIXMLRelation
(String type, String rel, String defaultName) Instantiates a POIXMLRelation.POIXMLRelation
(String type, String rel, String defaultName, Class<? extends POIXMLDocumentPart> cls) Instantiates a POIXMLRelation. -
Method Summary
Modifier and TypeMethodDescriptiongetContents
(PackagePart corePart) Fetches the InputStream to read the contents, based of the specified core part, for which we are defined as a suitable relationshipReturn the content type.Return the default part name.getFileName
(int index) Returns the filename for the nth one of these, e.g.Returns the index of the filename within the package for the given part.Return the relationship, the kind of connection between a source part and a target part in a package.Class
<? extends POIXMLDocumentPart> Return type of the object used to construct instances of this relationship
-
Constructor Details
-
POIXMLRelation
public POIXMLRelation(String type, String rel, String defaultName, Class<? extends POIXMLDocumentPart> cls) Instantiates a POIXMLRelation.- Parameters:
type
- content typerel
- relationshipdefaultName
- default item namecls
- defines what object is used to construct instances of this relationship
-
POIXMLRelation
Instantiates a POIXMLRelation.- Parameters:
type
- content typerel
- relationshipdefaultName
- default item name
-
-
Method Details
-
getContentType
Return the content type. Content types define a media type, a subtype, and an optional set of parameters, as defined in RFC 2616.- Returns:
- the content type
-
getRelation
Return the relationship, the kind of connection between a source part and a target part in a package. Relationships make the connections between parts directly discoverable without looking at the content in the parts, and without altering the parts themselves.- Returns:
- the relationship
-
getDefaultFileName
Return the default part name. Part names are used to refer to a part in the context of a package, typically as part of a URI.- Returns:
- the default part name
-
getFileName
Returns the filename for the nth one of these, e.g. /xl/comments4.xml- Parameters:
index
- the suffix for the document type- Returns:
- the filename including the suffix
-
getFileNameIndex
Returns the index of the filename within the package for the given part. e.g. 4 for /xl/comments4.xml- Parameters:
part
- the part to read the suffix from- Returns:
- the suffix
-
getRelationClass
Return type of the object used to construct instances of this relationship- Returns:
- the class of the object used to construct instances of this relation
-
getContents
Fetches the InputStream to read the contents, based of the specified core part, for which we are defined as a suitable relationship- Throws:
IOException
InvalidFormatException
- Since:
- 3.16-beta3
-