Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs.modules

public Class Jmod

extends Task
Class Inheritance
Imports
java.io.File, .ByteArrayOutputStream, .PrintStream, .IOException, java.nio.file.Files, java.util.Collection, .List, .ArrayList, .Map, .LinkedHashMap, .Collections, java.util.spi.ToolProvider, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.util.MergingMapper, .FileUtils, .ResourceUtils, org.apache.tools.ant.types.EnumeratedAttribute, .FileSet, .ModuleVersion, .Path, .Reference, .Resource, .ResourceCollection, org.apache.tools.ant.types.resources.FileResource, .Union

Creates a linkable .jmod file from a modular jar file, and optionally from other resource files such as native libraries and documents. Equivalent to the JDK's jmod tool.

Supported attributes:

destFile
Required, jmod file to create.
classpath
classpathref
Where to locate files to be placed in the jmod file.
modulepath
modulepathref
Where to locate dependencies.
commandpath
commandpathref
Directories containing native commands to include in jmod.
headerpath
headerpathref
Directories containing header files to include in jmod.
configpath
configpathref
Directories containing user-editable configuration files to include in jmod.
legalpath
legalpathref
Directories containing legal licenses and notices to include in jmod.
nativelibpath
nativelibpathref
Directories containing native libraries to include in jmod.
manpath
manpathref
Directories containing man pages to include in jmod.
version
Module version.
mainclass
Main class of module.
platform
The target platform for the jmod. A particular JDK's platform can be seen by running jmod describe $JDK_HOME/jmods/java.base.jmod | grep -i platform.
hashModulesPattern
Regular expression for names of modules in the module path which depend on the jmod being created, and which should have hashes generated for them and included in the new jmod.
resolveByDefault
Boolean indicating whether the jmod should be one of the default resolved modules in an application. Default is true.
moduleWarnings
Whether to emit warnings when resolving modules which are not recommended for use. Comma-separated list of one of more of the following:
deprecated
Warn if module is deprecated
leaving
Warn if module is deprecated for removal
incubating
Warn if module is an incubating (not yet official) module

Supported nested elements:

<classpath>
Path indicating where to locate files to be placed in the jmod file.
<modulepath>
Path indicating where to locate dependencies.
<commandpath>
Path of directories containing native commands to include in jmod.
<headerpath>
Path of directories containing header files to include in jmod.
<configpath>
Path of directories containing user-editable configuration files to include in jmod.
<legalpath>
Path of directories containing legal notices to include in jmod.
<nativelibpath>
Path of directories containing native libraries to include in jmod.
<manpath>
Path of directories containing man pages to include in jmod.
<version>
Module version of jmod. Must have a required number attribute. May also have optional preRelease and build attributes.
<moduleWarning>
Has one required attribute, reason. See moduleWarnings attribute above. This element may be specified multiple times.

destFile and classpath are required data.

Since
1.10.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Jmod.ResolutionWarningReason

Permissible reasons for jmod creation to emit warnings.

public class
Jmod.ResolutionWarningSpec

Child element which enables jmod tool warnings.

Field Summary

Modifier and TypeField and Description
private Path
classpath

Path of files (usually jar files or directories containing compiled classes) from which to create jmod.

private Path
commandPath

Path of directories containing executable files to bundle in the created jmod.

private Path
configPath

Path of directories containing configuration files to bundle in the created jmod.

private String
hashModulesPattern

Regular expression matching names of modules which depend on the the created jmod's module, for which hashes should be added to the created jmod.

private Path
headerPath

Path of directories containing includable header files (such as for other languages) to bundle in the created jmod.

private File
jmodFile

Location of jmod file to be created.

private Path
legalPath

Path of directories containing legal license files to bundle in the created jmod.

private String
mainClass

Main class to execute, if Java attempts to execute jmod's module without specifying a main class explicitly.

private Path
manPath

Path of directories containing manual pages to bundle in the created jmod.

private Path
modulePath

Path of directories containing modules on which the modules in the classpath depend.

private ModuleVersion
moduleVersion

Module version of jmod.

private final List<Jmod.ResolutionWarningSpec>
moduleWarnings

Reasons why module resolution during jmod creation may emit warnings.

private Path
nativeLibPath

