Top Description Fields Constructors Methods
jdk.tools.jlink.internal.plugins

pack-priv abstract Class VersionPropsPlugin

extends AbstractPlugin
Class Inheritance
Known Direct Subclasses
jdk.tools.jlink.internal.plugins.VendorBugURLPlugin, jdk.tools.jlink.internal.plugins.VendorVersionPlugin, jdk.tools.jlink.internal.plugins.VendorVMBugURLPlugin
Imports
java.util.Locale, .Map, java.lang.classfile.ClassFile, .ClassTransform, .CodeBuilder, .CodeElement, .Instruction, .CodeTransform, java.lang.classfile.instruction.FieldInstruction, jdk.tools.jlink.plugin.ResourcePool, .ResourcePoolBuilder, .ResourcePoolEntry

Base plugin to update a static field in java.lang.VersionProps Fields to be updated must not be final such that values are not constant replaced at compile time and initialization code is generated. We assume that the initialization code only has ldcs, method calls and field instructions.

Field Summary

Modifier and TypeField and Description
private final String
private boolean
private String
private static final String
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
DESCRIPTIONUSAGE

Constructor Summary

AccessConstructor and Description
protected
VersionPropsPlugin(String
The name of the java.lang.VersionProps field to be redefined
field
,
String
The option name
option
)

protected
VersionPropsPlugin(String
The name of the java.lang.VersionProps field to be redefined
field
)

Shorthand constructor for when the option name can be derived from the name of the field.

Method Summary

Modifier and TypeMethod and Description
public void
configure(Map<String, String>
The plugin configuration.
config
)

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

Configure the plugin based on the passed configuration.

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?

public boolean
private byte[]
redefine(String path, byte[] classFile)

public ResourcePool
transform(ResourcePool
Read only content.
in
,
ResourcePoolBuilder
The pool to fill with content. This pool must contain the result of the visit.
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

fieldback to summary
private final String field
redefinedback to summary
private boolean redefined
valueback to summary
private String value
VERSION_PROPS_CLASSback to summary
private static final String VERSION_PROPS_CLASS

Constructor Detail

VersionPropsPluginback to summary
protected VersionPropsPlugin(String field, String option)
Parameters
field:String

The name of the java.lang.VersionProps field to be redefined

option:String

The option name

VersionPropsPluginback to summary
protected VersionPropsPlugin(String field)

Shorthand constructor for when the option name can be derived from the name of the field.

Parameters
field:String

The name of the java.lang.VersionProps field to be redefined

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.

Parameters
config:Map<String, String>

The plugin configuration.

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

Returns:Plugin.Category

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...
Returns:boolean

true if arguments are needed.

Annotations
@Override
hasRawArgumentback to summary
public boolean hasRawArgument()

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

Annotations
@Override
redefineback to summary
private byte[] redefine(String path, byte[] classFile)
Annotations
@SuppressWarnings:deprecation
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.

Parameters
in:ResourcePool

Read only content.

out:ResourcePoolBuilder

The pool to fill with content. This pool must contain the result of the visit.

Annotations
@Override