Package guru.mikelue.jdut.annotation
Class JdutResourceNaming
- java.lang.Object
-
- guru.mikelue.jdut.annotation.JdutResourceNaming
-
public final class JdutResourceNaming extends Object
Provides generating of resource name by format string(
For example:MessageFormat
) and properties of class/method.
// objMethod - The object of java.lang.reflect.Method String fileName = JdutResourceNaming.naming("{1}-{4}", objMethod, ".yaml");
- See Also:
MessageFormat
-
-
Method Summary
-
-
-
Method Detail
-
naming
public static String naming(String format, Class<?> sourceClass)
Generating naming byMessageFormat
.
The parameters for formatting:- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
sourceClass
- The source class used for naming- Returns:
- formatted string
-
naming
public static String naming(String format, Method sourceMethod)
Generating naming byMessageFormat
.
The parameters for formatting:- 0 -
Class.getName()
- 1 -
Class.getSimpleName()
- 2 -
Class.getTypeName()
- 3 -
Class.getCanonicalName()
- 4 -
Method.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
sourceMethod
- The method used for naming- Returns:
- formatted string
- 0 -
-
naming
public static String naming(String format, Class<?> sourceClass, String suffix)
Generating naming byMessageFormat
and suffix.
The parameters for formatting:- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
sourceClass
- The source class used for namingsuffix
- The suffix of resource- Returns:
- formatted string
-
naming
public static String naming(String format, Method sourceMethod, String suffix)
Generating naming byMessageFormat
.
The parameters for formatting:- 0 -
Class.getName()
- 1 -
Class.getSimpleName()
- 2 -
Class.getTypeName()
- 3 -
Class.getCanonicalName()
- 4 -
Method.getName()
- Parameters:
format
- The format used inMessageFormat.format(String, Object...)
sourceMethod
- The method used for namingsuffix
- The suffix of resource- Returns:
- formatted string
- 0 -
-
-