Path of directories containing native libraries needed by classes in the modules comprising the created jmod.

private String
platform

Target platform of created jmod.

private boolean
resolveByDefault

Whether the created jmod should be seen by Java when present in a module path, even if not explicitly named.

private String
version

Module version of jmod.

Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
Jmod()

Method Summary

Modifier and TypeMethod and Description
private Collection<String>

Returns:

new list of jmod arguments
buildJmodArgs
()

Creates list of arguments to jmod tool, based on this instance's current state.

private void
checkDirPaths()

Checks that all paths which are required to be directories only, refer only to directories.

public Path

Returns:

new, unconfigured child element
createClasspath
()

Adds an unconfigured <classpath> child element which can specify the files which will comprise the created jmod.

public Path

Returns:

new, unconfigured child element
createCommandPath
()

Creates a child element which can contain a list of directories containing native executable files to include in the created jmod.

public Path

Returns:

new, unconfigured child element
createConfigPath
()

Creates a child element which can contain a list of directories containing user configuration files to include in the created jmod.

public Path

Returns:

new, unconfigured child element
createHeaderPath
()

Creates a child element which can contain a list of directories containing compile-time header files for third party use, to include in the created jmod.

public Path

Returns:

new, unconfigured child element
createLegalPath
()

Creates a child element which can contain a list of directories containing license files to include in the created jmod.

public Path

Returns:

new, unconfigured child element
createManPath
()

Creates a child element which can contain a list of directories containing man pages (program manuals, typically in troff format) to include in the created jmod.

public Path

Returns:

new, unconfigured child element
createModulePath
()

Creates a child <modulePath> element which can contain a path of directories containing modules upon which modules in the classpath depend.

public Jmod.ResolutionWarningSpec

Returns:

new, unconfigured child element
createModuleWarning
()

Creates a child element which can specify the circumstances under which jmod creation emits warnings.

public Path

Returns:

new, unconfigured child element
createNativeLibPath
()

Creates a child element which can contain a list of directories containing native libraries to include in the created jmod.

public ModuleVersion

Returns:

new, unconfigured child element
createVersion
()

Creates an uninitialized child element representing the version of the module represented by the created jmod.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Creates a jmod file according to this task's properties and child elements.
public Path

Returns:

path of constituent files
getClasspath
()

Attribute which specifies the files (usually modular .jar files) which will comprise the created jmod file.

public Path

Returns:

list of directories containing native executables
getCommandPath
()

Attribute containing path of directories which contain native executable files to include in the created jmod.

public Path

Returns:

list of directories containing user configuration files
getConfigPath
()

Attribute containing list of directories which contain user configuration files.

public File

Returns:

location of jmod file
getDestFile
()

Attribute containing the location of the jmod file to create.

public String

Returns:

regex specifying which dependent modules should have their generated hashes included
getHashModulesPattern
()

Attribute containing a regular expression which specifies which of the modules that depend on the jmod being created should have hashes generated and added to the jmod.

public Path

Returns:

path of directories containing header files
getHeaderPath
()

Attribute containing a path of directories which hold compile-time header files for third party use, all of which will be included in the created jmod.

public Path

Returns:

path containing directories which hold license files
getLegalPath
()

Attribute containing list of directories which hold license files to include in the created jmod.

public String

Returns:

fully-qualified name of jmod's main class
getMainClass
()

Attribute containing the class that acts as the executable entry point of the created jmod.

public Path

Returns:

path containing directories which hold man pages to include in jmod
getManPath
()

Attribute containing list of directories containing man pages to include in created jmod.

public Path

Returns:

path of directories containing modules needed by classpath modules
getModulePath
()

Attribute containing path of directories which contain modules on which the created jmod's constituent modules depend.

public Path

Returns:

path of directories containing native libraries
getNativeLibPath
()

Attribute containing list of directories which hold native libraries to include in the created jmod.

public String

Returns:

OS and architecture for which jmod will be built, or null
getPlatform
()

Attribute containing the platform for which the jmod will be built.

public boolean

Returns:

whether jmod should be visible in module paths
getResolveByDefault
()

Attribute indicating whether the created jmod should be visible in a module path, even when not specified explicitly.

public String

Returns:

module version for created jmod
getVersion
()

Attribute which specifies a module version for created jmod.

