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

pack-priv final Class OptionsProcessor

extends Object
Class Inheritance
Static Imports
java.util.stream.Collectors.counting, .Collectors.groupingBy, .Collectors.toMap, jdk.jpackage.internal.cli.Option.fromOptionSpecPredicate, .OptionValueConverter.convertString, .StandardOption.ADDITIONAL_LAUNCHERS, .StandardOption.platformOption

Processes jpackage command line.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static record

Field Summary

Modifier and TypeField and Description
private static final OptionValue<List<Options>>
private final CliBundlingEnvironment
private static final OptionValue<List<Options>>
private final JOptSimpleOptionsBuilder.OptionsBuilder
private final OperatingSystem

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Collection<Option>
pack-priv static UnaryOperator<OptionSpec<?>>
pack-priv static Result<Options>

Returns:

Options instance containing validated property values or the list of errors occured during option values processing
processPropertyFile
(Path
the source property file
file
,
Collection<Option>
the recognized options
options
,
Optional<UnaryOperator<OptionSpec<?>>>
optional option spec mapper
optionSpecMapper
)

Loads property file and processes properties as a command line.

pack-priv Collection<? extends Exception>
pack-priv Result<OptionsProcessor.ValidatedOptions>
private Result<List<Options>>
private Result<BundlingOperationDescriptor>
private static Optional<? extends Exception>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADD_LAUNCHER_INTERNALback to summary
private static final OptionValue<List<Options>> ADD_LAUNCHER_INTERNAL
bundlingEnvback to summary
private final CliBundlingEnvironment bundlingEnv
FILE_ASSOCIATIONS_INTERNALback to summary
private static final OptionValue<List<Options>> FILE_ASSOCIATIONS_INTERNAL
optionsBuilderback to summary
private final JOptSimpleOptionsBuilder.OptionsBuilder optionsBuilder
osback to summary
private final OperatingSystem os

Constructor Detail

OptionsProcessorback to summary
pack-priv OptionsProcessor(JOptSimpleOptionsBuilder.OptionsBuilder optionsBuilder, OperatingSystem os, CliBundlingEnvironment bundlingEnv)

Method Detail

filterForPlatformback to summary
private static Collection<Option> filterForPlatform(OperatingSystem os, Collection<Option> options)
optionSpecMapperback to summary
pack-priv static UnaryOperator<OptionSpec<?>> optionSpecMapper(OperatingSystem os, BundlingEnvironment bundlingEnv)
processPropertyFileback to summary
pack-priv static Result<Options> processPropertyFile(Path file, Collection<Option> options, Optional<UnaryOperator<OptionSpec<?>>> optionSpecMapper)

Loads property file and processes properties as a command line.

Unrecognized options will be silently ignored.

Parameters
file:Path

the source property file

options:Collection<Option>

the recognized options

optionSpecMapper:Optional<UnaryOperator<OptionSpec<?>>>

optional option spec mapper

Returns:Result<Options>

Options instance containing validated property values or the list of errors occured during option values processing

Exceptions
UncheckedIOException:
if an I/O error occurs
runBundlingback to summary
pack-priv Collection<? extends Exception> runBundling(OptionsProcessor.ValidatedOptions validatedOptions)
validateback to summary
pack-priv Result<OptionsProcessor.ValidatedOptions> validate()
validateAdditionalLaunchersback to summary
private Result<List<Options>> validateAdditionalLaunchers(Options cmdline)
validateBundlingOperationback to summary
private Result<BundlingOperationDescriptor> validateBundlingOperation(BundlingOperationDescriptor bundlingOperation)
validateNonOptionArgumentsback to summary
private static Optional<? extends Exception> validateNonOptionArguments(JOptSimpleOptionsBuilder.OptionsBuilder optionsBuilder)
jdk.jpackage.internal.cli back to summary

private final Class OptionsProcessor.OptionsConverter<T>

