org.docx4j.openpackaging
Class Base

java.lang.Object
  extended by org.docx4j.openpackaging.Base
Direct Known Subclasses:
Package, Part

public abstract class Base
extends java.lang.Object


Field Summary
 PartName partName
          The part name.
 
Constructor Summary
Base()
           
 
Method Summary
 void addTargetPart(Part targetpart)
          Convenience method to add a part to this Part's relationships.
 java.lang.String getContentType()
           
abstract  Package getPackage()
           
 PartName getPartName()
           
 RelationshipsPart getRelationshipsPart()
          Get the relationship part
 void setContentType(ContentType contentType)
           
abstract  boolean setPartShortcut(Part part, java.lang.String relationshipType)
          Tell the source Part about this target Part, so the source can use this part via a convenience method.
 void setRelationships(RelationshipsPart relationships)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partName

public PartName partName
The part name. (required by the specification [M1.1]) Note that in docx4J, part names should be resolved, before being set, so that they are absolute (ie start with '/'). We will assume the Package has a part name of "/"

Constructor Detail

Base

public Base()
Method Detail

addTargetPart

public void addTargetPart(Part targetpart)
                   throws InvalidFormatException
Convenience method to add a part to this Part's relationships. The package must be set on this part in order for this to work.

Parameters:
targetpart - The part to add to this part's relationships
Throws:
InvalidFormatException

getContentType

public java.lang.String getContentType()

getPackage

public abstract Package getPackage()

getPartName

public PartName getPartName()
Returns:
the uri

getRelationshipsPart

public RelationshipsPart getRelationshipsPart()
Get the relationship part

Returns:
The relationship part name.

setContentType

public void setContentType(ContentType contentType)

setPartShortcut

public abstract boolean setPartShortcut(Part part,
                                        java.lang.String relationshipType)
Tell the source Part about this target Part, so the source can use this part via a convenience method.

Parameters:
part -
relationshipType -
Returns:
true if the source Part does use the target Part in a convenience method.

setRelationships

public void setRelationships(RelationshipsPart relationships)