Interface Media

    • Method Detail

      • media

        @CheckReturnValue
        static Media.Partial.NeedsType media()
        Begins the fluent construction of a media node.
        Returns:
        an incomplete media node that needs the type to be specified
      • fileMedia

        @CheckReturnValue
        static Media.Partial.FileNeedsId fileMedia()
        Begins the fluent construction of a file media node. All required fields must also be specified before the media node is valid.
        Returns:
        a partial file media node
      • fileMedia

        static Media.FileMedia fileMedia​(String id,
                                         @Nullable
                                         String collection)
        Creates a new FILE media 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 Media Services Collection name for the media
        Returns:
        the new media node
      • linkMedia

        @CheckReturnValue
        static Media.Partial.LinkNeedsId linkMedia()
        Begins the fluent construction of a link media node. All required fields must also be specified before the media node is valid.
        Returns:
        a partial link media node
      • linkMedia

        static Media.LinkMedia linkMedia​(String id,
                                         @Nullable
                                         String collection)
        Creates a new LINK media 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 Media Services Collection name for the media
        Returns:
        the new media node
      • type

        Media.MediaType type()
        Returns the media node's type.
        Returns:
        the media node's type.
      • width

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

        Media width​(@Nullable
                    Number width)
        Sets the width of the media. Although this attribute is optional, it must be set for the media item in a mediaSingle node, or the media is not displayed.
        Parameters:
        width - the display width of the media item, in pixels; must be positive
        Returns:
        this
      • height

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

        Media height​(@Nullable
                     Number height)
        Sets the height of the media. Although this attribute is optional, it must be set for the media item in a mediaSingle node, or the media is not displayed.
        Parameters:
        height - the display height of the media item, in pixels; must be positive
        Returns:
        this
      • size

        Media size​(@Nullable
                   Number width,
                   @Nullable
                   Number height)
        Sets the width and height of the media.

        This convenience method is exactly equivalent to calling width(width).height(height).

        Parameters:
        width - as for width(Number)
        height - as for height(Number)
        Returns:
        this
      • linkMark

        Media linkMark​(@Nullable
                       Link link)
      • linkMark

        Media linkMark​(@Nullable
                       URL url)
      • link

        @Deprecated
        Optional<Media.LinkMedia> link()
        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.
      • ifLink

        @Deprecated
        void ifLink​(Consumer<? super Media.LinkMedia> effect)
        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.
      • isFile

        boolean isFile()
      • isLink

        @Deprecated
        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

        boolean isExternal()