Class MediaInline

    • Method Detail

      • id

        public String id()
        Returns the mediaInline node's ID.
        Specified by:
        id in interface InternalMediaNode
        Returns:
        the mediaInline node's ID.
      • occurrenceKey

        public Optional<String> occurrenceKey()
        Returns the mediaInline node's occurrence key, if set.
        Specified by:
        occurrenceKey in interface InternalMediaNode
        Returns:
        the mediaInline node's occurrence key, or empty() if not set.
      • occurrenceKey

        public MediaInline occurrenceKey​(@Nullable
                                         String occurrenceKey)
        Sets the occurrence key for this mediaInline item. Although this attribute is optional, it must be set to enable deletion of files from a collection.
        Specified by:
        occurrenceKey in interface InternalMediaNode
        Parameters:
        occurrenceKey - the occurrence key value
        Returns:
        this
      • mediaInlineLink

        @Deprecated
        public static MediaInline.Partial.NeedsId mediaInlineLink()
        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.
      • mediaInlineLink

        @Deprecated
        public static MediaInline mediaInlineLink​(String id)
        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.
      • 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.
        Specified by:
        isLink in interface InternalMediaNode
      • width

        public Optional<Number> width()
        Returns the mediaInline node's display width, if set.
        Returns:
        the mediaInline node's display width, or empty() if not set.
      • width

        public MediaInline width​(Number width)
        Sets the width of the media.
        Parameters:
        width - the display width of the mediaInline item, in pixels; must be positive
        Returns:
        this
      • height

        public Optional<Number> height()
        Returns the mediaInline node's display height, if set.
        Returns:
        the mediaInline node's display height, or empty() if not set.
      • height

        public MediaInline height​(Number height)
        Sets the height of the media.
        Parameters:
        height - the display height of the mediaInline item, in pixels; must be positive
        Returns:
        this
      • mediaInline

        public static MediaInline mediaInline​(String id,
                                              @Nullable
                                              String collection)
        Creates a new mediaInline node with the given media ID and collection ID.
        Parameters:
        id - the Media Services ID used for querying the media services API to retrieve metadata, such as the filename. Consumers of the document should always fetch fresh metadata using the Media API rather than cache it locally.
        collection - the MediaInline Services Collection name for the media
        Returns:
        the new media node
      • mediaInline

        public static MediaInline mediaInline​(String id,
                                              @Nullable
                                              MediaInline.MediaType mediaType,
                                              @Nullable
                                              String collection)
        Creates a new mediaInline node with the given media ID, media type, and collection ID.
        Parameters:
        id - the Media Services ID used for querying the media services API to retrieve metadata, such as the filename. Consumers of the document should always fetch fresh metadata using the Media API rather than cache it locally.
        mediaType - the media type to assign
        collection - the MediaInline Services Collection name for the media
        Returns:
        the new media node
      • copy

        public MediaInline 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.
        Specified by:
        copy in interface Element
        Specified by:
        copy in interface Marked<MediaInline,​MediaInlineMark>
        Specified by:
        copy in interface Node
        Specified by:
        copy in class AbstractMarkedNode<MediaInline,​MediaInlineMark>
        Returns:
        a copy of this element, or this if the element is immutable anyway
      • elementType

        public String elementType()
        Description copied from interface: Element
        The type value that identifies this element, such as "paragraph" or "strong".
        Specified by:
        elementType in interface Element
      • 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.
        Specified by:
        toMap in interface Element
        Returns:
        the map representation of this ADF element