APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.tools.jlink.internal.plugins

public final Class IncludeLocalesPlugin

extends AbstractPlugin
implements ResourcePrevisitor
Class Inheritance
All Implemented Interfaces
jdk.tools.jlink.internal.ResourcePrevisitor
Imports
java.util.AbstractMap, .ArrayList, .Arrays, .IllformedLocaleException, .Locale, .List, .Map, .Objects, .Optional, .Set, java.util.function.IntUnaryOperator, .Predicate, java.util.regex.Matcher, .Pattern, java.util.stream.Collectors, .Stream, jdk.tools.jlink.internal.ResourcePrevisitor, .StringTable, jdk.tools.jlink.plugin.ResourcePoolModule, .PluginException, .ResourcePool, .ResourcePoolBuilder, .ResourcePoolEntry, sun.util.cldr.CLDRBaseLocaleDataMetaInfo, sun.util.locale.provider.LocaleProviderAdapter, .LocaleProviderAdapter.Type, .ResourceBundleBasedAdapter

Plugin to explicitly specify the locale data included in jdk.localedata module. This plugin provides a jlink command line option "--include-locales" with an argument. The argument is a list of BCP 47 language tags separated by a comma. E.g., "jlink --include-locales en,ja,*-IN" This option will include locale data for all available English and Japanese languages, and ones for the country of India. All other locale data are filtered out on the image creation. Here are a few assumptions: 0. All locale data in java.base are unconditionally included. 1. All the selective locale data are in jdk.localedata module 2. Their package names are constructed by appending ".ext" to the corresponding ones in java.base module. 3. Available locales string in LocaleDataMetaInfo class should start with at least one white space character, e.g., " ar ar-EG ..." ^

Field Summary

Modifier and TypeField and Description
private static final ResourceBundleBasedAdapter
private static final Map<Locale, String[]>
private static final Map<String, List<String>>
private static final List<String>
private static final Locale
private static final String
private static final Locale.Builder
private static final Set<String>
private static final List<String>
private static final String
private static final String
private static final Locale
private static final String
private Predicate<String>
private List<Locale.LanguageRange>
private static final Locale
private static final String
private String
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
DESCRIPTIONUSAGE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Map<String, String> config)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration.

private List<String>
private boolean
public Plugin.Category
getType()

Overrides default jdk.tools.jlink.plugin.Plugin.getType.

The type of this plugin.

public boolean
hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments?

private List<String>
private List<String>
private static Stream<String>
public void
previsit(ResourcePool resources, StringTable strings)

Implements jdk.tools.jlink.internal.ResourcePrevisitor.previsit.

Previsit the collection of resources.

private boolean
private static Locale
public ResourcePool
transform(ResourcePool in, ResourcePoolBuilder out)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.

Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
getArgumentsDescriptiongetDescriptiongetMessagegetNamegetUsagenewClassReadernewClassReader

Field Detail

CLDR_ADAPTERback to summary
private static final ResourceBundleBasedAdapter CLDR_ADAPTER
CLDR_PARENT_LOCALESback to summary
private static final Map<Locale, String[]> CLDR_PARENT_LOCALES
EQUIV_MAPback to summary
private static final Map<String, List<String>> EQUIV_MAP
INCLUDE_LOCALE_FILESback to summary
private static final List<String> INCLUDE_LOCALE_FILES
jaJPJPback to summary
private static final Locale jaJPJP
jaJPJPTagback to summary
private static final String jaJPJPTag
LOCALE_BUILDERback to summary
private static final Locale.Builder LOCALE_BUILDER
LOCALEDATA_PACKAGESback to summary
private static final Set<String> LOCALEDATA_PACKAGES
META_FILESback to summary
private static final List<String> META_FILES
METAINFONAMEback to summary
private static final String METAINFONAME
MODULENAMEback to summary
private static final String MODULENAME
noNONYback to summary
private static final Locale noNONY
noNONYTagback to summary
private static final String noNONYTag
predicateback to summary
private Predicate<String> predicate
priorityListback to summary
private List<Locale.LanguageRange> priorityList
thTHTHback to summary
private static final Locale thTHTH
thTHTHTagback to summary
private static final String thTHTHTag
userParamback to summary
private String userParam

Constructor Detail

IncludeLocalesPluginback to summary
public IncludeLocalesPlugin()

Method Detail

configureback to summary
public void configure(Map<String, String> config)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Doc from jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration. This method is called prior to invoke the plugin.

Annotations
@Override
filterLocalesback to summary
private List<String> filterLocales(List<Locale> locales)
filterOutUnsupportedTagsback to summary
private boolean filterOutUnsupportedTags(byte[] b)
getTypeback to summary
public Plugin.Category getType()

Overrides default jdk.tools.jlink.plugin.Plugin.getType.

Doc from jdk.tools.jlink.plugin.Plugin.getType.

The type of this plugin.

Annotations
@Override
hasArgumentsback to summary
public boolean hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Doc from jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments? A plugin can have one or more optional arguments.
A plugin option with a single argument is specified as follows:

     --plugin-option=arg_value
 
If there are more than arguments, command line option looks like:
     --plugin-option=arg_value:arg2=value2:arg3=value3...
Annotations
@Override
includeLocaleFilePatternsback to summary
private List<String> includeLocaleFilePatterns(String tag)
includeLocaleFilesback to summary
private List<String> includeLocaleFiles(String localeStr)
localeToTagsback to summary
private static Stream<String> localeToTags(Locale loc)
previsitback to summary
public void previsit(ResourcePool resources, StringTable strings)

Implements jdk.tools.jlink.internal.ResourcePrevisitor.previsit.

Doc from jdk.tools.jlink.internal.ResourcePrevisitor.previsit.

Previsit the collection of resources.

Annotations
@Override
stripUnsupportedLocalesback to summary
private boolean stripUnsupportedLocales(byte[] bytes)
tagToLocaleback to summary
private static Locale tagToLocale(String tag)
transformback to summary
public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Doc from jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.

Annotations
@Override