A qualified name identifying a module.
The raw representation of a module qualified name is a valid Java name.
The name of a module is tightly linked to the name of the corresponding Java module.
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.core.compiler.spi.QualifiedName
SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionModuleQualifiedName(String packageName, String moduleName)Creates a module qualified name from the specified package and module names.ModuleQualifiedName(String packageName, String moduleName, String className)Creates a module qualified name from the specified package and module names with the specified class name.ModuleQualifiedName(String packageName, String moduleName, String className, String sourcePackageName)Creates a module qualified name from the specified package and module names with the specified class name and source package name. -
Method Summary
Modifier and TypeMethodDescriptionReturns the module class name.Returns the module simple name.Returns the module package name.Returns a simple representation of this qualified name.Return the source package name.static ModuleQualifiedNameCreates a module qualified name from the specified raw value which should be a valid Java name.static ModuleQualifiedNameCreates a module qualified name from the specified raw value which should be a valid Java name and with the specified class name.static ModuleQualifiedNameCreates a module qualified name from the specified raw value which should be a valid Java name and with the specified class name.Methods inherited from class io.inverno.core.compiler.spi.QualifiedName
equals, getValue, hashCode, normalize, toString, validateQualifiedNamePart
-
Constructor Details
-
ModuleQualifiedName
public ModuleQualifiedName(String packageName, String moduleName) throws QualifiedNameFormatExceptionCreates a module qualified name from the specified package and module names.
- Parameters:
packageName- the package namemoduleName- the simple name of the module- Throws:
QualifiedNameFormatException- if one of the specified names is invalid
-
ModuleQualifiedName
public ModuleQualifiedName(String packageName, String moduleName, String className) throws QualifiedNameFormatExceptionCreates a module qualified name from the specified package and module names with the specified class name.
- Parameters:
packageName- the package namemoduleName- the module simple nameclassName- the module class name- Throws:
QualifiedNameFormatException- if one of the specified names is invalid
-
ModuleQualifiedName
public ModuleQualifiedName(String packageName, String moduleName, String className, String sourcePackageName) throws QualifiedNameFormatExceptionCreates a module qualified name from the specified package and module names with the specified class name and source package name.
- Parameters:
packageName- the package namemoduleName- the module simple nameclassName- the module class namesourcePackageName- the module source package name- Throws:
QualifiedNameFormatException- if one of the specified names is invalid
-
-
Method Details
-
getClassName
Returns the module class name.
If not explicitly specified, the class name derives from the module package name and the module simple name for the package and uses the module simple name for the simple class name (eg. the class name of module
com.example.someModuleiscom.example.someModule.SomeModule.- Returns:
- a canonical class name
-
getSimpleValue
Description copied from class:QualifiedNameReturns a simple representation of this qualified name.
Note that this representation is no longer "qualified".
- Specified by:
getSimpleValuein classQualifiedName- Returns:
- a simple representation
-
getSourcePackageName
Return the source package name.
- Returns:
- the source package name.
-
getPackageName
Returns the module package name.
- Returns:
- a package name
-
getModuleName
Returns the module simple name.
Note that this representation is not "qualified".
- Returns:
- a simple name
-
valueOf
Creates a module qualified name from the specified raw value which should be a valid Java name.
- Parameters:
qname- a raw qualified name- Returns:
- a module qualified name
- Throws:
QualifiedNameFormatException- if the specified value is not a module qualified name
-
valueOf
public static ModuleQualifiedName valueOf(String qname, String className) throws QualifiedNameFormatExceptionCreates a module qualified name from the specified raw value which should be a valid Java name and with the specified class name.
- Parameters:
qname- a raw qualified nameclassName- a module class name- Returns:
- a module qualified name
- Throws:
QualifiedNameFormatException- if the specified value is not a module qualified name
-
valueOf
public static ModuleQualifiedName valueOf(String qname, String className, String sourcePackageName) throws QualifiedNameFormatExceptionCreates a module qualified name from the specified raw value which should be a valid Java name and with the specified class name.
- Parameters:
qname- a raw qualified nameclassName- a module class namesourcePackageName- a module source package name- Returns:
- a module qualified name
- Throws:
QualifiedNameFormatException- if the specified value is not a module qualified name
-