public class Link.Launcher
extends java.lang.Object
Constructor and Description |
---|
Launcher()
Creates a new, unconfigured element.
|
Launcher(java.lang.String textSpec)
Creates a new element from a
jlink -compatible string
specifier, which must take the form
name= module or
name= module/ mainclass. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMainClass()
Returns 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.
|
java.lang.String |
getModule()
Returns the attribute of this element which contains the
name of the Java module to execute.
|
java.lang.String |
getName()
Returns this element's name attribute, typically used as the basis
of an executable file name.
|
void |
setMainClass(java.lang.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 |
setModule(java.lang.String module)
Sets the attribute of this element which contains the name of
a Java module to execute.
|
void |
setName(java.lang.String name)
Sets this element's name attribute, which is typically used by the
linker to create an executable file with a similar name.
|
java.lang.String |
toString()
Returns this element's information in jlink launcher format:
name
= module or
name= module/ mainclass. |
void |
validate()
Verifies this element's state.
|
public Launcher()
public Launcher(java.lang.String textSpec)
jlink
-compatible string
specifier, which must take the form
name=
module or
name=
module/
mainclass.textSpec
- name, module, and optional main class, as described
abovejava.lang.NullPointerException
- if argument is null
BuildException
- if argument does not conform to above
requirementspublic java.lang.String getName()
setName(String)
public void setName(java.lang.String name)
name
- name of launcherpublic java.lang.String getModule()
public void setModule(java.lang.String module)
module
- name of module to executepublic java.lang.String getMainClass()
public void setMainClass(java.lang.String className)
className
- name of class to executepublic void validate()
BuildException
- if name or module is not setpublic java.lang.String toString()
=
module or
name=
module/
mainclass.toString
in class java.lang.Object