Class InformationDesc


  • public class InformationDesc
    extends java.lang.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 Detail

      • INFORMATION_ELEMENT

        public static final java.lang.String INFORMATION_ELEMENT
        See Also:
        Constant Field Values
      • LOCALE_ATTRIBUTE

        public static final java.lang.String LOCALE_ATTRIBUTE
        See Also:
        Constant Field Values
      • OFFLINE_ALLOWED_ELEMENT

        public static final java.lang.String OFFLINE_ALLOWED_ELEMENT
        See Also:
        Constant Field Values
      • locales

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

        private final java.lang.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 java.lang.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 java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> info
        the data as list of key,value pairs
      • strict

        public final boolean strict
    • Constructor Detail

      • InformationDesc

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

        public InformationDesc​(java.util.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​(java.util.Locale[] locales,
                               java.lang.String os,
                               java.lang.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​(java.util.Locale[] locales,
                               java.lang.String os,
                               java.lang.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 Detail

      • getTitle

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

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

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

        public java.lang.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 java.lang.String getDescription​(DescriptionKind kind)
        Parameters:
        kind - one of DescriptionKind
        Returns:
        the application's description of the specified type.
      • getDescriptionStrict

        public java.lang.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 java.net.URL getIconLocation​(IconKind kind,
                                            int dimension)
      • getIconLocation

        public java.net.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 java.util.Locale[] getLocales()
        Returns:
        the locales for the information.
      • getOs

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

        public java.lang.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 java.lang.Object getItem​(java.lang.String key)
        Parameters:
        key - key to find item
        Returns:
        the last item matching the specified key.
      • getItems

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

        public void addItem​(java.lang.String key,
                            java.lang.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 java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> getItems()