Class InformationDesc

java.lang.Object
net.adoptopenjdk.icedteaweb.jnlp.element.information.InformationDesc

public class InformationDesc extends Object
The information element contains information intended to be consumed by the JNLP Client to integrate the application into the desktop, provide user feedback, etc.
  • Field Details

    • INFORMATION_ELEMENT

      public static final String INFORMATION_ELEMENT
      See Also:
    • OS_ATTRIBUTE

      public static final String OS_ATTRIBUTE
      See Also:
    • ARCH_ATTRIBUTE

      public static final String ARCH_ATTRIBUTE
      See Also:
    • LOCALE_ATTRIBUTE

      public static final String LOCALE_ATTRIBUTE
      See Also:
    • TITLE_ELEMENT

      public static final String TITLE_ELEMENT
      See Also:
    • VENDOR_ELEMENT

      public static final String VENDOR_ELEMENT
      See Also:
    • OFFLINE_ALLOWED_ELEMENT

      public static final String OFFLINE_ALLOWED_ELEMENT
      See Also:
    • locales

      private final Locale[] locales
      The locales for which the information element should be used.
    • os

      private final String os
      Specifies the operating system for which the information element should be considered. If the value is a prefix of the os.name system property, then the information element can be used. If the attribute is not specified, it matches all operating systems.
    • arch

      private final String arch
      Specifies the architecure for which the information element should be considered. If the value is a prefix of the os.arch system property, then the information element can be used. If the attribute is not specified, it matches all architecures.
    • info

      private final Map<String, List<Object>> info
      the data as list of key,value pairs
    • strict

      public final boolean strict
  • Constructor Details

    • InformationDesc

      InformationDesc(Locale[] locales)
      Create an information element object.
      Parameters:
      locales - the locales for which the information element should be used
    • InformationDesc

      public InformationDesc(Locale[] locales, boolean strict)
      Create an information element object.
      Parameters:
      locales - the locales for which the information element should be used
      strict - whether parser was strict
    • InformationDesc

      public InformationDesc(Locale[] locales, String os, String arch)
      Create an information element object.
      Parameters:
      locales - the locales for which the information element should be used
      os - the operating system for which the information element should be considered
      arch - the architecure for which the information element should be considered
    • InformationDesc

      public InformationDesc(Locale[] locales, String os, String arch, boolean strict)
      Create an information element object.
      Parameters:
      locales - the locales for which the information element should be used
      os - the operating system for which the information element should be considered
      arch - the architecure for which the information element should be considered
      strict - whether parser was strict
  • Method Details

    • getTitle

      public String getTitle()
      Returns:
      the application's title.
    • getVendor

      public String getVendor()
      Returns:
      the application's vendor.
    • getHomepage

      public URL getHomepage()
      Returns:
      the application's homepage.
    • getDescription

      public String getDescription()
      A short statement about the application. Longer descriptions should be put on a separate web page and referred to using the homepage element.
      Returns:
      the default description for the application.
    • getDescription

      public String getDescription(DescriptionKind kind)
      Parameters:
      kind - one of DescriptionKind
      Returns:
      the application's description of the specified type.
    • getDescriptionStrict

      public String getDescriptionStrict(DescriptionKind kind)
      Parameters:
      kind - one of DescriptionKind
      Returns:
      the application's description of the specified type.
    • getIcons

      public IconDesc[] getIcons(IconKind kind)
      Returns the icons specified by the JNLP file.
      Parameters:
      kind - one of IconKind
      Returns:
      an array of zero of more IconDescs of the specified icon type
    • getIconLocation

      public URL getIconLocation(IconKind kind, int dimension)
    • getIconLocation

      public URL getIconLocation(IconKind kind, int width, int height)
      Returns the URL of the icon with the given type and a size closest to the requested width and height. This method will only return an icon smaller than the specified width and height if there exists no bigger icons.
      Parameters:
      kind - the kind of icon to get
      width - desired width of icon
      height - desired height of icon
      Returns:
      the closest icon by size or null if no icons declared
    • squareDistance

      private long squareDistance(int width, int height, IconDesc icon)
    • getLocales

      public Locale[] getLocales()
      Returns:
      the locales for the information.
    • getOs

      public String getOs()
      Returns:
      the operating system for which the information element should be considered
    • getArch

      public String getArch()
      Returns:
      the architecure for which the information element should be considered
    • isOfflineAllowed

      public boolean isOfflineAllowed()
      Returns:
      whether offline execution allowed.
    • isSharingAllowed

      public boolean isSharingAllowed()
      Returns:
      whether the resources specified in the JNLP file may be shared by more than one instance in the same JVM (JNLP extension). This is an extension to the JNLP spec and will always return false for standard JNLP files.
    • getAssociations

      public AssociationDesc[] getAssociations()
      Returns:
      the associations specified in the JNLP file
    • getShortcut

      public ShortcutDesc getShortcut()
      Returns:
      the shortcut specified by this JNLP file
    • getRelatedContents

      public RelatedContentDesc[] getRelatedContents()
      Returns:
      the related-contents specified by this JNLP file
    • getItem

      private Object getItem(String key)
      Parameters:
      key - key to find item
      Returns:
      the last item matching the specified key.
    • getItems

      public List<Object> getItems(String key)
      Parameters:
      key - key to find item
      Returns:
      all items matching the specified key.
    • addItem

      public void addItem(String key, Object value)
      Add an information item (description, icon, etc) under a specified key name.
      Parameters:
      key - key to place value to
      value - value to be placed to key
    • getItems

      public Map<String, List<Object>> getItems()