Class ExternalTarget

java.lang.Object
org.docx4j.openpackaging.parts.ExternalTarget

public final class ExternalTarget
extends java.lang.Object
"When set to External, the target attribute may be a relative reference or a URI. If the target attribute is a relative reference, then that reference is interpreted relative to the location of the package." Note: this method assumes an absolute location. ECMA 376 is a little bit ambiguous about whether an external resource is a "part" or not. - the definition of part implies that it is; there is no definition of resource - but the definition of part name in 8.1.1 "refers to parts _within_ a package" (but is within logical or physical?) - 8.3 Relationships: "Parts often contain references to other parts in the package and to resources outside the package" (POI has TargetMode and POIXMLRelation; they have PackagePart.addExternalRelationship We'll call them external resources. When we load an external resource, it is loaded as a part. But it is not stored in the package's parts collection; instead it is stored in a collection called ExternalResources. An ExternalTarget is the value of @target, made absolute if necessary. We don't need explicit support in RelationshipsPart for adding an external resource; you can do that by creating a Relationship object, then calling addRelationship (your reference in your @target should be relative, not absolute).
  • Constructor Summary

    Constructors 
    Constructor Description
    ExternalTarget​(java.lang.String target)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object other)  
    java.lang.String getValue()  
    int hashCode()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getValue

      public java.lang.String getValue()
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object