public class ModuleUtils extends Object
getAnnotationPropertyDefaults(Class,java.util.Properties,Class[]) ). The object that
this method returns can later be used to get replace the default placeholder of an annotation property for the
default value as configured in the unitils configuration.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENUM_VALUE_NAME
The default name of the default enum value.
|
| Constructor and Description |
|---|
ModuleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAnnotationPropertyDefault(Class<? extends Module> moduleClass,
Class<? extends Annotation> annotationClass,
String name,
Properties configuration)
Returns the default for annotation property of the given annotation with the given name for the given moduleclass.
|
static Map<Class<? extends Annotation>,Map<String,String>> |
getAnnotationPropertyDefaults(Class<? extends Module> moduleClass,
Properties configuration,
Class<? extends Annotation>... annotationClasses)
Returns an object that represents the default values for the properties of the given annotations and the given
module.
|
static Class<?> |
getClassValueReplaceDefault(Class<? extends Annotation> annotation,
String annotationPropertyName,
Class<?> value,
Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues,
Class<?> defaultValueClass)
Replaces default enum value with the given default enum value.
|
static <T extends Enum<?>> |
getEnumValueReplaceDefault(Class<? extends Annotation> annotation,
String annotationPropertyName,
T enumValue,
Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues)
Replaces default enum value with the given default enum value.
|
static <T extends Enum<?>> |
getEnumValueReplaceDefault(Class<? extends Annotation> annotation,
String annotationPropertyName,
T enumValue,
Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues,
String defaultValueName)
Replaces default enum value with the given default enum value.
|
public static final String DEFAULT_ENUM_VALUE_NAME
public static Map<Class<? extends Annotation>,Map<String,String>> getAnnotationPropertyDefaults(Class<? extends Module> moduleClass, Properties configuration, Class<? extends Annotation>... annotationClasses)
moduleClass - The class of the module for which we want the default annotation property valuesconfiguration - The unitils configurationannotationClasses - The annotations for which we want the default valuespublic static String getAnnotationPropertyDefault(Class<? extends Module> moduleClass, Class<? extends Annotation> annotationClass, String name, Properties configuration)
moduleClass - The module class, not nullannotationClass - The annotation class, not nullname - The property suffix, not nullconfiguration - The unitils config, not nullpublic static <T extends Enum<?>> T getEnumValueReplaceDefault(Class<? extends Annotation> annotation, String annotationPropertyName, T enumValue, Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues)
DEFAULT_ENUM_VALUE_NAME the defaultValue will be returned otherwise
the enumValue itself will be returned.annotation - the annotation, not nullannotationPropertyName - the name of the annotation propertyenumValue - the value to check, not nullallDefaultValues - the map with values to return in case of a default, not nullpublic static <T extends Enum<?>> T getEnumValueReplaceDefault(Class<? extends Annotation> annotation, String annotationPropertyName, T enumValue, Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues, String defaultValueName)
DEFAULT_ENUM_VALUE_NAME the defaultValue will be returned otherwise
the enumValue itself will be returned.annotation - the annotation, not nullannotationPropertyName - the name of the annotation propertyenumValue - the value to check, not nullallDefaultValues - the map with values to return in case of a default, not nulldefaultValueName - the name of the default valuepublic static Class<?> getClassValueReplaceDefault(Class<? extends Annotation> annotation, String annotationPropertyName, Class<?> value, Map<Class<? extends Annotation>,Map<String,String>> allDefaultValues, Class<?> defaultValueClass)
DEFAULT_ENUM_VALUE_NAME the defaultValue will be returned otherwise
the enumValue itself will be returned.annotation - the annotation, not nullannotationPropertyName - the name of the annotation propertyvalue - the value to check, not nullallDefaultValues - the map with values to return in case of a default, not nulldefaultValueClass - the name of the default valueCopyright © 2016. All Rights Reserved.