APIdia Launch Partner
Top Description Inners Methods
jdk.jpackage.internal.model

public non-sealed Interface Application

extends BundleSpec
Known Direct Subinterfaces
jdk.jpackage.internal.model.LinuxApplication
Known Direct Implementers
jdk.jpackage.internal.model.Application.Stub
Imports
java.nio.file.Path, java.util.Collection, .Collections, .List, .Map, .Optional, java.util.stream.Stream, jdk.jpackage.internal.util.RootedPath

A generic application for packaging.

API Note

All paths of startup configurations of application launchers returned by launchers() call must be relative to the path returned by srcDir() call.

See Also
Package

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
Application.Stub

Default implementation of Application interface.

Method Summary

Modifier and TypeMethod and Description
public default List<Launcher>

Returns:

the additional application launchers of this application
additionalLaunchers
()

Gets the additional application launchers of this application.

public Collection<RootedPath>

Returns:

the source paths
appDirSources
()

Gets the source paths that should be copied into ApplicationLayout#appDirectory() directory of the image of this application.

public default Path

Returns:

the name of the root app image directory of this application
appImageDirName
()

Gets the name of the root app image directory of this application.

public default Optional<ApplicationLayout>

Returns:

the unresolved app image layout of this application as ApplicationLayout
asApplicationLayout
()

Gets the unresolved app image layout of this application as ApplicationLayout type or an empty Optional instance if the return value of imageLayout() call is not an instance of ApplicationLayout type.

public Collection<RootedPath>

Returns:

the source paths
contentDirSources
()

Gets the source paths that should be copied into ApplicationLayout#contentDirectory() directory of the image of this application.

public String

Returns:

the description of this application
description
()

Gets the description of this application.

public Map<String, String>

Returns:

the additional properties of this application for the application entry in ".jpackage.xml" file
extraAppImageFileData
()

Gets the additional properties of this application for the application entry in the app image (".jpackage.xml") file.

public default Stream<FileAssociation>

Returns:

the file associations of all application launchers of this application
fileAssociations
()

Gets the file associations of all application launchers of this application.

public AppImageLayout

Returns:

the unresolved app image layout of this application
imageLayout
()

Gets the unresolved app image layout of this application.

public default boolean

Returns:

true if this application is Java runtime
isRuntime
()

Returns true if this application is Java runtime.

public default boolean

Returns:

true if any of application launchers of this application are configured as services
isService
()

Returns true if any of application launchers of this application are configured as services.

public List<Launcher>

Returns:

the application launchers of this application
launchers
()

Gets the application launchers of this application.

public default Optional<Launcher>

Returns:

the main application launcher of this application
mainLauncher
()

Returns the main application launcher of this application or an empty Optional instance if the application doesn't have launchers.

public String

Returns:

the name of this application
name
()

Gets the name of this application.

public Optional<RuntimeBuilder>

Returns:

the runtime builder of this application
runtimeBuilder
()

Gets the runtime builder of this application if available or an empty Optional instance.

public String

Returns:

the vendor of this application
vendor
()

Gets the vendor of this application.

public String

Returns:

the version of this application
version
()

Gets the version of this application.

Method Detail

additionalLaunchersback to summary
public default List<Launcher> additionalLaunchers()

Gets the additional application launchers of this application.

Returns an empty list if this application doesn't have additional launchers.

Returns an empty list if isRuntime() returns true.

Returns:List<Launcher>

the additional application launchers of this application

See Also
launchers(), mainLauncher(), isRuntime()
appDirSourcesback to summary
public Collection<RootedPath> appDirSources()

Gets the source paths that should be copied into ApplicationLayout#appDirectory() directory of the image of this application.

Source paths are supposed to contain the applications's classes and other resources.

Returns:Collection<RootedPath>

the source paths

appImageDirNameback to summary
public default Path appImageDirName()

Gets the name of the root app image directory of this application.

Returns:Path

the name of the root app image directory of this application

asApplicationLayoutback to summary
public default Optional<ApplicationLayout> asApplicationLayout()

Gets the unresolved app image layout of this application as ApplicationLayout type or an empty Optional instance if the return value of imageLayout() call is not an instance of ApplicationLayout type.

Returns an empty Optional instance if isRuntime() returns true.

Returns:Optional<ApplicationLayout>

the unresolved app image layout of this application as ApplicationLayout

See Also
isRuntime
contentDirSourcesback to summary
public Collection<RootedPath> contentDirSources()

Gets the source paths that should be copied into ApplicationLayout#contentDirectory() directory of the image of this application.

Returns:Collection<RootedPath>

the source paths

descriptionback to summary
public String description()

Gets the description of this application.

Returns:String

the description of this application

extraAppImageFileDataback to summary
public Map<String, String> extraAppImageFileData()

Gets the additional properties of this application for the application entry in the app image (".jpackage.xml") file.

Returns:Map<String, String>

the additional properties of this application for the application entry in ".jpackage.xml" file

fileAssociationsback to summary
public default Stream<FileAssociation> fileAssociations()

