Class ModuleName

java.lang.Object
com.iizix.prop.ModuleName

public final class ModuleName extends Object
The name rules of an IIZI Module project, which in the Designer is the project's name. A Module name is an atom name (Atom.validateName(String)) that is also part of the URL of every file of the Module (/$<appID>/<module>$/<path>), so the characters that break such a URL are refused too: # ends the path (the fragment), % begins an escape and $ ends the Module's name in the path. They are not reserved characters of an atom (Atom.RESERVED_CHARS), which every property name shares.

The check is made where a name is created or renamed (the Designer's wizards and the project rename) and where a Module project is loaded (the server's ModuleProject.loadModuleProject, the Designer's load).

Author:
Christopher Mindus
  • Field Details

    • URL_RESERVED_CHARS

      public static final String URL_RESERVED_CHARS
      The characters refused in a Module name beside the atom's reserved characters: #, % and $, the ones that break the URL of the Module's files.
      See Also:
  • Method Details

    • validate

      public static String validate(String name)
      Validates a Module name: the atom name rules, then the URL characters.
      Parameters:
      name - The name to verify.
      Returns:
      The error message in English such as "cannot be empty" or "cannot contain the character...", to be prefixed with what the name is ("Project name "), or null for successful validation.
    • isValid

      public static boolean isValid(String name)
      Checks a Module name.
      Parameters:
      name - The name to verify.
      Returns:
      true for a valid name, false otherwise.