APIdia Launch Partner
Top Description Inners Constructors Methods
jdk.jpackage.internal.cli

public final Class Main

extends Object
Class Inheritance
Static Imports
jdk.jpackage.internal.cli.StandardOption.HELP, .StandardOption.VERBOSE, .StandardOption.VERSION, jdk.jpackage.internal.log.StandardLogger.ERROR_LOGGER

Main jpackage entry point.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
public static record
public static record
pack-priv static record

Constructor Summary

AccessConstructor and Description
private
Main()

Method Summary

Modifier and TypeMethod and Description
private static String
public static void
main(String... args)

pack-priv static int
run(OperatingSystem os, Supplier<CliBundlingEnvironment> bundlingEnvSupplier, PrintWriter out, PrintWriter err, String... args)

private static int
private static PrintWriter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Mainback to summary
private Main()

Method Detail

getVersionback to summary
private static String getVersion()
mainback to summary
public static void main(String... args)
runback to summary
pack-priv static int run(OperatingSystem os, Supplier<CliBundlingEnvironment> bundlingEnvSupplier, PrintWriter out, PrintWriter err, String... args)
runWithGlobalsback to summary
private static int runWithGlobals(OperatingSystem os, Supplier<CliBundlingEnvironment> bundlingEnvSupplier, PrintWriter out, PrintWriter err, String... args)
toPrintWriterback to summary
private static PrintWriter toPrintWriter(PrintStream ps)
jdk.jpackage.internal.cli back to summary

private final Enum Main.DefaultBundlingEnvironmentLoader

extends Enum<Main.DefaultBundlingEnvironmentLoader>
implements Supplier<CliBundlingEnvironment>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier

Field Summary

Modifier and TypeField and Description
public static final Main.DefaultBundlingEnvironmentLoader

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public CliBundlingEnvironment
get()

Implements java.util.function.Supplier.get.

Gets a result.

public static Main.DefaultBundlingEnvironmentLoader
public static Main.DefaultBundlingEnvironmentLoader[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final Main.DefaultBundlingEnvironmentLoader INSTANCE

Constructor Detail

DefaultBundlingEnvironmentLoaderback to summary
private DefaultBundlingEnvironmentLoader()

Method Detail

getback to summary
public CliBundlingEnvironment get()

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Annotations
@Override
valueOfback to summary
public static Main.DefaultBundlingEnvironmentLoader valueOf(String name)
valuesback to summary
public static Main.DefaultBundlingEnvironmentLoader[] values()
jdk.jpackage.internal.cli back to summary

public final Record Main.ErrorReporter

extends Record
implements ErrorLogger
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.log.ErrorLogger, jdk.jpackage.internal.log.Logger
Record Components
stackTracePrinter:Consumer<Throwable> 
messagePrinter:Consumer<String> 
alwaysPrintStackTrace:boolean 
printCommandOutput:boolean 

Field Summary

Modifier and TypeField and Description
private final boolean
alwaysPrintStackTrace

Record Component accessed by alwaysPrintStackTrace().

private final Consumer<String>
messagePrinter

Record Component accessed by messagePrinter().

private final boolean
printCommandOutput

Record Component accessed by printCommandOutput().

private final Consumer<Throwable>
stackTracePrinter

Record Component accessed by stackTracePrinter().

Constructor Summary

AccessConstructor and Description
public
ErrorReporter(Consumer<Throwable> stackTracePrinter, Consumer<String> messagePrinter, boolean alwaysPrintStackTrace, boolean printCommandOutput)

public
ErrorReporter(Consumer<Throwable> stackTracePrinter, Consumer<String> messagePrinter)

Method Summary

Modifier and TypeMethod and Description
public boolean
alwaysPrintStackTrace()

Record Component getter of alwaysPrintStackTrace.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

private static boolean
public Consumer<String>
messagePrinter()

Record Component getter of messagePrinter.

public boolean
printCommandOutput()

Record Component getter of printCommandOutput.

private void
private void
public void
public Consumer<Throwable>
stackTracePrinter()

Record Component getter of stackTracePrinter.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

alwaysPrintStackTraceback to summary
private final boolean alwaysPrintStackTrace

Record Component accessed by alwaysPrintStackTrace().

messagePrinterback to summary
private final Consumer<String> messagePrinter

Record Component accessed by messagePrinter().

printCommandOutputback to summary
private final boolean printCommandOutput

Record Component accessed by printCommandOutput().

stackTracePrinterback to summary
private final Consumer<Throwable> stackTracePrinter

Record Component accessed by stackTracePrinter().

Constructor Detail

ErrorReporterback to summary
public ErrorReporter(Consumer<Throwable> stackTracePrinter, Consumer<String> messagePrinter, boolean alwaysPrintStackTrace, boolean printCommandOutput)
ErrorReporterback to summary
public ErrorReporter(Consumer<Throwable> stackTracePrinter, Consumer<String> messagePrinter)

Method Detail

alwaysPrintStackTraceback to summary
public boolean alwaysPrintStackTrace()

Record Component getter of alwaysPrintStackTrace.

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).
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.

