|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.util.ModuleUtils
public class ModuleUtils
Class containing utility methods for module specific configuration. Contains a method for retrieving all annotation
property defaults (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.
Field Summary | |
---|---|
static String |
DEFAULT_ENUM_VALUE_NAME
The default name of the default enum value. |
Constructor Summary | |
---|---|
ModuleUtils()
|
Method Summary | ||
---|---|---|
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
|
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
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_ENUM_VALUE_NAME
Constructor Detail |
---|
public ModuleUtils()
Method Detail |
---|
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 values
public 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 null
public 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 null
public 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 value
public 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 value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |