Class Link.Launcher
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.modules.Link.Launcher
 
- 
- Enclosing class:
- Link
 
 public class Link.Launcher extends java.lang.ObjectChild 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.
- 
- 
Method SummaryModifier and Type Method Description java.lang.StringgetMainClass()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.StringgetModule()Returns the attribute of this element which contains the name of the Java module to execute.java.lang.StringgetName()Returns this element's name attribute, typically used as the basis of an executable file name.voidsetMainClass(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.voidsetModule(java.lang.String module)Sets the attribute of this element which contains the name of a Java module to execute.voidsetName(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.StringtoString()Returns this element's information in jlink launcher format: name=module or name=module/mainclass.voidvalidate()Verifies this element's state.
 
- 
- 
- 
Constructor Detail- 
Launcherpublic Launcher() Creates a new, unconfigured element.
 - 
Launcherpublic Launcher(java.lang.String textSpec) 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:
- java.lang.NullPointerException- if argument is- null
- BuildException- if argument does not conform to above requirements
 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String 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(String)
 
 - 
setNamepublic 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. Thus, the name should contain only characters safe for file names.- Parameters:
- name- name of launcher
 
 - 
getModulepublic java.lang.String getModule() Returns the attribute of this element which contains the name of the Java module to execute.- Returns:
- this element's module name
 
 - 
setModulepublic void setModule(java.lang.String module) Sets the attribute of this element which contains the name of a Java module to execute.- Parameters:
- module- name of module to execute
 
 - 
getMainClasspublic 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.- Returns:
- name of main class to execute
 
 - 
setMainClasspublic 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.- Parameters:
- className- name of class to execute
 
 - 
validatepublic void validate() Verifies this element's state.- Throws:
- BuildException- if name or module is not set
 
 - 
toStringpublic java.lang.String toString() Returns this element's information in jlink launcher format: name=module or name=module/mainclass.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- name, module and optional main class in jlink format
 
 
- 
 
-