private static boolean

Returns:

true if resource exists and is not a directory, false if it is a directory or does not exist
isRegularFile
(Resource
resource to check
resource
)

Checks whether a resource is a directory.

public void
setClasspath(final Path
path of files that will comprise jmod
path
)

Sets attribute specifying the files that will comprise the created jmod file.

public void
setClasspathRef(final Reference
reference to path which will act as classpath
ref
)

Sets classpath attribute from a path reference.

public void
setCommandPath(final Path
list of directories containing native executables
path
)

Sets attribute containing path of directories which contain native executable files to include in the created jmod.

public void
setCommandPathRef(final Reference
reference to path which will act as command path
ref
)

Sets command path from a path reference.

public void
setConfigPath(final Path
list of directories containing user configuration files
path
)

Sets attribute containing list of directories which contain user configuration files.

public void
setConfigPathRef(final Reference
reference to path which will act as configuration file path
ref
)

Sets configuration file path from a path reference.

public void
setDestFile(final File
location where jmod file will be created.
file
)

Sets attribute containing the location of the jmod file to create.

public void
setHashModulesPattern(final String
regex specifying which dependent modules should have their generated hashes included
pattern
)

Sets attribute containing a regular expression which specifies which of the modules that depend on the jmod being created should have hashes generated and added to the jmod.

public void
setHeaderPath(final Path
path of directories containing header files
path
)

Sets attribute containing a path of directories which hold compile-time header files for third party use, all of which will be included in the created jmod.

public void
setHeaderPathRef(final Reference
reference to path which will act as header path
ref
)

Sets header path from a path reference.

public void
setLegalPath(final Path
path containing directories which hold license files
path
)

Sets attribute containing list of directories which hold license files to include in the created jmod.

public void
setLegalPathRef(final Reference
reference to path which will act as legal path
ref
)

Sets legal licenses path from a path reference.

public void
setMainClass(final String
fully-qualified name of jmod's main class
className
)

Sets attribute containing the class that acts as the executable entry point of the created jmod.

public void
setManPath(final Path
path containing directories which hold man pages to include in jmod
path
)

Sets attribute containing list of directories containing man pages to include in created jmod.

public void
setManPathRef(final Reference
reference to path which will act as module path
ref
)

Sets man pages path from a path reference.

public void
setModulePath(final Path
path of directories containing modules needed by classpath modules
path
)

Sets attribute containing path of directories which contain modules on which the created jmod's constituent modules depend.

public void
setModulePathRef(final Reference
reference to path which will act as module path
ref
)

Sets module path from a path reference.

public void
setModuleWarnings(final String
list containing one or more of the above values, separated by commas
warningList
)

Sets attribute containing a comma-separated list of reasons for jmod creation to emit warnings.

public void
setNativeLibPath(final Path
path of directories containing native libraries
path
)

Sets attribute containing list of directories which hold native libraries to include in the created jmod.

public void
setNativeLibPathRef(final Reference
reference to path which will act as native library path
ref
)

Sets native library path from a path reference.

public void
setPlatform(final String
platform for which jmod will be created, or null
platform
)

Sets attribute containing the platform for which the jmod will be built.

public void
setResolveByDefault(final boolean
whether jmod should be visible in module paths
resolve
)

Sets attribute indicating whether the created jmod should be visible in a module path, even when not specified explicitly.

public void
setVersion(final String
module version of created jmod
version
)

Sets the module version for the created jmod.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

classpathback to summary
private Path classpath

Path of files (usually jar files or directories containing compiled classes) from which to create jmod.

commandPathback to summary
private Path commandPath

Path of directories containing executable files to bundle in the created jmod.

configPathback to summary
private Path configPath

Path of directories containing configuration files to bundle in the created jmod.

hashModulesPatternback to summary
private String hashModulesPattern

Regular expression matching names of modules which depend on the the created jmod's module, for which hashes should be added to the created jmod.

headerPathback to summary
private Path headerPath

Path of directories containing includable header files (such as for other languages) to bundle in the created jmod.

jmodFileback to summary
private File jmodFile

Location of jmod file to be created.

legalPathback to summary
private Path legalPath

Path of directories containing legal license files to bundle in the created jmod.

mainClassback to summary
private String mainClass

