public interface RelationshipSource
Modifier and Type | Method and Description |
---|---|
PackageRelationship |
addExternalRelationship(java.lang.String target, java.lang.String relationshipType)
Adds an external relationship to a part (except relationships part).
(将外部关系添加到零件(关系零件除外)。)
|
PackageRelationship |
addExternalRelationship(java.lang.String target, java.lang.String relationshipType, java.lang.String id)
Adds an external relationship to a part (except relationships part).
(将外部关系添加到零件(关系零件除外)。)
|
PackageRelationship |
addRelationship(PackagePartName targetPartName, TargetMode targetMode, java.lang.String relationshipType)
Add a relationship to a part (except relationships part).
(向零件添加关系(关系零件除外)。)
|
PackageRelationship |
addRelationship(PackagePartName targetPartName, TargetMode targetMode, java.lang.String relationshipType, java.lang.String id)
Add a relationship to a part (except relationships part).
(向零件添加关系(关系零件除外)。)
|
void |
clearRelationships()
Delete all the relationships attached to this.
(删除所有附加到此的关系。)
|
PackageRelationship |
getRelationship(java.lang.String id)
Retrieves a package relationship from its id.
(从其 id 检索包关系。)
|
PackageRelationshipCollection |
getRelationships()
Retrieve all the relationships attached to this.
(检索与此相关的所有关系。)
|
PackageRelationshipCollection |
getRelationshipsByType(java.lang.String relationshipType)
Retrieve all relationships attached to this part which have the specified type.
(检索附加到此部件且具有指定类型的所有关系。)
|
boolean |
hasRelationships()
Knows if the part have any relationships.
(知道零件是否有任何关系。)
|
boolean |
isRelationshipExists(PackageRelationship rel)
Checks if the specified relationship is part of this package part.
(检查指定的关系是否是此包部分的一部分。)
|
void |
removeRelationship(java.lang.String id)
Delete the relationship specified by its id.
(删除由其 id 指定的关系。)
|
PackageRelationship addRelationship(PackagePartName targetPartName, TargetMode targetMode, java.lang.String relationshipType)
targetPartName
- Name of the target part. This one must be relative to the source root directory of the part.
(targetPartName - 目标部件的名称。这个必须相对于部件的源根目录。)
targetMode
- Mode [Internal|External].
(targetMode - 模式 [内部|外部]。)
relationshipType
- Type of relationship.
(relationshipType - 关系类型。)
PackageRelationship addRelationship(PackagePartName targetPartName, TargetMode targetMode, java.lang.String relationshipType, java.lang.String id)
Check rule M1.25: The Relationships part shall not have relationships to any other part. Package implementers shall enforce this requirement upon the attempt to create such a relationship and shall treat any such relationship as invalid.
(向零件添加关系(关系零件除外)。检查规则 M1.25:Relationships 部分不应与任何其他部分有关系。包实施者应在尝试创建此类关系时强制执行此要求,并将任何此类关系视为无效。)targetPartName
- Name of the target part. This one must be relative to the source root directory of the part.
(targetPartName - 目标部件的名称。这个必须相对于部件的源根目录。)
targetMode
- Mode [Internal|External].
(targetMode - 模式 [内部|外部]。)
relationshipType
- Type of relationship.
(relationshipType - 关系类型。)
id
- Relationship unique id.
(id - 关系唯一 ID。)
InvalidFormatException
- If the URI point to a relationship part URI.
(InvalidFormatException - 如果 URI 指向关系部分 URI。)
PackageRelationship addExternalRelationship(java.lang.String target, java.lang.String relationshipType)
target
- External target of the relationship
(target - 关系的外部目标)
relationshipType
- Type of relationship.
(relationshipType - 关系类型。)
addExternalRelationship(java.lang.String, java.lang.String)
PackageRelationship addExternalRelationship(java.lang.String target, java.lang.String relationshipType, java.lang.String id)
target
- External target of the relationship
(target - 关系的外部目标)
relationshipType
- Type of relationship.
(relationshipType - 关系类型。)
id
- Relationship unique id.
(id - 关系唯一 ID。)
addExternalRelationship(java.lang.String, java.lang.String)
void clearRelationships()
void removeRelationship(java.lang.String id)
id
- The ID identified the part to delete.
(id - 标识要删除的部分的 ID。)
PackageRelationshipCollection getRelationships() throws InvalidFormatException, OpenXML4JException
OpenXML4JException
(OpenXML4JException)
InvalidFormatException
(无效格式异常)
PackageRelationship getRelationship(java.lang.String id)
id
- ID of the package relationship to retrieve.
(id - 要检索的包关系的 ID。)
PackageRelationshipCollection getRelationshipsByType(java.lang.String relationshipType) throws InvalidFormatException, java.lang.IllegalArgumentException, OpenXML4JException
relationshipType
- Relationship type filter.
(relationshipType - 关系类型过滤器。)
InvalidFormatException
- If an error occurs while parsing the part.
(InvalidFormatException - 如果在解析部件时发生错误。)
InvalidOperationException
- If the package is open in write only mode.
(InvalidOperationException - 如果包以只写模式打开。)
java.lang.IllegalArgumentException
(java.lang.IllegalArgumentException)
OpenXML4JException
(OpenXML4JException)
boolean hasRelationships()
boolean isRelationshipExists(PackageRelationship rel)
rel
- The relationship to check.
(rel - 要检查的关系。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.