org.test4j.module.core.utility
类 ModuleHelper

java.lang.Object
  继承者 org.test4j.module.core.utility.ModuleHelper

public class ModuleHelper
extends Object


字段摘要
static String DEFAULT_ENUM_VALUE_NAME
          The default name of the default enum value.
 
构造方法摘要
ModuleHelper()
           
 
方法摘要
static Map<Class<? extends Annotation>,Map<String,String>> getAnnotationPropertyDefaults(Class<? extends Module> moduleClass, 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<?>>
T
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.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DEFAULT_ENUM_VALUE_NAME

public static final String DEFAULT_ENUM_VALUE_NAME
The default name of the default enum value.

另请参见:
常量字段值
构造方法详细信息

ModuleHelper

public ModuleHelper()
方法详细信息

getAnnotationPropertyDefaults

public static Map<Class<? extends Annotation>,Map<String,String>> getAnnotationPropertyDefaults(Class<? extends Module> moduleClass,
                                                                                                Class<? extends Annotation>... annotationClasses)
Returns an object that represents the default values for the properties of the given annotations and the given module.

参数:
moduleClass - The class of the module for which we want the default annotation property values
configuration - The test4j configuration
annotationClasses - The annotations for which we want the default values
返回:
An object that returns the annotation property default values

getEnumValueReplaceDefault

public static <T extends Enum<?>> T 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. If enumValue contains the value DEFAULT_ENUM_VALUE_NAME the defaultValue will be returned otherwise the enumValue itself will be returned.

参数:
annotation - the annotation, not null
annotationPropertyName - the name of the annotation property
enumValue - the value to check, not null
allDefaultValues - the map with values to return in case of a default, not null
返回:
the enumValue or the defaultValue in case of a default

getClassValueReplaceDefault

public 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. If enumValue contains the value DEFAULT_ENUM_VALUE_NAME the defaultValue will be returned otherwise the enumValue itself will be returned.

参数:
annotation - the annotation, not null
annotationPropertyName - the name of the annotation property
value - the value to check, not null
allDefaultValues - the map with values to return in case of a default, not null
defaultValueClass - the name of the default value
返回:
the enumValue or the defaultValue in case of a default


Copyright © 2013. All rights reserved.