isSelfContainedback to summary
private static boolean isSelfContained(Throwable t)
messagePrinterback to summary
public Consumer<String> messagePrinter()

Record Component getter of messagePrinter.

printCommandOutputback to summary
public boolean printCommandOutput()

Record Component getter of printCommandOutput.

printErrorback to summary
private void printError(Throwable t, Optional<String> advice)
printExternalCommandErrorback to summary
private void printExternalCommandError(CommandOutputControl.UnexpectedResultException ex)
reportErrorback to summary
public void reportError(Throwable t)

Implements jdk.jpackage.internal.log.ErrorLogger.reportError.

stackTracePrinterback to summary
public Consumer<Throwable> stackTracePrinter()

Record Component getter of stackTracePrinter.

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.

jdk.jpackage.internal.cli back to summary

public final Record Main.Provider

extends Record
implements ToolProvider
Class Inheritance
All Implemented Interfaces
java.util.spi.ToolProvider
Record Components
bundlingEnvSupplier:Supplier<CliBundlingEnvironment> 
os:OperatingSystem 

Field Summary

Modifier and TypeField and Description
private final Supplier<CliBundlingEnvironment>
bundlingEnvSupplier

Record Component accessed by bundlingEnvSupplier().

private final OperatingSystem
os

Record Component accessed by os().

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Supplier<CliBundlingEnvironment>
bundlingEnvSupplier()

Record Component getter of bundlingEnvSupplier.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String
name()

Implements java.util.spi.ToolProvider.name.

Returns the name of this tool provider.

public OperatingSystem
os()

Record Component getter of os.

public int
run(PrintWriter out, PrintWriter err, String... args)

Implements java.util.spi.ToolProvider.run.

Runs an instance of the tool, returning zero for a successful run.

public int
run(PrintStream out, PrintStream err, String... args)

Overrides default java.util.spi.ToolProvider.run.

Runs an instance of the tool, returning zero for a successful run.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

bundlingEnvSupplierback to summary
private final Supplier<CliBundlingEnvironment> bundlingEnvSupplier

Record Component accessed by bundlingEnvSupplier().

osback to summary
private final OperatingSystem os

Record Component accessed by os().

Constructor Detail

Providerback to summary
public Provider(Supplier<CliBundlingEnvironment> bundlingEnvSupplier, OperatingSystem os)
Providerback to summary
public Provider()

Method Detail

bundlingEnvSupplierback to summary
public Supplier<CliBundlingEnvironment> bundlingEnvSupplier()

Record Component getter of bundlingEnvSupplier.

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).
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.

nameback to summary
public String name()

Implements java.util.spi.ToolProvider.name.

Doc from java.util.spi.ToolProvider.name.

Returns the name of this tool provider.

Annotations
@Override
osback to summary
public OperatingSystem os()

Record Component getter of os.

runback to summary
public int run(PrintWriter out, PrintWriter err, String... args)

Implements java.util.spi.ToolProvider.run.

Doc from java.util.spi.ToolProvider.run.

Runs an instance of the tool, returning zero for a successful run. Any non-zero return value indicates a tool-specific error during the execution. Two streams should be provided, for "expected" output, and for any error messages. If it is not necessary to distinguish the output, the same stream may be used for both.

Annotations
@Override
runback to summary
public int run(PrintStream out, PrintStream err, String... args)

Overrides default java.util.spi.ToolProvider.run.

Doc from java.util.spi.ToolProvider.run.

Runs an instance of the tool, returning zero for a successful run. Any non-zero return value indicates a tool-specific error during the execution. Two streams should be provided, for "expected" output, and for any error messages. If it is not necessary to distinguish the output, the same stream may be used for both.

Annotations
@Override
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.

jdk.jpackage.internal.cli back to summary

pack-priv final Record Main.Runner

extends Record
Class Inheritance
Record Components
errorReporter:Consumer<Throwable> 

Field Summary

Modifier and TypeField and Description
private final Consumer<Throwable>
errorReporter

Record Component accessed by errorReporter().

Constructor Summary

AccessConstructor and Description
pack-priv
Runner(Consumer<Throwable> errorReporter)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public Consumer<Throwable>
errorReporter()

Record Component getter of errorReporter.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

pack-priv int
run(Supplier<? extends Collection<? extends Exception>> r)

private static Collection<? extends Exception>
runIt(Supplier<? extends Collection<? extends Exception>> r)

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

errorReporterback to summary
private final Consumer<Throwable> errorReporter

Record Component accessed by errorReporter().

Constructor Detail

Runnerback to summary
pack-priv Runner(Consumer<Throwable> errorReporter)

Method Detail

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).
errorReporterback to summary
public Consumer<Throwable> errorReporter()

Record Component getter of errorReporter.

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.

runback to summary
pack-priv int run(Supplier<? extends Collection<? extends Exception>> r)
runItback to summary
private static Collection<? extends Exception> runIt(Supplier<? extends Collection<? extends Exception>> r)
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.