Class Media.ExternalMedia

    • Method Detail

      • copy

        public Media.ExternalMedia copy()
        Description copied from interface: Element
        Returns a deep copy of this element, including copies of any nodes or marks that it contains. The copy will not necessarily be in exactly the same state as the original in some cases. For example, a text node that is used inside a codeBlock will have the ability to use marks on it disabled, but a copy made of the text node using this method will not similarly disallow marks unless it is also added to a content node with those same restrictions.

        Implementations notes:

        • Implementations should narrow the return type.
        • Implementations should return this if the element is immutable. The @Immutable annotation should be used on the class to offer additional confirmation of this intent.
        • Implementations should return parse(toMap()) if they have state.
        • While there may be cases where it is worthwhile to do something more efficient than the conversion to a map and back, this is discouraged because it would add yet another fragile piece of code that breaks when new data is added to the node. The parse and toMap methods already have to be updated in these circumstances, so it makes sense to take advantage of that.
        Returns:
        a copy of this element, or this if the element is immutable anyway
      • url

        public String url()
        Returns the url value for the external media.
      • type

        public Media.MediaType type()
        Description copied from interface: Media
        Returns the media node's type.
        Returns:
        the media node's type.
      • isFile

        public boolean isFile()
      • isLink

        @Deprecated
        public boolean isLink()
        Deprecated.
        Most of the support for link media no longer functions in the editor code base, so clients are unlikely to encounter it in the wild and should not use it in new ADF.
      • isExternal

        public boolean isExternal()
      • toMap

        public Map<String,​?> toMap()
        Description copied from interface: Element
        Transforms this element to a map of String values to various basic object types suitable for direct rendering as JSON content.
        Returns:
        the map representation of this ADF element