From ac1aca77f0870e78cc13035b7f0e815315aa0c3b Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 17 Nov 2024 07:01:26 +0100 Subject: [PATCH] javadoc fixes for gestalt-module Co-authored-by: BenjaminAmos <24301287+BenjaminAmos@users.noreply.github.com> --- .../org/terasology/gestalt/i18n/I18nMap.java | 6 ++ .../org/terasology/gestalt/module/Module.java | 20 +++++- .../gestalt/module/ModuleEnvironment.java | 65 ++++++++++++++++--- .../gestalt/module/ModuleFactory.java | 23 ++++++- .../gestalt/module/ModuleMetadata.java | 42 +++++++++++- .../module/ModuleMetadataJsonAdapter.java | 5 ++ .../gestalt/module/ModuleMetadataLoader.java | 2 + .../gestalt/module/ModulePathScanner.java | 8 +++ .../gestalt/module/ModuleRegistry.java | 9 ++- .../gestalt/module/ModuleServiceRegistry.java | 7 ++ .../gestalt/module/TableModuleRegistry.java | 3 + .../OptionalResolutionStrategy.java | 6 +- .../ResolutionResult.java | 11 +++- .../InvalidModulePathException.java | 25 +++++++ .../MissingModuleMetadataException.java | 13 ++++ .../module/exceptions/ModuleException.java | 25 +++++++ .../UnresolvedDependencyException.java | 23 +++++++ .../gestalt/module/predicates/FromModule.java | 6 ++ .../module/sandbox/JavaModuleClassLoader.java | 22 +++++++ .../module/sandbox/ModuleClassLoader.java | 8 ++- .../module/sandbox/ModuleSecurityManager.java | 9 +++ .../sandbox/ModuleSecurityPermission.java | 9 +++ .../module/sandbox/ObtainClassloader.java | 1 + .../module/sandbox/PermissionProvider.java | 6 +- .../sandbox/PermissionProviderFactory.java | 2 + .../sandbox/PredicatePermissionProvider.java | 4 ++ .../sandbox/SetUnionPermissionProvider.java | 12 ++++ .../StandardPermissionProviderFactory.java | 9 +++ .../sandbox/WarnOnlyProviderFactory.java | 1 + .../org/terasology/gestalt/naming/Name.java | 7 +- .../gestalt/naming/NameVersion.java | 13 ++++ .../terasology/gestalt/naming/Version.java | 33 +++++++++- .../gestalt/naming/VersionRange.java | 11 +++- .../exception/VersionParseException.java | 24 +++++++ 34 files changed, 443 insertions(+), 27 deletions(-) diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/i18n/I18nMap.java b/gestalt-module/src/main/java/org/terasology/gestalt/i18n/I18nMap.java index 3c7028ab..0dedc40a 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/i18n/I18nMap.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/i18n/I18nMap.java @@ -67,6 +67,8 @@ public I18nMap(String value) { } /** + * The most appropriate value to use based on the system default locale. + * * @return The most appropriate string value to use based on the system default Locale */ public String value() { @@ -84,6 +86,8 @@ public String value() { } /** + * Get the string value for the locale passed. + * * @param locale The locale to get the string value for * @return The most appropriate string value for the given locale. */ @@ -104,6 +108,8 @@ public String valueFor(Locale locale) { } /** + * Convert to string. + * * @return The most appropriate string value based on the system default locale. */ @Override diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/Module.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/Module.java index ff179672..d3f825c8 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/Module.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/Module.java @@ -71,6 +71,8 @@ public Module(ModuleMetadata metadata, ModuleFileSource fileSources, Collection< } /** + * Get resources for module. + * * @return A ModuleFileSource providing this module's resources */ public ModuleFileSource getResources() { @@ -78,6 +80,8 @@ public ModuleFileSource getResources() { } /** + * Get additional classpaths. + * * @return A list of additional classpaths to load */ public List getClasspaths() { @@ -85,6 +89,8 @@ public List getClasspaths() { } /** + * Get the identifier for the module. + * * @return The identifier for the module */ public Name getId() { @@ -92,6 +98,8 @@ public Name getId() { } /** + * Get the version of the module. + * * @return The version of the module */ public Version getVersion() { @@ -99,6 +107,8 @@ public Version getVersion() { } /** + * Get the permissions required by the module. + * * @return The list of permission sets required by this module */ public ImmutableSet getRequiredPermissions() { @@ -106,6 +116,8 @@ public ImmutableSet getRequiredPermissions() { } /** + * Get the metadata of the module. + * * @return Metadata describing the module */ public ModuleMetadata getMetadata() { @@ -113,6 +125,8 @@ public ModuleMetadata getMetadata() { } /** + * Get information on the contents on this module. + * * @return Information on the contents on this module */ public ClassIndex getClassIndex() { @@ -120,8 +134,10 @@ public ClassIndex getClassIndex() { } /** - * @return A predicate that specifies whether a given class from the main classloader is a - * member of this module + * Gets a predicate which that specifies whether a given class from the main classloader is a + * member of this module. + * + * @return A predicate */ public Predicate> getClassPredicate() { return classPredicate; diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleEnvironment.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleEnvironment.java index f9da48fa..b0d0bc26 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleEnvironment.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleEnvironment.java @@ -84,6 +84,9 @@ public class ModuleEnvironment implements AutoCloseable, Iterable { private final ModuleFileSource resources; /** + * Creates a ModuleEnvironment with give bean context, modules and permissionProviderFactory. + * + * @param beanContext The bean context. * @param modules The modules this environment should encompass. * @param permissionProviderFactory A factory for producing a PermissionProvider for each loaded module * @throws java.lang.IllegalArgumentException if the Iterable contains multiple modules with the same id. @@ -93,6 +96,9 @@ public ModuleEnvironment(BeanContext beanContext, Iterable modules, Perm } /** + * Creates a ModuleEnvironment with give bean context, modules, permissionProviderFactory, and classLoaderSupplier. + * + * @param beanContext The bean context. * @param modules The modules this environment should encompass. * @param permissionProviderFactory A factory for producing a PermissionProvider for each loaded module * @param classLoaderSupplier A supplier for producing a ModuleClassLoader for a module @@ -103,14 +109,19 @@ public ModuleEnvironment(BeanContext beanContext, Iterable modules, Perm } /** + * Creates a ModuleEnvironment with give bean context, modules, permissionProviderFactory, + * classLoaderSupplier, and apiClassLoader. + * + * @param beanContext The bean context. * @param modules The modules this environment should encompass. - * @param permissionProviderFactory A factory for producing a PermissionProvider for each loaded module - * @param classLoaderSupplier A supplier for producing a ModuleClassLoader for a module + * @param permissionProviderFactory A factory for producing a PermissionProvider for each loaded module. + * @param classLoaderSupplier A supplier for producing a ModuleClassLoader for a module. * @param apiClassLoader The base classloader the module environment should build upon. * @throws java.lang.IllegalArgumentException if the Iterable contains multiple modules with the same id. */ - public ModuleEnvironment(BeanContext beanContext, Iterable modules, final PermissionProviderFactory permissionProviderFactory, ClassLoaderSupplier classLoaderSupplier, ClassLoader apiClassLoader) { - + public ModuleEnvironment(BeanContext beanContext, Iterable modules, + final PermissionProviderFactory permissionProviderFactory, + ClassLoaderSupplier classLoaderSupplier, ClassLoader apiClassLoader) { this.modules = buildModuleMap(modules); this.apiClassLoader = apiClassLoader; this.modulesOrderByDependencies = calculateModulesOrderedByDependencies(); @@ -243,6 +254,8 @@ public void close() { } /** + * Gets the module with the specified id. + * * @param id The id of the module to return * @return The desired module, or null if it is not part of the environment */ @@ -261,6 +274,9 @@ public final List getModulesOrderedByDependencies() { } /** + * List of module ids sorted so that dependencies appear before modules that depend on them. Additionally, + * modules are alphabetically ordered where there are no dependencies. + * * @return A list of modules in the environment, sorted so any dependencies appear before a module */ public final List getModuleIdsOrderedByDependencies() { @@ -287,6 +303,8 @@ public Name getModuleProviding(Class type) { } /** + * Get the ids of the dependencies of the desired module. + * * @param moduleId The id of the module to get the dependencies * @return The ids of the dependencies of the desired module */ @@ -295,13 +313,17 @@ public Set getDependencyNamesOf(Name moduleId) { } /** - * @return The available resources across all modules + * Get available resources across all modules. + * + * @return The available resources */ public ModuleFileSource getResources() { return resources; } /** + * Get an iterable over all subtypes of the type that appears in the module environment. + * * @param type The type to find subtypes of * @param The type to find subtypes of * @return A Iterable over all subtypes of type that appear in the module environment @@ -316,10 +338,12 @@ public Iterable> getSubtypesOf(Class type) { } /** + * Get an iterable over all subtypes of the type that appears in the module environment, filtered. + * * @param type The type to find subtypes of * @param The type to find subtypes of * @param filter A filter to apply to the returned subtypes - * @return A Iterable over all subtypes of type that appear in the module environment + * @return A Iterable over all subtypes of type */ public Iterable> getSubtypesOf(Class type, Predicate> filter) { return classIndexByModule.entrySet().stream() @@ -332,9 +356,11 @@ public Iterable> getSubtypesOf(Class type, Predicate> getTypesAnnotatedWith(Class annotation) { return classIndexByModule.entrySet().stream() @@ -346,10 +372,12 @@ public Iterable> getTypesAnnotatedWith(Class anno } /** + * Get all types in the environment that are either marked by the given annotation, or are subtypes of a type marked + * with the annotation if the annotation is marked as @Inherited, filtered. + * * @param annotation The annotation of interest * @param filter Further filter on the returned types - * @return All types in the environment that are either marked by the given annotation, or are subtypes of a type marked with the annotation if the annotation is marked - * as @Inherited + * @return All types in the environment marked by the given annotation or are subtypes */ public Iterable> getTypesAnnotatedWith(Class annotation, Predicate> filter) { return classIndexByModule.entrySet().stream() @@ -367,6 +395,13 @@ public Iterator iterator() { return modules.values().iterator(); } + /** + * Get beans implementing this interface. + * + * @param the type to extend + * @param interfaceClass the interface class + * @return beans for this interface. + */ public List getBeans(Class interfaceClass) { return finalBeanContext.getBeans(interfaceClass); } @@ -384,8 +419,18 @@ private Class loadClass(ClassLoader classLoader, String clazzName) { } + /** + * Functional interface. + */ @FunctionalInterface public interface ClassLoaderSupplier { + /** + * Creates a module class loader + * @param module the module + * @param parent the parent classloader + * @param permissionProvider the permission provider + * @return the module classloader + */ ModuleClassLoader create(Module module, ClassLoader parent, PermissionProvider permissionProvider); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleFactory.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleFactory.java index 0947a086..b8eeb36c 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleFactory.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleFactory.java @@ -69,12 +69,17 @@ public class ModuleFactory { private String defaultLibsSubpath; private boolean scanningForClasses = true; + + /** + * Default constructor. + */ @Inject // TODO use another constructor. public ModuleFactory() { this(Thread.currentThread().getContextClassLoader()); } /** + * Creates a Module out of a file Module.json in standard library path. * @param classLoader The classloader to use for classpath and package modules */ public ModuleFactory(ClassLoader classLoader) { @@ -82,6 +87,8 @@ public ModuleFactory(ClassLoader classLoader) { } /** + * Constructor with code libs subpath. + * * @param defaultCodeSubpath The default subpath in a path module that contains code (compiled class files) * @param defaultLibsSubpath The default subpath in a path module that contains libraries (jars) */ @@ -90,6 +97,7 @@ public ModuleFactory(String defaultCodeSubpath, String defaultLibsSubpath) { } /** + * Constructor with classLoader, code, moodule subpath, metadata loaders. * @param classLoader The classloader that modules should be loaded atop of * @param defaultCodeSubpath The default subpath in a path module that contains code (compiled class files) * @param defaultLibsSubpath The default subpath in a path module that contains libraries (jars) @@ -103,6 +111,8 @@ public ModuleFactory(ClassLoader classLoader, String defaultCodeSubpath, String } /** + * Get the modules code subpath. + * * @return The subpath of a path module that contains compiled code */ public String getDefaultCodeSubpath() { @@ -119,20 +129,26 @@ public void setDefaultCodeSubpath(String defaultCodeSubpath) { } /** - * @return Whether the module factory will scan modules for class files if a manifest isn't available + * Whether the module factory will scan modules for class files if a manifest isn't available. + * + * @return The module factory will scan modules for class files if true and a manifest isn't available */ public boolean isScanningForClasses() { return scanningForClasses; } /** - * @param scanForClasses Whether the module factory should scan modules for class files if a manifest isn't present + * Set if the module factory should scan modules for class files if a manifest isn't present. + * + * @param scanForClasses when true, the module factory scans modules for class files if a manifest isn't present */ public void setScanningForClasses(boolean scanForClasses) { this.scanningForClasses = scanForClasses; } /** + * Gets the modules subpath that contains libraries. + * * @return The subpath of a path module that contains libraries */ public String getDefaultLibsSubpath() { @@ -149,7 +165,8 @@ public void setDefaultLibsSubpath(String defaultLibsSubpath) { } /** - * @return The map of paths to module metadata loaders used for loading metadata describing modules + * Get a map of paths to module metadata loaders used for loading metadata describing modules. + * @return The map of paths to module metadata loaders used for loading metadata */ public Map getModuleMetadataLoaderMap() { return moduleMetadataLoaderMap; diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadata.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadata.java index 24b1d74c..55679017 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadata.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadata.java @@ -42,11 +42,29 @@ public class ModuleMetadata { /* * Constants for the names of each of the core metadata attributes. */ + /** + * The module's id key + */ public static final String ID = "id"; + /** + * The module's version key + */ public static final String VERSION = "version"; + /** + * The module's display name key + */ public static final String DISPLAY_NAME = "displayName"; + /** + * The module's description key + */ public static final String DESCRIPTION = "description"; + /** + * The module's dependencies key + */ public static final String DEPENDENCIES = "dependencies"; + /** + * The module's required permissions key + */ public static final String REQUIRED_PERMISSIONS = "requiredPermissions"; /** @@ -62,9 +80,17 @@ public class ModuleMetadata { private Set requiredPermissions = Sets.newLinkedHashSet(); private List dependencies = Lists.newArrayList(); + /** + * Constructs a new ModuleMetadata instance + */ public ModuleMetadata() { } + /** + * Constructs a new ModuleMetadata instance with a given id and version + * @param id module id + * @param version module version + */ public ModuleMetadata(Name id, Version version) { this.id = id; this.version = version; @@ -72,6 +98,7 @@ public ModuleMetadata(Name id, Version version) { /** + * Get the identifier of the module * @return The identifier of the module */ public Name getId() { @@ -88,6 +115,7 @@ public void setId(Name id) { } /** + * Get the version of the moodule * @return The version of the module */ public Version getVersion() { @@ -104,6 +132,7 @@ public void setVersion(Version version) { } /** + * Get the display name of the module * @return A displayable name of the module */ public I18nMap getDisplayName() { @@ -111,6 +140,7 @@ public I18nMap getDisplayName() { } /** + * Set the display name of the module * @param displayName The new human-readable name of the module */ public void setDisplayName(I18nMap displayName) { @@ -118,6 +148,7 @@ public void setDisplayName(I18nMap displayName) { } /** + * Get the description of the module * @return A human readable description of the module */ public I18nMap getDescription() { @@ -125,6 +156,7 @@ public I18nMap getDescription() { } /** + * Sets the description of the module * @param description The new human-readable description of the module */ public void setDescription(I18nMap description) { @@ -132,13 +164,17 @@ public void setDescription(I18nMap description) { } /** - * @return A list of the permissions required by this module, corresponding to permission sets installed in the security manager. + * Get the permissions required by this module. They correspond to permission sets installed in the security + * mananger. + * + * @return A list of the permissions required by this module, */ public Set getRequiredPermissions() { return requiredPermissions; } /** + * Get the dependencies of the module. * @return A list of dependencies of the module */ public List getDependencies() { @@ -149,6 +185,8 @@ public List getDependencies() { } /** + * Get the information on dependencies for a module + * * @param dependencyId The id of the module to get dependency information on * @return The depdendency information for a specific module, or null if no such dependency exists */ @@ -162,6 +200,8 @@ public DependencyInfo getDependencyInfo(Name dependencyId) { } /** + * Get the extension object by id, type. + * * @param extensionId The identifier of the extension * @param expectedType The expected type of the extension * @param The expected type of the extension diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapter.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapter.java index 80a5172c..88c29451 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapter.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapter.java @@ -81,6 +81,9 @@ public class ModuleMetadataJsonAdapter implements ModuleMetadataLoader { private final Map extensionMap = Maps.newHashMap(); private volatile Gson cachedGson; + /** + * Constructor. + */ @Inject public ModuleMetadataJsonAdapter() { this.builder = new GsonBuilder() @@ -145,6 +148,8 @@ public ModuleMetadata read(Reader reader) { } /** + * Write module metadata. + * * @param writer A writer that receives the json metadata * @param data the module metadata that should be written * @throws com.google.gson.JsonIOException if there was a problem writing to the Writer diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataLoader.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataLoader.java index cd6847ff..31c746a4 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataLoader.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataLoader.java @@ -25,6 +25,8 @@ public interface ModuleMetadataLoader { /** + * Read module metadata from file. + * * @param reader Metadata to load * @return The loaded module metadata. * @throws IOException If there was an error reading the ModuleMetadata diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModulePathScanner.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModulePathScanner.java index 172511b4..406b7064 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModulePathScanner.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModulePathScanner.java @@ -36,11 +36,19 @@ public class ModulePathScanner { private static final Logger logger = LoggerFactory.getLogger(ModulePathScanner.class); private final ModuleFactory moduleFactory; + /** + * Constructor. + * @param factory the module factory + */ @Inject public ModulePathScanner(ModuleFactory factory) { this.moduleFactory = factory; } + /** + * Gets the module factory. + * @return the module factory. + */ public ModuleFactory getModuleFactory() { return moduleFactory; } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleRegistry.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleRegistry.java index 47d6e78a..97f39dd7 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleRegistry.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleRegistry.java @@ -33,23 +33,30 @@ public interface ModuleRegistry extends Collection { /** + * A list of all versions of the module with the given id. + * * @param id The name of the modules to return * @return A list of all versions of the module with the given id */ Collection getModuleVersions(Name id); /** - * @return A complete collection of all available module names + * A complete collection of all available module names + * @return collection of all available module names */ Set getModuleIds(); /** + * The most recent version of the desired module. + * * @param id The name of the module to return * @return The most recent version of the desired module, or null if there is no matching module */ Module getLatestModuleVersion(Name id); /** + * Get the most recent version of desired module within the bounds. + * * @param id The name of the module to return * @param minVersion The lower bound (inclusive) on the version desired * @param maxVersion The upper bound (exclusive) on the version desired diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleServiceRegistry.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleServiceRegistry.java index 036941c7..ab249b95 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleServiceRegistry.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleServiceRegistry.java @@ -4,7 +4,14 @@ import org.terasology.gestalt.module.dependencyresolution.DependencyResolver; import org.terasology.gestalt.module.sandbox.PermissionProviderFactory; +/** + * A service registry for modules. + */ public class ModuleServiceRegistry extends ServiceRegistry { + /** + * Constructor + * @param permissionProviderFactory the permissionsproviderfactory + */ public ModuleServiceRegistry(PermissionProviderFactory permissionProviderFactory) { with(ModuleMetadataJsonAdapter.class); with(ModuleFactory.class); diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/TableModuleRegistry.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/TableModuleRegistry.java index 46311ad9..2802e14f 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/TableModuleRegistry.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/TableModuleRegistry.java @@ -45,6 +45,9 @@ public class TableModuleRegistry implements ModuleRegistry { private final Table modules = HashBasedTable.create(); private final Map latestModules = Maps.newHashMap(); + /** + * Constructs a new TableModuleRegistry instance. + */ @Inject public TableModuleRegistry() { diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/OptionalResolutionStrategy.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/OptionalResolutionStrategy.java index f63f576a..9020f9f3 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/OptionalResolutionStrategy.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/OptionalResolutionStrategy.java @@ -46,14 +46,16 @@ public enum OptionalResolutionStrategy { } /** - * @return Whether an optional dependency must be provided + * Whether an optional dependency must be provided + * @return true if dependency must be provided */ public boolean isRequired() { return required; } /** - * @return Whether an optional dependency will be included if available + * Whether an optional dependency will be included if available + * @return true if dependency will be included */ public boolean isDesired() { return desired; diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/ResolutionResult.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/ResolutionResult.java index 005365af..54020bbd 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/ResolutionResult.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/dependencyresolution/ResolutionResult.java @@ -31,20 +31,27 @@ public class ResolutionResult { private final boolean success; private final Set modules; + /** + * Constructs a new ResolutionResult instance with given success value and modules. + * @param success true if resolution succeeded. + * @param modules set of compatible modules. + */ public ResolutionResult(boolean success, Set modules) { this.success = success; this.modules = modules; } /** - * @return Whether resolution succeeded + * Whether resolution succeeded + * @return true if resolution succeeded */ public boolean isSuccess() { return success; } /** - * @return A set of compatible modules with all dependencies resolved + * Gets compatible modules with all dependencies resolved + * @return A set of compatible modules */ public Set getModules() { Preconditions.checkState(success, "Modules only available if resolution was successful"); diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/InvalidModulePathException.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/InvalidModulePathException.java index c57bf977..eb1ec82e 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/InvalidModulePathException.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/InvalidModulePathException.java @@ -23,21 +23,46 @@ */ public class InvalidModulePathException extends RuntimeException { + /** + * Default constructor. + */ public InvalidModulePathException() { } + /** + * Constructor with message. + * @param message the message + */ public InvalidModulePathException(String message) { super(message); } + /** + * Constructor with message and cause. + * + * @param message the message + * @param cause the cause + */ public InvalidModulePathException(String message, Throwable cause) { super(message, cause); } + /** + * Constructor with cause. + * + * @param cause the cause + */ public InvalidModulePathException(Throwable cause) { super(cause); } + /** + * Constructor. + * @param message the message + * @param cause the cause + * @param enableSuppression enable to suppress + * @param writableStackTrace enable if stactrace can be written + */ public InvalidModulePathException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/MissingModuleMetadataException.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/MissingModuleMetadataException.java index 100f8c14..cbc0ede1 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/MissingModuleMetadataException.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/MissingModuleMetadataException.java @@ -21,13 +21,26 @@ */ public class MissingModuleMetadataException extends RuntimeException { + /** + * Constructor. + */ public MissingModuleMetadataException() { } + /** + * Constructor with message. + * + * @param s the message. + */ public MissingModuleMetadataException(String s) { super(s); } + /** + * Constructor with message and throwable. + * @param s the message + * @param throwable the throwable + */ public MissingModuleMetadataException(String s, Throwable throwable) { super(s, throwable); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/ModuleException.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/ModuleException.java index 8213103e..410d0d7d 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/ModuleException.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/ModuleException.java @@ -23,21 +23,46 @@ */ public abstract class ModuleException extends Exception { + /** + * Creates a ModuleException. + */ public ModuleException() { } + /** + * Creates a ModuleException with message. + * @param message the message + */ public ModuleException(String message) { super(message); } + /** + * Creates a ModuleException with message and cause. + * + * @param message the message + * @param cause the cause + */ public ModuleException(String message, Throwable cause) { super(message, cause); } + /** + * Creates a ModuleException with cause. + * @param cause the cause + */ public ModuleException(Throwable cause) { super(cause); } + /** + * Creates a ModuleException message, cause, whether suppresssion is enabled, whether stacktrace can be written. + * + * @param message the message + * @param cause the cause + * @param enableSuppression if true, suppression is enabled + * @param writableStackTrace if true, stacktrace can be written + */ public ModuleException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/UnresolvedDependencyException.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/UnresolvedDependencyException.java index 46c4a930..9100e5bb 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/UnresolvedDependencyException.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/exceptions/UnresolvedDependencyException.java @@ -23,21 +23,44 @@ */ public class UnresolvedDependencyException extends ModuleException { + /** + * Default constructor. + */ public UnresolvedDependencyException() { } + /** + * Constructor with message. + * @param message the message + */ public UnresolvedDependencyException(String message) { super(message); } + /** + * Constructor with message and cause. + * @param message the msssage + * @param cause the cause + */ public UnresolvedDependencyException(String message, Throwable cause) { super(message, cause); } + /** + * Constructor with cause + * @param cause the cause + */ public UnresolvedDependencyException(Throwable cause) { super(cause); } + /** + * Constructor with message, cause, permits suppression of message, and a property if stacktrace can be written. + * @param message the mssage + * @param cause the cause + * @param enableSuppression true if suppression is enabled + * @param writableStackTrace true if stacktrace is writeable + */ public UnresolvedDependencyException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/predicates/FromModule.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/predicates/FromModule.java index 3e08f060..350310c5 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/predicates/FromModule.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/predicates/FromModule.java @@ -32,6 +32,12 @@ public class FromModule implements Predicate> { private final ModuleEnvironment environment; private final Name moduleId; + /** + * Constructor to create class to filter classes to those from a specific module. + * + * @param environment the environment + * @param moduleId the module id + */ public FromModule(ModuleEnvironment environment, Name moduleId) { this.environment = environment; this.moduleId = moduleId; diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/JavaModuleClassLoader.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/JavaModuleClassLoader.java index cef601b3..b50d4ae3 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/JavaModuleClassLoader.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/JavaModuleClassLoader.java @@ -61,6 +61,8 @@ public class JavaModuleClassLoader extends URLClassLoader implements ModuleClass private final List bytecodeInjectors; /** + * Constructor. + * * @param module The name of the module this classloader belongs to * @param urls The urls where the module classes can be found * @param parent The parent classloader, where the API classes can be found @@ -71,6 +73,8 @@ public JavaModuleClassLoader(Name module, URL[] urls, ClassLoader parent, Permis } /** + * Constructor. + * * @param module The name of the module this classloader belongs to * @param urls The urls where the module classes can be found * @param parent The parent classloader, where the API classes can be found @@ -97,6 +101,14 @@ public JavaModuleClassLoader(Name module, URL[] urls, ClassLoader parent, Permis } } + /** + * Creates a classloader for the module. + * + * @param module the module + * @param parent the parent classloader + * @param permissionProvider pmerission provider + * @return the moodule classloader + */ public static ModuleClassLoader create(Module module, ClassLoader parent, PermissionProvider permissionProvider) { URL[] urls = module.getClasspaths().stream().map(x -> { try { @@ -110,6 +122,8 @@ public static ModuleClassLoader create(Module module, ClassLoader parent, Permis } /** + * Get module id this classloarder belongs to. + * * @return The id of the module this ClassLoader belongs to */ @Override @@ -117,12 +131,18 @@ public Name getModuleId() { return moduleId; } + /** + * Get classloader + * @return the classloader. + */ @Override public ClassLoader getClassLoader() { return this; } /** + * Get the permission provider for this classloader. + * * @return The permission provider for this ModuleClassLoader */ @Override @@ -131,6 +151,8 @@ public PermissionProvider getPermissionProvider() { } /** + * Returns the base classloader of this modules classloader. + * * @return The non-ModuleClassLoader that the module classloader chain is based on */ private ClassLoader getBaseClassLoader() { diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleClassLoader.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleClassLoader.java index c5832574..9ef2bfe7 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleClassLoader.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleClassLoader.java @@ -27,11 +27,15 @@ public interface ModuleClassLoader { /** + * Get the id of the module producing this class loader + * * @return The id of the module producing this class loader */ Name getModuleId(); /** + * Get the classloader. + * * @return The class loader itself */ ClassLoader getClassLoader(); @@ -44,8 +48,10 @@ public interface ModuleClassLoader { void close() throws IOException; /** - * @return The PermissionProvider determining what classes from this module + * Get the permission provider determining what classes from this module * are allowed to do and access + * + * @return The PermissionProvider */ PermissionProvider getPermissionProvider(); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityManager.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityManager.java index 5bb21739..fb873b6e 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityManager.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityManager.java @@ -34,11 +34,20 @@ */ public class ModuleSecurityManager extends SecurityManager { + /** + * Allows permissions to be granted and revoked to the module sandbox + */ public static final Permission UPDATE_ALLOWED_PERMISSIONS = new ModuleSecurityPermission(ModuleSecurityPermission.UPDATE_ALLOWED_PERMISSIONS); + /** + * Allows for updating classes and packages available to the module sandbox. + */ public static final Permission UPDATE_API_CLASSES = new ModuleSecurityPermission(ModuleSecurityPermission.UPDATE_API_CLASSES); private ThreadLocal calculatingPermission = new ThreadLocal<>(); + /** + * Constructs a new ModuleSecurityManager instance. + */ public ModuleSecurityManager() { } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityPermission.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityPermission.java index 435ade9a..87c98d33 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityPermission.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ModuleSecurityPermission.java @@ -40,10 +40,19 @@ public class ModuleSecurityPermission extends BasicPermission { */ public static final String UPDATE_API_CLASSES = "updateAPIClasses"; + /** + * Constructor by name + * @param name the name + */ public ModuleSecurityPermission(String name) { super(name); } + /** + * Constructor by name and actions. + * @param name the name + * @param actions actions + */ public ModuleSecurityPermission(String name, String actions) { super(name, actions); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ObtainClassloader.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ObtainClassloader.java index aedb34de..67c55c8c 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ObtainClassloader.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/ObtainClassloader.java @@ -27,6 +27,7 @@ public class ObtainClassloader implements PrivilegedAction { private final Class type; /** + * Constructor * @param forType The type to obtain the ClassLoader of. */ public ObtainClassloader(Class forType) { diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProvider.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProvider.java index 4b5a097f..fdbc2130 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProvider.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProvider.java @@ -26,15 +26,17 @@ public interface PermissionProvider { /** + * Whether access to the given class is permitted * @param type The class to check - * @return Whether access to the given class is permitted + * @return true if access to the given class is permitted */ boolean isPermitted(Class type); /** + * Whether access to the given permission is permitted * @param permission The permission to check * @param context The type invoking the permission check - * @return Whether access to the given permission is permitted + * @return true if access to the given permission is permitted */ boolean isPermitted(Permission permission, Class context); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProviderFactory.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProviderFactory.java index 8459de33..86792881 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProviderFactory.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PermissionProviderFactory.java @@ -28,6 +28,8 @@ public interface PermissionProviderFactory { /** + * Creates a permissionprovider suitable for the given module. + * * @param module The module to create a permission provider for. * @param classpathModuleClasses A predicate that determines what classes on the classpath belong to the module * @return A permission provider suitable for the given module diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PredicatePermissionProvider.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PredicatePermissionProvider.java index 9c243caa..bf997c5b 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PredicatePermissionProvider.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/PredicatePermissionProvider.java @@ -26,6 +26,10 @@ public class PredicatePermissionProvider implements PermissionProvider { private final Predicate> predicate; + /** + * Creates a PredicatePermissionProvider + * @param predicate a predicate that determines permitted classes. + */ public PredicatePermissionProvider(Predicate> predicate) { this.predicate = predicate; } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/SetUnionPermissionProvider.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/SetUnionPermissionProvider.java index 5bb49cc5..370971a5 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/SetUnionPermissionProvider.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/SetUnionPermissionProvider.java @@ -30,12 +30,18 @@ public class SetUnionPermissionProvider implements PermissionProvider { private final ImmutableList permissionSets; /** + * Constructor. * @param permissionProviders A collection of PermissionProviders to use */ public SetUnionPermissionProvider(Iterable permissionProviders) { this.permissionSets = ImmutableList.copyOf(permissionProviders); } + /** + * Whether class is permitted. + * @param type The class to check + * @return true if one of the providers grants. + */ @Override public boolean isPermitted(Class type) { for (PermissionProvider set : permissionSets) { @@ -46,6 +52,12 @@ public boolean isPermitted(Class type) { return false; } + /** + * Whether permission is permitted in this context. + * @param permission The permission to check + * @param context The type invoking the permission check + * @return true if one of the providers grants. + */ @Override public boolean isPermitted(Permission permission, Class context) { for (PermissionProvider set : permissionSets) { diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/StandardPermissionProviderFactory.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/StandardPermissionProviderFactory.java index 0c797b0e..c748e2cd 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/StandardPermissionProviderFactory.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/StandardPermissionProviderFactory.java @@ -35,15 +35,22 @@ */ public class StandardPermissionProviderFactory implements PermissionProviderFactory { + /** + * The set of permissions which all modules are granted. + */ public static final String BASE_PERMISSION_SET = ""; private static final Logger logger = LoggerFactory.getLogger(StandardPermissionProviderFactory.class); private final Map permissionSets = Maps.newHashMap(); + /** + * Constructs a factory with empty base permisison set. + */ public StandardPermissionProviderFactory() { permissionSets.put(BASE_PERMISSION_SET, new PermissionSet()); } /** + * Gets the base permission set, which all modules are granted. * @return The base permission set, which all modules are granted */ public PermissionSet getBasePermissionSet() { @@ -51,6 +58,8 @@ public PermissionSet getBasePermissionSet() { } /** + * Gets the permission set with the given name + * * @param name The name of the permission set * @return The permission set with the given name, or null */ diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/WarnOnlyProviderFactory.java b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/WarnOnlyProviderFactory.java index fc8203d1..a5caa3de 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/WarnOnlyProviderFactory.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/module/sandbox/WarnOnlyProviderFactory.java @@ -35,6 +35,7 @@ public class WarnOnlyProviderFactory implements PermissionProviderFactory { private PermissionProviderFactory wrappedFactory; /** + * Constructor. * @param wrappedFactory Another permission factory to wrap. */ public WarnOnlyProviderFactory(PermissionProviderFactory wrappedFactory) { diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/naming/Name.java b/gestalt-module/src/main/java/org/terasology/gestalt/naming/Name.java index f74e7eab..06fb0977 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/naming/Name.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/naming/Name.java @@ -42,6 +42,10 @@ public final class Name implements Comparable { private final String originalName; private final String normalisedName; + /** + * Constructor by name. + * @param name the name + */ public Name(String name) { Preconditions.checkNotNull(name); this.originalName = name; @@ -49,7 +53,8 @@ public Name(String name) { } /** - * @return Whether this name is empty (equivalent to an empty string) + * Whether this name is empty (equivalent to an empty string) + * @return true if emppty */ public boolean isEmpty() { return normalisedName.isEmpty(); diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/naming/NameVersion.java b/gestalt-module/src/main/java/org/terasology/gestalt/naming/NameVersion.java index 133949d7..6a1a2988 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/naming/NameVersion.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/naming/NameVersion.java @@ -29,15 +29,28 @@ public class NameVersion { private final Name name; private final Version version; + /** + * Constructor + * @param name the name + * @param version the version + */ public NameVersion(Name name, Version version) { this.name = name; this.version = version; } + /** + * Get the namm + * @return the name + */ public Name getName() { return name; } + /** + * Get the version + * @return the version + */ public Version getVersion() { return version; } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/naming/Version.java b/gestalt-module/src/main/java/org/terasology/gestalt/naming/Version.java index ff9063ce..ef416c54 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/naming/Version.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/naming/Version.java @@ -66,6 +66,7 @@ public Version(int major, int minor, int patch, boolean snapshot) { } /** + * Constructor. * @param version The string of the version * @throws VersionParseException If the version string is not a valid version. */ @@ -86,37 +87,67 @@ private Version(com.github.zafarkhaja.semver.Version semver) { this.semver = semver; } + /** + * Returns the major version. + * @return i.e. 5 out of 5.1.3 + */ public int getMajor() { return (int) semver.majorVersion(); } + /** + * Returns the minor version. + * @return i.e. 1 out of 5.1.3 + */ public int getMinor() { return (int) semver.minorVersion(); } + /** + * Returns the patch version. + * @return i.e. 3 out of 5.1.3 + */ public int getPatch() { return (int) semver.patchVersion(); } /** - * @return Whether this version is a snapshot (work in progress) + * Whether this version is a snapshot (work in progress) + * @return true if this version is a snapshot */ public boolean isSnapshot() { return !semver.preReleaseVersion().isEmpty(); } + /** + * Gets current snapshot version. + * @return the snapshot version + */ public Version getSnapshot() { return new Version(semver.setPreReleaseVersion(SNAPSHOT)); } + /** + * Gets next major version. + * @return i.e. 6 if version is 5.1.3 + */ public Version getNextMajorVersion() { return new Version(semver.nextMajorVersion()); } + + /** + * Gets next minor version. + * @return i.e. 2 if version is 5.1.3 + */ public Version getNextMinorVersion() { return new Version(semver.nextMinorVersion()); } + /** + * Gets next patch version. + * @return i.e. 4 if version is 5.1.3 + */ public Version getNextPatchVersion() { return new Version(semver.nextPatchVersion()); } diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/naming/VersionRange.java b/gestalt-module/src/main/java/org/terasology/gestalt/naming/VersionRange.java index 8c8f04ce..0dffaf02 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/naming/VersionRange.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/naming/VersionRange.java @@ -43,17 +43,26 @@ public VersionRange(Version lowerBound, Version upperBound) { this.upperBound = upperBound; } + /** + * Get lower bound version of range. + * @return the lower bound + */ public Version getLowerBound() { return lowerBound; } + /** + * Get upper bound of range. + * @return the upper bound + */ public Version getUpperBound() { return upperBound; } /** + * Tests whether version falls within the range * @param version The version to check - * @return Whether version falls within the range + * @return true if version falls within the range */ public boolean contains(Version version) { return version.compareTo(lowerBound.getSnapshot()) >= 0 && version.compareTo(upperBound.getSnapshot()) < 0; diff --git a/gestalt-module/src/main/java/org/terasology/gestalt/naming/exception/VersionParseException.java b/gestalt-module/src/main/java/org/terasology/gestalt/naming/exception/VersionParseException.java index 932f5e98..724f0c5f 100644 --- a/gestalt-module/src/main/java/org/terasology/gestalt/naming/exception/VersionParseException.java +++ b/gestalt-module/src/main/java/org/terasology/gestalt/naming/exception/VersionParseException.java @@ -22,21 +22,45 @@ * @author Immortius */ public class VersionParseException extends RuntimeException { + + /** + * Default constructor. + */ public VersionParseException() { } + /** + * Constructor with message. + * @param message the message + */ public VersionParseException(String message) { super(message); } + /** + * Constructor with message and throwable. + * @param message the message + * @param cause the cause + */ public VersionParseException(String message, Throwable cause) { super(message, cause); } + /** + * Constructor with cause. + * @param cause the cause + */ public VersionParseException(Throwable cause) { super(cause); } + /** + * Constructor with message, cause, if suppression is enabled, and if stack trace can be written. + * @param message the message + * @param cause the cause + * @param enableSuppression true if exception can be suppressed + * @param writableStackTrace true if exception stacktrace can be written + */ public VersionParseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); }