Class ApplicationDesc

  • All Implemented Interfaces:
    EntryPoint

    public class ApplicationDesc
    extends java.lang.Object
    implements EntryPoint
    The application-desc element contains all information needed to launch an application, given the resources described by the resources element. A JNLP file is an application descriptor if the application-desc element is specified.
    • Constructor Summary

      Constructors 
      Constructor Description
      ApplicationDesc​(java.lang.String mainClass, java.lang.String[] arguments)
      Creates an application descriptor element.
      ApplicationDesc​(ApplicationType type, java.lang.String mainClass, java.lang.String[] arguments)
      Creates an application descriptor element.
      ApplicationDesc​(ApplicationType type, java.lang.String mainClass, java.lang.String progressClass, java.lang.String[] arguments)
      Creates an application descriptor element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addArgument​(java.lang.String argument)
      Add an argument to the end of the ordered list of arguments.
      java.lang.String[] getArguments()
      Contains an ordered list of arguments for the application.
      java.lang.String getMainClass()
      For Java applications this method returns the name of the class containing the public static void main(String[]) method.
      java.lang.String getProgressClass()
      The name of a class containing an implementation of the DownloadServiceListener interface of applications.
      ApplicationType getType()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • APPLICATION_DESC_ELEMENT

        public static final java.lang.String APPLICATION_DESC_ELEMENT
        See Also:
        Constant Field Values
      • JAVAFX_DESC_ELEMENT

        public static final java.lang.String JAVAFX_DESC_ELEMENT
        See Also:
        Constant Field Values
      • ARGUMENT_ELEMENT

        public static final java.lang.String ARGUMENT_ELEMENT
        See Also:
        Constant Field Values
      • PROGRESS_CLASS_ATTRIBUTE

        public static final java.lang.String PROGRESS_CLASS_ATTRIBUTE
        See Also:
        Constant Field Values
      • type

        private final ApplicationType type
        The type of application supported by the JNLP Client. The optional attribute indicates the type of application contained in the resources and identified by the main-class attribute. The default value is ApplicationType.JAVA.

        If given the type attribute value is not supported by the JNLP Client, the launch should be aborted. If a JNLP Client supports other types of applications (such as "JavaFX", or "JRuby"), The meaning and/or use of the other application-desc attributes (main-class and progress-class) and sub-elements (argument and param) may vary as is appropriate for that type of application.

      • mainClass

        private final java.lang.String mainClass
        For Java applications this method returns the name of the class containing the public static void main(String[]) method. The name and/or meaning may vary as is appropriate for other types of applications.
      • progressClass

        private final java.lang.String progressClass
        The name of a class containing an implementation of the DownloadServiceListener interface of applications. May be used to indicate download progress.
      • arguments

        private final java.util.List<java.lang.String> arguments
        Contains an ordered list of arguments for the application.
    • Constructor Detail

      • ApplicationDesc

        public ApplicationDesc​(java.lang.String mainClass,
                               java.lang.String[] arguments)
        Creates an application descriptor element.
        Parameters:
        mainClass - the fully qualified name of the class containing the main method of the application
        arguments - the arguments
      • ApplicationDesc

        public ApplicationDesc​(ApplicationType type,
                               java.lang.String mainClass,
                               java.lang.String[] arguments)
        Creates an application descriptor element.
        Parameters:
        type - the type of application supported by the JNLP Client
        mainClass - the fully qualified name of the class containing the main method of the application
        arguments - the arguments
      • ApplicationDesc

        public ApplicationDesc​(ApplicationType type,
                               java.lang.String mainClass,
                               java.lang.String progressClass,
                               java.lang.String[] arguments)
        Creates an application descriptor element.
        Parameters:
        type - the type of application supported by the JNLP Client
        mainClass - the fully qualified name of the class containing the main method of the application
        progressClass - the fully qualified name of the class containing an implementation of the DownloadServiceListener interface
        arguments - the arguments
    • Method Detail

      • getType

        public ApplicationType getType()
        Returns:
        the type of application supported by the JNLP Client
      • getMainClass

        public java.lang.String getMainClass()
        For Java applications this method returns the name of the class containing the public static void main(String[]) method. The name and/or meaning may vary as is appropriate for other types of applications.

        This attribute can be omitted if the main class can be found from the Main-Class manifest entry in the main JAR file.

        Specified by:
        getMainClass in interface EntryPoint
        Returns:
        the fully qualified name of the class containing the main method of the application
      • getProgressClass

        public java.lang.String getProgressClass()
        The name of a class containing an implementation of the DownloadServiceListener interface of applications.
        Returns:
        the fully qualified name of the class containing an implementation of the DownloadServiceListener interface
      • getArguments

        public java.lang.String[] getArguments()
        Contains an ordered list of arguments for the application.
        Returns:
        the arguments
      • addArgument

        public void addArgument​(java.lang.String argument)
        Add an argument to the end of the ordered list of arguments.
        Parameters:
        argument - argument of command