public abstract class Part extends Base
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log
Logger.
|
protected OpcPackage |
pack |
contentType, partName, relationships
Constructor and Description |
---|
Part() |
Part(PartName partName)
Constructor.
|
Part(PartName partName,
String contentType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getContentLengthAsLoaded()
returns the size in bytes of this part as stored,
or -1 if unknown.
|
RelationshipsPart |
getOwningRelationshipPart()
Deprecated.
|
OpcPackage |
getPackage() |
String |
getRelationshipType() |
Relationship |
getSourceRelationship()
Deprecated.
|
List<Relationship> |
getSourceRelationships() |
long |
getVersion() |
abstract boolean |
isContentEqual(Part other) |
void |
remove()
Remove this part from the pkg.
|
void |
rename(PartName newName)
Rename this part; updates source rels and parts collection.
|
protected void |
setContentLengthAsLoaded(long contentLengthAsLoaded) |
void |
setOwningRelationshipPart(RelationshipsPart owningRelationshipPart)
Deprecated.
|
void |
setPackage(OpcPackage pack) |
boolean |
setPartShortcut(Part part,
String relationshipType)
Tell the source Part about this target Part, so the
source can use this part via a convenience method.
|
void |
setRelationshipType(String relationshipType) |
void |
setSourceRelationship(Relationship sourceRelationship)
Deprecated.
|
void |
setVersion(long version) |
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData
protected static org.slf4j.Logger log
protected OpcPackage pack
public Part()
public Part(PartName partName) throws InvalidFormatException
pack
- Parent package.partName
- The part name, relative to the parent Package root.InvalidFormatException
- If the specified URI is not valid.public Part(PartName partName, String contentType) throws InvalidFormatException
pack
- Parent package.partName
- The part name, relative to the parent Package root.contentType
- The Multipurpose Internet Mail Extensions (MIME) content type
of the part's data stream.InvalidFormatException
public List<Relationship> getSourceRelationships()
@Deprecated public Relationship getSourceRelationship()
@Deprecated public void setSourceRelationship(Relationship sourceRelationship)
sourceRelationship
- the sourceRelationship to setpublic String getRelationshipType()
public void setRelationshipType(String relationshipType)
@Deprecated public RelationshipsPart getOwningRelationshipPart()
@Deprecated public void setOwningRelationshipPart(RelationshipsPart owningRelationshipPart)
public long getContentLengthAsLoaded()
protected void setContentLengthAsLoaded(long contentLengthAsLoaded)
contentLengthAsLoaded
- the contentLengthAsLoaded to setpublic OpcPackage getPackage()
getPackage
in class Base
public void setPackage(OpcPackage pack)
public boolean setPartShortcut(Part part, String relationshipType)
Base
setPartShortcut
in class Base
public void setVersion(long version)
public long getVersion()
public void rename(PartName newName)
newName
- public abstract boolean isContentEqual(Part other) throws Docx4JException
Docx4JException
public void remove()
Copyright © 2007-2019. All Rights Reserved.