Main class to execute, if Java attempts to execute jmod's module without specifying a main class explicitly.

manPathback to summary
private Path manPath

Path of directories containing manual pages to bundle in the created jmod.

modulePathback to summary
private Path modulePath

Path of directories containing modules on which the modules in the classpath depend.

moduleVersionback to summary
private ModuleVersion moduleVersion

Module version of jmod. Either this or version may be set.

moduleWarningsback to summary
private final List<Jmod.ResolutionWarningSpec> moduleWarnings

Reasons why module resolution during jmod creation may emit warnings.

nativeLibPathback to summary
private Path nativeLibPath

Path of directories containing native libraries needed by classes in the modules comprising the created jmod.

platformback to summary
private String platform

Target platform of created jmod. Examples are windows-amd64 and linux-amd64. Target platform is an attribute of each JDK, which can be seen by executing jmod describe $JDK_HOME/jmods/java.base.jmod and searching the output for a line starting with platform.

resolveByDefaultback to summary
private boolean resolveByDefault

Whether the created jmod should be seen by Java when present in a module path, even if not explicitly named. Normally true.

versionback to summary
private String version

Module version of jmod. Either this or moduleVersion may be set.

Constructor Detail

Jmodback to summary
public Jmod()

Method Detail

buildJmodArgsback to summary
private Collection<String> buildJmodArgs()

Creates list of arguments to jmod tool, based on this instance's current state.

Returns:Collection<String>

new list of jmod arguments

checkDirPathsback to summary
private void checkDirPaths()

Checks that all paths which are required to be directories only, refer only to directories.

Exceptions
BuildException:
if any path has an existing file which is a non-directory
createClasspathback to summary
public Path createClasspath()

Adds an unconfigured <classpath> child element which can specify the files which will comprise the created jmod.

Returns:Path

new, unconfigured child element

See Also
setClasspath(Path)
createCommandPathback to summary
public Path createCommandPath()

Creates a child element which can contain a list of directories containing native executable files to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setCommandPath(Path)
createConfigPathback to summary
public Path createConfigPath()

Creates a child element which can contain a list of directories containing user configuration files to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setConfigPath(Path)
createHeaderPathback to summary
public Path createHeaderPath()

Creates a child element which can contain a list of directories containing compile-time header files for third party use, to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setHeaderPath(Path)
createLegalPathback to summary
public Path createLegalPath()

Creates a child element which can contain a list of directories containing license files to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setLegalPath(Path)
createManPathback to summary
public Path createManPath()

Creates a child element which can contain a list of directories containing man pages (program manuals, typically in troff format) to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setManPath(Path)
createModulePathback to summary
public Path createModulePath()

Creates a child <modulePath> element which can contain a path of directories containing modules upon which modules in the classpath depend.

Returns:Path

new, unconfigured child element

See Also
setModulePath(Path)
createModuleWarningback to summary
public Jmod.ResolutionWarningSpec createModuleWarning()

Creates a child element which can specify the circumstances under which jmod creation emits warnings.

Returns:Jmod.ResolutionWarningSpec

new, unconfigured child element

See Also
setModuleWarnings(String)
createNativeLibPathback to summary
public Path createNativeLibPath()

Creates a child element which can contain a list of directories containing native libraries to include in the created jmod.

Returns:Path

new, unconfigured child element

See Also
setNativeLibPath(Path)
createVersionback to summary
public ModuleVersion createVersion()

Creates an uninitialized child element representing the version of the module represented by the created jmod.

Returns:ModuleVersion

new, unconfigured child element

See Also
setVersion(String)
executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Creates a jmod file according to this task's properties and child elements.

Annotations
@Override
Exceptions
BuildException:
  • if destFile is not set
  • if classpath is not set or is empty
  • if any path other than classpath refers to an existing file which is not a directory
  • if both version attribute and <version> child element are present
  • if hashModulesPattern is set, but module path is not defined
getClasspathback to summary
public Path getClasspath()

Attribute which specifies the files (usually modular .jar files) which will comprise the created jmod file.

Returns:Path

path of constituent files

See Also
setClasspath(Path)
getCommandPathback to summary
public Path getCommandPath()

Attribute containing path of directories which contain native executable files to include in the created jmod.