Gets the file associations of all application launchers of this application.

Returns:Stream<FileAssociation>

the file associations of all application launchers of this application

See Also
Launcher#fileAssociations
imageLayoutback to summary
public AppImageLayout imageLayout()

Gets the unresolved app image layout of this application.

Returns:AppImageLayout

the unresolved app image layout of this application

isRuntimeback to summary
public default boolean isRuntime()

Returns true if this application is Java runtime.

Returns:boolean

true if this application is Java runtime

isServiceback to summary
public default boolean isService()

Returns true if any of application launchers of this application are configured as services.

Returns:boolean

true if any of application launchers of this application are configured as services

See Also
Launcher#isService
launchersback to summary
public List<Launcher> launchers()

Gets the application launchers of this application.

If the returned list is not empty, the first element in the list is the main launcher.

Returns an empty list if isRuntime() returns true.

Returns:List<Launcher>

the application launchers of this application

See Also
mainLauncher(), additionalLaunchers(), isRuntime()
mainLauncherback to summary
public default Optional<Launcher> mainLauncher()

Returns the main application launcher of this application or an empty Optional instance if the application doesn't have launchers.

Returns an empty Optional instance if isRuntime() returns true.

Returns:Optional<Launcher>

the main application launcher of this application

See Also
launchers(), additionalLaunchers(), isRuntime()
nameback to summary
public String name()

Gets the name of this application.

Returns:String

the name of this application

runtimeBuilderback to summary
public Optional<RuntimeBuilder> runtimeBuilder()

Gets the runtime builder of this application if available or an empty Optional instance.

Returns:Optional<RuntimeBuilder>

the runtime builder of this application

vendorback to summary
public String vendor()

Gets the vendor of this application.

Returns:String

the vendor of this application

versionback to summary
public String version()

Gets the version of this application.

Returns:String

the version of this application

jdk.jpackage.internal.model back to summary

public final Record Application.Stub

extends Record
implements Application
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.model.Application, jdk.jpackage.internal.model.BundleSpec
Record Components
name:String 
description:String 
version:String 
vendor:String 
copyright:String 
appDirSources:Collection<RootedPath> 
contentDirSources:Collection<RootedPath> 
imageLayout:AppImageLayout 
runtimeBuilder:Optional<RuntimeBuilder> 
launchers:List<Launcher> 
extraAppImageFileData:Map<String, String> 

Default implementation of Application interface.

Field Summary

Modifier and TypeField and Description
private final Collection<RootedPath>
appDirSources

Record Component accessed by appDirSources().

private final Collection<RootedPath>
contentDirSources

Record Component accessed by contentDirSources().

private final String
copyright

Record Component accessed by copyright().

private final String
description

Record Component accessed by description().

private final Map<String, String>
extraAppImageFileData

Record Component accessed by extraAppImageFileData().

private final AppImageLayout
imageLayout

Record Component accessed by imageLayout().

private final List<Launcher>
launchers

Record Component accessed by launchers().

private final String
name

Record Component accessed by name().

private final Optional<RuntimeBuilder>
runtimeBuilder

Record Component accessed by runtimeBuilder().

private final String
vendor

Record Component accessed by vendor().

private final String
version

Record Component accessed by version().

Constructor Summary

AccessConstructor and Description
public
Stub(String name, String description, String version, String vendor, String copyright, Collection<RootedPath> appDirSources, Collection<RootedPath> contentDirSources, AppImageLayout imageLayout, Optional<RuntimeBuilder> runtimeBuilder, List<Launcher> launchers, Map<String, String> extraAppImageFileData)

Method Summary

Modifier and TypeMethod and Description
public Collection<RootedPath>
appDirSources()

Record Component getter of appDirSources.

Implements jdk.jpackage.internal.model.Application.appDirSources.

Gets the source paths that should be copied into ApplicationLayout#appDirectory() directory of the image of this application.

public Collection<RootedPath>
contentDirSources()

Record Component getter of contentDirSources.

Implements jdk.jpackage.internal.model.Application.contentDirSources.

Gets the source paths that should be copied into ApplicationLayout#contentDirectory() directory of the image of this application.

public String
copyright()

Record Component getter of copyright.

Implements jdk.jpackage.internal.model.Application.copyright.

Gets the copyright of this application.

public String
description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Application.description.

Gets the description of this application.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Map<String, String>
extraAppImageFileData()

Record Component getter of extraAppImageFileData.

Implements jdk.jpackage.internal.model.Application.extraAppImageFileData.

Gets the additional properties of this application for the application entry in the app image (".jpackage.xml") file.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public AppImageLayout
imageLayout()

Record Component getter of imageLayout.

Implements jdk.jpackage.internal.model.Application.imageLayout.

Gets the unresolved app image layout of this application.

public List<Launcher>
launchers()

Record Component getter of launchers.

Implements jdk.jpackage.internal.model.Application.launchers.

Gets the application launchers of this application.

public String
name()

Record Component getter of name.

Implements jdk.jpackage.internal.model.Application.name.

Gets the name of this application.

