org.apache.poi
Class POIXMLRelation

java.lang.Object
  extended by org.apache.poi.POIXMLRelation
Direct Known Subclasses:
XSLFRelation, XSSFRelation, XWPFRelation

public abstract class POIXMLRelation
extends java.lang.Object

Represents a descriptor of a OOXML relation.

Author:
Yegor Kozlov

Field Summary
protected  java.lang.String _defaultName
          The path component of a pack URI.
protected  java.lang.String _relation
          The kind of connection between a source part and a target part in a package.
protected  java.lang.String _type
          Describes the content stored in a part.
 
Constructor Summary
POIXMLRelation(java.lang.String type, java.lang.String rel, java.lang.String defaultName)
          Instantiates a POIXMLRelation.
POIXMLRelation(java.lang.String type, java.lang.String rel, java.lang.String defaultName, java.lang.Class<? extends POIXMLDocumentPart> cls)
          Instantiates a POIXMLRelation.
 
Method Summary
 java.lang.String getContentType()
          Return the content type.
 java.lang.String getDefaultFileName()
          Return the default part name.
 java.lang.String getFileName(int index)
          Returns the filename for the nth one of these, e.g.
 java.lang.String getRelation()
          Return the relationship, the kind of connection between a source part and a target part in a package.
 java.lang.Class<? extends POIXMLDocumentPart> getRelationClass()
          Return type of the obejct used to construct instances of this relationship
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_type

protected java.lang.String _type
Describes the content stored in a part.


_relation

protected java.lang.String _relation
The kind of connection between a source part and a target part in a package.


_defaultName

protected java.lang.String _defaultName
The path component of a pack URI.

Constructor Detail

POIXMLRelation

public POIXMLRelation(java.lang.String type,
                      java.lang.String rel,
                      java.lang.String defaultName,
                      java.lang.Class<? extends POIXMLDocumentPart> cls)
Instantiates a POIXMLRelation.

Parameters:
type - content type
rel - relationship
defaultName - default item name
cls - defines what object is used to construct instances of this relationship

POIXMLRelation

public POIXMLRelation(java.lang.String type,
                      java.lang.String rel,
                      java.lang.String defaultName)
Instantiates a POIXMLRelation.

Parameters:
type - content type
rel - relationship
defaultName - default item name
Method Detail

getContentType

public java.lang.String 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

public java.lang.String 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

public java.lang.String 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

public java.lang.String getFileName(int index)
Returns the filename for the nth one of these, e.g. /xl/comments4.xml


getRelationClass

public java.lang.Class<? extends POIXMLDocumentPart> getRelationClass()
Return type of the obejct used to construct instances of this relationship

Returns:
the class of the object used to construct instances of this relation


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