Returns:Path

list of directories containing native executables

See Also
setCommandPath(Path)
getConfigPathback to summary
public Path getConfigPath()

Attribute containing list of directories which contain user configuration files.

Returns:Path

list of directories containing user configuration files

See Also
setConfigPath(Path)
getDestFileback to summary
public File getDestFile()

Attribute containing the location of the jmod file to create.

Returns:File

location of jmod file

See Also
setDestFile(File)
getHashModulesPatternback to summary
public String getHashModulesPattern()

Attribute containing a regular expression which specifies which of the modules that depend on the jmod being created should have hashes generated and added to the jmod.

Returns:String

regex specifying which dependent modules should have their generated hashes included

getHeaderPathback to summary
public Path getHeaderPath()

Attribute containing a path of directories which hold compile-time header files for third party use, all of which will be included in the created jmod.

Returns:Path

path of directories containing header files

getLegalPathback to summary
public Path getLegalPath()

Attribute containing list of directories which hold license files to include in the created jmod.

Returns:Path

path containing directories which hold license files

getMainClassback to summary
public String getMainClass()

Attribute containing the class that acts as the executable entry point of the created jmod.

Returns:String

fully-qualified name of jmod's main class

getManPathback to summary
public Path getManPath()

Attribute containing list of directories containing man pages to include in created jmod. Man pages are textual program manuals, typically in troff format.

Returns:Path

path containing directories which hold man pages to include in jmod

getModulePathback to summary
public Path getModulePath()

Attribute containing path of directories which contain modules on which the created jmod's constituent modules depend.

Returns:Path

path of directories containing modules needed by classpath modules

See Also
setModulePath(Path)
getNativeLibPathback to summary
public Path getNativeLibPath()

Attribute containing list of directories which hold native libraries to include in the created jmod.

Returns:Path

path of directories containing native libraries

getPlatformback to summary
public String getPlatform()

Attribute containing the platform for which the jmod will be built. Platform values are defined in the java.base.jmod of JDKs, and usually take the form OS-architecture. If unset, current platform is used.

Returns:String

OS and architecture for which jmod will be built, or null

getResolveByDefaultback to summary
public boolean getResolveByDefault()

Attribute indicating whether the created jmod should be visible in a module path, even when not specified explicitly. True by default.

Returns:boolean

whether jmod should be visible in module paths

getVersionback to summary
public String getVersion()

Attribute which specifies a module version for created jmod.

Returns:String

module version for created jmod

isRegularFileback to summary
private static boolean isRegularFile(Resource resource)

Checks whether a resource is a directory. Used for checking validity of jmod path arguments which have to be directories.

Parameters
resource:Resource

resource to check

Returns:boolean

true if resource exists and is not a directory, false if it is a directory or does not exist

setClasspathback to summary
public void setClasspath(final Path path)

Sets attribute specifying the files that will comprise the created jmod file. Usually this contains a single modular .jar file.

The classpath is required and must not be empty.

Parameters
path:Path

path of files that will comprise jmod

See Also
createClasspath()
setClasspathRefback to summary
public void setClasspathRef(final Reference ref)

Sets classpath attribute from a path reference.

Parameters
ref:Reference

reference to path which will act as classpath

setCommandPathback to summary
public void setCommandPath(final Path path)

Sets attribute containing path of directories which contain native executable files to include in the created jmod.

Parameters
path:Path

list of directories containing native executables

See Also
createCommandPath()
setCommandPathRefback to summary
public void setCommandPathRef(final Reference ref)

Sets command path from a path reference.

Parameters
ref:Reference

reference to path which will act as command path

setConfigPathback to summary
public void setConfigPath(final Path path)

Sets attribute containing list of directories which contain user configuration files.

Parameters
path:Path

list of directories containing user configuration files

See Also
createConfigPath()
setConfigPathRefback to summary
public void setConfigPathRef(final Reference ref)

Sets configuration file path from a path reference.

Parameters
ref:Reference

reference to path which will act as configuration file path

setDestFileback to summary
public void setDestFile(final File file)

Sets attribute containing the location of the jmod file to create. This value is required.

Parameters
file:File

location where jmod file will be created.

setHashModulesPatternback to summary
public void setHashModulesPattern(final String pattern)

Sets attribute containing a regular expression which specifies which of the modules that depend on the jmod being created should have hashes generated and added to the jmod.

Parameters
pattern:String

regex specifying which dependent modules should have their generated hashes included

setHeaderPathback to summary
public void setHeaderPath(final Path path)

Sets attribute containing a path of directories which hold compile-time header files for third party use, all of which will be included in the created jmod.

Parameters
path:Path

path of directories containing header files

See Also
createHeaderPath()
setHeaderPathRefback to summary
public void setHeaderPathRef(final Reference ref)

Sets header path from a path reference.

Parameters
ref:Reference

reference to path which will act as header path

setLegalPathback to summary
public void setLegalPath(final Path path)

Sets attribute containing list of directories which hold license files to include in the created jmod.

Parameters
path:Path

path containing directories which hold license files

See Also
createLegalPath()
setLegalPathRefback to summary
public void setLegalPathRef(final Reference ref)

Sets legal licenses path from a path reference.

Parameters
ref:Reference

reference to path which will act as legal path

setMainClassback to summary
public void setMainClass(final String className)

Sets attribute containing the class that acts as the executable entry point of the created jmod.

Parameters
className:String

fully-qualified name of jmod's main class

setManPathback to summary
public void setManPath(final Path path)

Sets attribute containing list of directories containing man pages to include in created jmod. Man pages are textual program manuals, typically in troff format.

Parameters
path:Path

path containing directories which hold man pages to include in jmod

See Also
createManPath()
setManPathRefback to summary
public void setManPathRef(final Reference ref)

Sets man pages path from a path reference.

Parameters
ref:Reference

reference to path which will act as module path

setModulePathback to summary
public void setModulePath(final Path path)

Sets attribute containing path of directories which contain modules on which the created jmod's constituent modules depend.

Parameters
path:Path

path of directories containing modules needed by classpath modules

See Also
createModulePath()
setModulePathRefback to summary
public void setModulePathRef(final Reference ref)

Sets module path from a path reference.

Parameters
ref:Reference

reference to path which will act as module path

setModuleWarningsback to summary
public void setModuleWarnings(final String warningList)

Sets attribute containing a comma-separated list of reasons for jmod creation to emit warnings. Valid values in list are: deprecated, leaving, incubating.

Parameters
warningList:String

list containing one or more of the above values, separated by commas

See Also
createModuleWarning(), Jmod.ResolutionWarningReason
setNativeLibPathback to summary
public void setNativeLibPath(final Path path)

Sets attribute containing list of directories which hold native libraries to include in the created jmod.

Parameters
path:Path

path of directories containing native libraries

See Also
createNativeLibPath()
setNativeLibPathRefback to summary
public void setNativeLibPathRef(final Reference ref)

Sets native library path from a path reference.

Parameters
ref:Reference

reference to path which will act as native library path

setPlatformback to summary
public void setPlatform(final String platform)

Sets attribute containing the platform for which the jmod will be built. Platform values are defined in the java.base.jmod of JDKs, and usually take the form OS-architecture. If unset, current platform is used.

A JDK's platform can be viewed with a command like: jmod describe $JDK_HOME/jmods/java.base.jmod | grep -i platform. o *

Parameters
platform:String

platform for which jmod will be created, or null

setResolveByDefaultback to summary
public void setResolveByDefault(final boolean resolve)

Sets attribute indicating whether the created jmod should be visible in a module path, even when not specified explicitly. True by default.

Parameters
resolve:boolean

whether jmod should be visible in module paths

setVersionback to summary
public void setVersion(final String version)

Sets the module version for the created jmod.

Parameters
version:String

module version of created jmod

See Also
createVersion()
org.apache.tools.ant.taskdefs.modules back to summary

public Class Jmod.ResolutionWarningReason

extends EnumeratedAttribute
Class Inheritance

Permissible reasons for jmod creation to emit warnings.

Field Summary

Modifier and TypeField and Description
public static final String
DEPRECATED

String value indicating warnings are emitted for modules marked as deprecated (but not deprecated for removal).

public static final String
INCUBATING

String value indicating warnings are emitted for modules designated as "incubating" in the JDK.

public static final String
LEAVING

String value indicating warnings are emitted for modules marked as deprecated for removal.