extends Object
implements OptionArrayValueConverter<Options>
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.cli.OptionArrayValueConverter, jdk.jpackage.internal.cli.OptionValueConverter

Field Summary

Modifier and TypeField and Description
private final OptionArrayValueConverter<T>
private final Function<T, Result<Options>>

Constructor Summary

AccessConstructor and Description
pack-priv
OptionsConverter(Function<T, Result<Options>> mapper, OptionSpec<T[]> optionSpec)

pack-priv

Method Summary

Modifier and TypeMethod and Description
public Result<Options[]>
convert(OptionName optionName, StringToken optionValue, String value)

Implements jdk.jpackage.internal.cli.OptionValueConverter.convert.

Converts the given value of type T corresponding to the given option name and option string value to an object of type U.

pack-priv static <T> OptionValue<List<Options>>
public String[]
tokenize(String str)

Implements jdk.jpackage.internal.cli.OptionArrayValueConverter.tokenize.

Splits the given string into tokens and returns the result.

public Class<Options[]>
valueType()

Implements jdk.jpackage.internal.cli.OptionValueConverter.valueType.

Gives the class of the type of values this converter converts to.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

converterback to summary
private final OptionArrayValueConverter<T> converter
mapperback to summary
private final Function<T, Result<Options>> mapper

Constructor Detail

OptionsConverterback to summary
pack-priv OptionsConverter(Function<T, Result<Options>> mapper, OptionSpec<T[]> optionSpec)
OptionsConverterback to summary
pack-priv OptionsConverter(Function<T, Result<Options>> mapper, OptionArrayValueConverter<T> converter)

Method Detail

convertback to summary
public Result<Options[]> convert(OptionName optionName, StringToken optionValue, String value)

Implements jdk.jpackage.internal.cli.OptionValueConverter.convert.

Doc from jdk.jpackage.internal.cli.OptionValueConverter.convert.

Converts the given value of type T corresponding to the given option name and option string value to an object of type U.

Annotations
@Override
optionValueback to summary
pack-priv static <T> OptionValue<List<Options>> optionValue(OptionIdentifier id)
tokenizeback to summary
public String[] tokenize(String str)

Implements jdk.jpackage.internal.cli.OptionArrayValueConverter.tokenize.

Doc from jdk.jpackage.internal.cli.OptionArrayValueConverter.tokenize.

Splits the given string into tokens and returns the result.

Annotations
@Override
valueTypeback to summary
public Class<Options[]> valueType()

Implements jdk.jpackage.internal.cli.OptionValueConverter.valueType.

Doc from jdk.jpackage.internal.cli.OptionValueConverter.valueType.

Gives the class of the type of values this converter converts to.

Annotations
@Override
jdk.jpackage.internal.cli back to summary

pack-priv final Record OptionsProcessor.ValidatedOptions

extends Record
Class Inheritance
Record Components
options:Options 
bundlingOperation:BundlingOperationDescriptor 

Field Summary

Modifier and TypeField and Description
private final BundlingOperationDescriptor
bundlingOperation

Record Component accessed by bundlingOperation().

private final Options
options

Record Component accessed by options().

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv String
public BundlingOperationDescriptor
bundlingOperation()

Record Component getter of bundlingOperation.

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 Options
options()

Record Component getter of options.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

bundlingOperationback to summary
private final BundlingOperationDescriptor bundlingOperation

Record Component accessed by bundlingOperation().

optionsback to summary
private final Options options

Record Component accessed by options().

Constructor Detail

ValidatedOptionsback to summary
pack-priv ValidatedOptions(Options options, BundlingOperationDescriptor bundlingOperation)

Method Detail

bundleTypeNameback to summary
pack-priv String bundleTypeName()
bundlingOperationback to summary
public BundlingOperationDescriptor bundlingOperation()

Record Component getter of bundlingOperation.

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.

optionsback to summary
public Options options()

Record Component getter of options.

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.