Class Link.Launcher
java.lang.Object
org.apache.tools.ant.taskdefs.modules.Link.Launcher
- Enclosing class:
Link
Child element representing a custom launcher command in a linked image.
A launcher has a name, which is typically used as a file name for an
executable file, a Java module name, and optionally a class within
that module which can act as a standard Java main class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the attribute of this element which contains the main class to execute in this element's module, if that module doesn't define its main class.Returns the attribute of this element which contains the name of the Java module to execute.getName()
Returns this element's name attribute, typically used as the basis of an executable file name.void
setMainClass
(String className) Sets the attribute which contains the main class to execute in this element's module, if that module doesn't define its main class.void
Sets the attribute of this element which contains the name of a Java module to execute.void
Sets this element's name attribute, which is typically used by the linker to create an executable file with a similar name.toString()
Returns this element's information in jlink launcher format: name=
module or name=
module/
mainclass.void
validate()
Verifies this element's state.
-
Constructor Details
-
Launcher
public Launcher()Creates a new, unconfigured element. -
Launcher
Creates a new element from ajlink
-compatible string specifier, which must take the form name=
module or name=
module/
mainclass.- Parameters:
textSpec
- name, module, and optional main class, as described above- Throws:
NullPointerException
- if argument isnull
BuildException
- if argument does not conform to above requirements
-
-
Method Details
-
getName
Returns this element's name attribute, typically used as the basis of an executable file name.- Returns:
- this element's name
- See Also:
-
setName
Sets this element's name attribute, which is typically used by the linker to create an executable file with a similar name. Thus, the name should contain only characters safe for file names.- Parameters:
name
- name of launcher
-
getModule
Returns the attribute of this element which contains the name of the Java module to execute.- Returns:
- this element's module name
-
setModule
Sets the attribute of this element which contains the name of a Java module to execute.- Parameters:
module
- name of module to execute
-
getMainClass
-
setMainClass
-
validate
public void validate()Verifies this element's state.- Throws:
BuildException
- if name or module is not set
-
toString
-