private static final Map<String, String>
VALUES_TO_OPTIONS

Maps Ant task values to jmod option values.

Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
value

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String[]
getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

This is the only method a subclass needs to implement.
pack-priv String

Returns:

jmod option value
toCommandLineOption
()

Converts this object's current value to a jmod tool option value.

public static Jmod.ResolutionWarningReason

Returns:

ResolutionWarningReason instance corresponding to string argument
valueOf
(String
string to convert
s
)

Converts a string to a ResolutionWarningReason instance.

Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
containsValuegetIndexgetInstancegetValueindexOfValuesetValuetoString

Field Detail

DEPRECATEDback to summary
public static final String DEPRECATED

String value indicating warnings are emitted for modules marked as deprecated (but not deprecated for removal).

INCUBATINGback to summary
public static final String INCUBATING

String value indicating warnings are emitted for modules designated as "incubating" in the JDK.

LEAVINGback to summary
public static final String LEAVING

String value indicating warnings are emitted for modules marked as deprecated for removal.

VALUES_TO_OPTIONSback to summary
private static final Map<String, String> VALUES_TO_OPTIONS

Maps Ant task values to jmod option values.

Constructor Detail

ResolutionWarningReasonback to summary
public ResolutionWarningReason()

Method Detail

getValuesback to summary
public String[] getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Doc from org.apache.tools.ant.types.EnumeratedAttribute.getValues.

This is the only method a subclass needs to implement.

Returns:String[]

an array holding all possible values of the enumeration. The order of elements must be fixed so that indexOfValue(String) always return the same index for the same value.

Annotations
@Override
toCommandLineOptionback to summary
pack-priv String toCommandLineOption()

Converts this object's current value to a jmod tool option value.

Returns:String

jmod option value

valueOfback to summary
public static Jmod.ResolutionWarningReason valueOf(String s)

Converts a string to a ResolutionWarningReason instance.

Parameters
s:String

string to convert

Returns:Jmod.ResolutionWarningReason

ResolutionWarningReason instance corresponding to string argument

Exceptions
BuildException:
if argument is not a valid ResolutionWarningReason value
org.apache.tools.ant.taskdefs.modules back to summary

public Class Jmod.ResolutionWarningSpec

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.tools.ant.taskdefs.modules.Jmod.ResolutionWarningSpec

Child element which enables jmod tool warnings. 'reason' attribute is required.

Field Summary

Modifier and TypeField and Description
private Jmod.ResolutionWarningReason
reason

Condition which should trigger jmod warning output.

Constructor Summary

AccessConstructor and Description
public
ResolutionWarningSpec()

Creates an uninitialized element.

public
ResolutionWarningSpec(String reason)

Creates an element with the given reason attribute.

Method Summary

Modifier and TypeMethod and Description
public Jmod.ResolutionWarningReason

Returns:

condition which triggers jmod warnings
getReason
()

Required attribute containing reason for emitting jmod warnings.

public void
setReason(Jmod.ResolutionWarningReason
condition which triggers jmod warnings
reason
)

Sets attribute containing reason for emitting jmod warnings.

public void
validate()

Verifies this object's state.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

reasonback to summary
private Jmod.ResolutionWarningReason reason

Condition which should trigger jmod warning output.

Constructor Detail

ResolutionWarningSpecback to summary
public ResolutionWarningSpec()

Creates an uninitialized element.

ResolutionWarningSpecback to summary
public ResolutionWarningSpec(String reason)

Creates an element with the given reason attribute.

Parameters
reason:String

nonnull Jmod.ResolutionWarningReason value

Exceptions
BuildException:
if argument is not a valid ResolutionWarningReason

Method Detail

getReasonback to summary
public Jmod.ResolutionWarningReason getReason()

Required attribute containing reason for emitting jmod warnings.

Returns:Jmod.ResolutionWarningReason

condition which triggers jmod warnings

setReasonback to summary
public void setReason(Jmod.ResolutionWarningReason reason)

Sets attribute containing reason for emitting jmod warnings.

Parameters
reason:Jmod.ResolutionWarningReason

condition which triggers jmod warnings

validateback to summary
public void validate()

Verifies this object's state.

Exceptions
BuildException:
if this object's reason is null