Package org.cyclos.model.utils
Class ModelNameHelper
- java.lang.Object
-
- org.cyclos.model.utils.ModelNameHelper
-
public class ModelNameHelper extends Object
Contains helper methods for handling model class names
-
-
Field Summary
Fields Modifier and Type Field Description static StringPACKAGE_ROOTstatic StringUTILS_PACKAGE_ROOT
-
Constructor Summary
Constructors Constructor Description ModelNameHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ModulegetModule(String qualifiedClassName)Returns theModulefrom the given fully-qualified class name, or null when nonestatic StringgetPackageRoot(Module module)Returns the root package for the given modulestatic StringgetPackageRoot(Submodule submodule)Returns the root package for the given modulestatic SubmodulegetSubmodule(String qualifiedClassName)Returns theSubmodulefrom the given fully-qualified class name, or null when nonestatic booleanisModel(String qualifiedClassName)Returns whether the given fully-qualified class name is a model classstatic booleanisModelUtils(String qualifiedClassName)Returns whether the given fully-qualified class name is a class in the utils packagestatic Stringqualify(String... classNameParts)Returns the qualified name class name for a class in the root of the modelstatic Stringqualify(Module module, String... classNameParts)Returns the qualified name class name for a given modulestatic Stringqualify(Submodule submodule, String... classNameParts)Returns the qualified name class name for a given submodulestatic StringqualifyUtils(String... classNameParts)Returns the qualified name class name for a class in the org.cyclos.model.utils package
-
-
-
Field Detail
-
PACKAGE_ROOT
public static final String PACKAGE_ROOT
- See Also:
- Constant Field Values
-
UTILS_PACKAGE_ROOT
public static final String UTILS_PACKAGE_ROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getModule
public static Module getModule(String qualifiedClassName)
Returns theModulefrom the given fully-qualified class name, or null when none
-
getPackageRoot
public static String getPackageRoot(Module module)
Returns the root package for the given module
-
getPackageRoot
public static String getPackageRoot(Submodule submodule)
Returns the root package for the given module
-
getSubmodule
public static Submodule getSubmodule(String qualifiedClassName)
Returns theSubmodulefrom the given fully-qualified class name, or null when none
-
isModel
public static boolean isModel(String qualifiedClassName)
Returns whether the given fully-qualified class name is a model class
-
isModelUtils
public static boolean isModelUtils(String qualifiedClassName)
Returns whether the given fully-qualified class name is a class in the utils package
-
qualify
public static String qualify(Module module, String... classNameParts)
Returns the qualified name class name for a given module
-
qualify
public static String qualify(String... classNameParts)
Returns the qualified name class name for a class in the root of the model
-
qualify
public static String qualify(Submodule submodule, String... classNameParts)
Returns the qualified name class name for a given submodule
-
-