Class ModuleQualifiedName

java.lang.Object
io.inverno.core.compiler.spi.QualifiedName
io.inverno.core.compiler.spi.ModuleQualifiedName

public class ModuleQualifiedName extends QualifiedName

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
  • Constructor Details

    • ModuleQualifiedName

      public ModuleQualifiedName(String packageName, String moduleName) throws QualifiedNameFormatException

      Creates a module qualified name from the specified package and module names.

      Parameters:
      packageName - the package name
      moduleName - 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 QualifiedNameFormatException

      Creates a module qualified name from the specified package and module names with the specified class name.

      Parameters:
      packageName - the package name
      moduleName - the module simple name
      className - 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 QualifiedNameFormatException

      Creates a module qualified name from the specified package and module names with the specified class name and source package name.

      Parameters:
      packageName - the package name
      moduleName - the module simple name
      className - the module class name
      sourcePackageName - the module source package name
      Throws:
      QualifiedNameFormatException - if one of the specified names is invalid
  • Method Details

    • getClassName

      public String 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.someModule is com.example.someModule.SomeModule.

      Returns:
      a canonical class name
    • getSimpleValue

      public String getSimpleValue()
      Description copied from class: QualifiedName

      Returns a simple representation of this qualified name.

      Note that this representation is no longer "qualified".

      Specified by:
      getSimpleValue in class QualifiedName
      Returns:
      a simple representation
    • getSourcePackageName

      public String getSourcePackageName()

      Return the source package name.

      Returns:
      the source package name.
    • getPackageName

      public String getPackageName()

      Returns the module package name.

      Returns:
      a package name
    • getModuleName

      public String getModuleName()

      Returns the module simple name.

      Note that this representation is not "qualified".

      Returns:
      a simple name
    • valueOf

      public static ModuleQualifiedName valueOf(String qname) throws QualifiedNameFormatException

      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 QualifiedNameFormatException

      Creates 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 name
      className - 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 QualifiedNameFormatException

      Creates 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 name
      className - a module class name
      sourcePackageName - a module source package name
      Returns:
      a module qualified name
      Throws:
      QualifiedNameFormatException - if the specified value is not a module qualified name