public Optional<RuntimeBuilder>
runtimeBuilder()

Record Component getter of runtimeBuilder.

Implements jdk.jpackage.internal.model.Application.runtimeBuilder.

Gets the runtime builder of this application if available or an empty Optional instance.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public String
vendor()

Record Component getter of vendor.

Implements jdk.jpackage.internal.model.Application.vendor.

Gets the vendor of this application.

public String
version()

Record Component getter of version.

Implements jdk.jpackage.internal.model.Application.version.

Gets the version of this application.

Field Detail

appDirSourcesback to summary
private final Collection<RootedPath> appDirSources

Record Component accessed by appDirSources().

contentDirSourcesback to summary
private final Collection<RootedPath> contentDirSources

Record Component accessed by contentDirSources().

copyrightback to summary
private final String copyright

Record Component accessed by copyright().

descriptionback to summary
private final String description

Record Component accessed by description().

extraAppImageFileDataback to summary
private final Map<String, String> extraAppImageFileData

Record Component accessed by extraAppImageFileData().

imageLayoutback to summary
private final AppImageLayout imageLayout

Record Component accessed by imageLayout().

launchersback to summary
private final List<Launcher> launchers

Record Component accessed by launchers().

nameback to summary
private final String name

Record Component accessed by name().

runtimeBuilderback to summary
private final Optional<RuntimeBuilder> runtimeBuilder

Record Component accessed by runtimeBuilder().

vendorback to summary
private final String vendor

Record Component accessed by vendor().

versionback to summary
private final String version

Record Component accessed by version().

Constructor Detail

Stubback to summary
public Stub(String name, String description, String version, String vendor, String copyright, Collection<RootedPath> appDirSources, Collection<RootedPath> contentDirSources, AppImageLayout imageLayout, Optional<RuntimeBuilder> runtimeBuilder, List<Launcher> launchers, Map<String, String> extraAppImageFileData)

Method Detail

appDirSourcesback to summary
public Collection<RootedPath> appDirSources()

Record Component getter of appDirSources.

Implements jdk.jpackage.internal.model.Application.appDirSources.

Doc from jdk.jpackage.internal.model.Application.appDirSources.

Gets the source paths that should be copied into ApplicationLayout#appDirectory() directory of the image of this application.

Source paths are supposed to contain the applications's classes and other resources.

contentDirSourcesback to summary
public Collection<RootedPath> contentDirSources()

Record Component getter of contentDirSources.

Implements jdk.jpackage.internal.model.Application.contentDirSources.

Doc from jdk.jpackage.internal.model.Application.contentDirSources.

Gets the source paths that should be copied into ApplicationLayout#contentDirectory() directory of the image of this application.

copyrightback to summary
public String copyright()

Record Component getter of copyright.

Implements jdk.jpackage.internal.model.Application.copyright.

Doc from jdk.jpackage.internal.model.Application.copyright.

Gets the copyright of this application.

descriptionback to summary
public String description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Application.description.

Doc from jdk.jpackage.internal.model.Application.description.

Gets the description of this application.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
extraAppImageFileDataback to summary
public Map<String, String> extraAppImageFileData()

Record Component getter of extraAppImageFileData.

Implements jdk.jpackage.internal.model.Application.extraAppImageFileData.

Doc from jdk.jpackage.internal.model.Application.extraAppImageFileData.

Gets the additional properties of this application for the application entry in the app image (".jpackage.xml") file.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

imageLayoutback to summary
public AppImageLayout imageLayout()

Record Component getter of imageLayout.

Implements jdk.jpackage.internal.model.Application.imageLayout.

Doc from jdk.jpackage.internal.model.Application.imageLayout.

Gets the unresolved app image layout of this application.

launchersback to summary
public List<Launcher> launchers()

Record Component getter of launchers.

Implements jdk.jpackage.internal.model.Application.launchers.

Doc from jdk.jpackage.internal.model.Application.launchers.

Gets the application launchers of this application.

If the returned list is not empty, the first element in the list is the main launcher.

Returns an empty list if isRuntime() returns true.

nameback to summary
public String name()

Record Component getter of name.

Implements jdk.jpackage.internal.model.Application.name.

Doc from jdk.jpackage.internal.model.Application.name.

Gets the name of this application.

runtimeBuilderback to summary
public Optional<RuntimeBuilder> runtimeBuilder()

Record Component getter of runtimeBuilder.

Implements jdk.jpackage.internal.model.Application.runtimeBuilder.

Doc from jdk.jpackage.internal.model.Application.runtimeBuilder.

Gets the runtime builder of this application if available or an empty Optional instance.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

vendorback to summary
public String vendor()

Record Component getter of vendor.

Implements jdk.jpackage.internal.model.Application.vendor.

Doc from jdk.jpackage.internal.model.Application.vendor.

Gets the vendor of this application.

versionback to summary
public String version()

Record Component getter of version.

Implements jdk.jpackage.internal.model.Application.version.

Doc from jdk.jpackage.internal.model.Application.version.

Gets the version of this application.