Top Description Inners Fields Constructors Methods
org.testng.internal.annotations

public Class JDK15TagFactory

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, java.util.Arrays, .HashSet, .List, .Set, org.testng.TestNGException, org.testng.annotations.AfterClass, .AfterGroups, .AfterMethod, .AfterSuite, .AfterTest, .BeforeClass, .BeforeGroups, .BeforeMethod, .BeforeSuite, .BeforeTest, .DataProvider, .Factory, .IAnnotation, .IDataProviderAnnotation, .IFactoryAnnotation, .IIgnoreAnnotation, .IListenersAnnotation, .IObjectFactoryAnnotation, .IParametersAnnotation, .ITestAnnotation, .Listeners, .Parameters, .Test, org.testng.collections.Lists, org.testng.internal.Utils, org.testng.internal.collections.Ints, org.testng.log4testng.Logger

This class creates implementations of IAnnotations based on the JDK5 annotation that was found on the Java element.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
JDK15TagFactory.Default<T>

This interface is used to calculate the default value for various annotation return types.

Field Summary

Modifier and TypeField and Description
private static final JDK15TagFactory.Default<Class<?>>
private static final JDK15TagFactory.Default<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private IAnnotation
createConfigurationTag(boolean beforeSuite, boolean afterSuite, boolean beforeTest, boolean afterTest, String[] beforeGroups, boolean isBeforeGroups, String[] afterGroups, boolean isAfterGroups, boolean beforeClass, boolean afterClass, boolean beforeMethod, boolean afterMethod, boolean alwaysRun, String[] dependsOnGroups, String[] dependsOnMethods, String description, boolean enabled, String[] groups, boolean inheritGroups, boolean firstTimeOnly, boolean lastTimeOnly, long timeOut, String[] groupFilters)

private IAnnotation
createConfigurationTag(boolean beforeSuite, boolean afterSuite, boolean beforeTest, boolean afterTest, String[] beforeGroups, boolean isBeforeGroups, String[] afterGroups, boolean isAfterGroups, boolean beforeClass, boolean afterClass, boolean beforeMethod, boolean afterMethod, boolean alwaysRun, String[] dependsOnGroups, String[] dependsOnMethods, String description, boolean enabled, String[] groups, boolean inheritGroups, boolean firstTimeOnly, boolean lastTimeOnly, long timeOut, String[] groupFilters, boolean ignoreFailure)

private IAnnotation
private IAnnotation
private IAnnotation
private IAnnotation
private IAnnotation
public <A extends IAnnotation> A
createTag(Class<?> cls, Method method, Annotation a, Class<A> annotationClass)

private IAnnotation
private <T> T
findInherited(T methodValue, Class<?> cls, Class<? extends Annotation> annotationClass, String methodName, JDK15TagFactory.Default<T> def)

Find the value of an annotation, starting with the annotation found on the method, then the class and then parent classes until we either find a non-default value or we reach the top of the hierarchy (Object).

private String[]
findInheritedStringArray(Class<?> cls, String methodName)

Find the value of a String[] annotation.

private Object
invokeMethod(Annotation test, String methodName)

private String[]
join(String[] strings, String[] strings2)

private IAnnotation
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_CLASSback to summary
private static final JDK15TagFactory.Default<Class<?>> DEFAULT_CLASS
DEFAULT_STRINGback to summary
private static final JDK15TagFactory.Default<String> DEFAULT_STRING

Constructor Detail

JDK15TagFactoryback to summary
public JDK15TagFactory()

Method Detail

createConfigurationTagback to summary
private IAnnotation createConfigurationTag(boolean beforeSuite, boolean afterSuite, boolean beforeTest, boolean afterTest, String[] beforeGroups, boolean isBeforeGroups, String[] afterGroups, boolean isAfterGroups, boolean beforeClass, boolean afterClass, boolean beforeMethod, boolean afterMethod, boolean alwaysRun, String[] dependsOnGroups, String[] dependsOnMethods, String description, boolean enabled, String[] groups, boolean inheritGroups, boolean firstTimeOnly, boolean lastTimeOnly, long timeOut, String[] groupFilters)
createConfigurationTagback to summary
private IAnnotation createConfigurationTag(boolean beforeSuite, boolean afterSuite, boolean beforeTest, boolean afterTest, String[] beforeGroups, boolean isBeforeGroups, String[] afterGroups, boolean isAfterGroups, boolean beforeClass, boolean afterClass, boolean beforeMethod, boolean afterMethod, boolean alwaysRun, String[] dependsOnGroups, String[] dependsOnMethods, String description, boolean enabled, String[] groups, boolean inheritGroups, boolean firstTimeOnly, boolean lastTimeOnly, long timeOut, String[] groupFilters, boolean ignoreFailure)
createDataProviderTagback to summary
private IAnnotation createDataProviderTag(Method method, Annotation a)
createFactoryTagback to summary
private IAnnotation createFactoryTag(Class<?> cls, Annotation a)
createListenersTagback to summary
private IAnnotation createListenersTag(Annotation a)
createObjectFactoryTagback to summary
private IAnnotation createObjectFactoryTag()
createParametersTagback to summary
private IAnnotation createParametersTag(Annotation a)
createTagback to summary
public <A extends IAnnotation> A createTag(Class<?> cls, Method method, Annotation a, Class<A> annotationClass)
createTestTagback to summary
private IAnnotation createTestTag(Class<?> cls, Annotation a)
findInheritedback to summary
private <T> T findInherited(T methodValue, Class<?> cls, Class<? extends Annotation> annotationClass, String methodName, JDK15TagFactory.Default<T> def)

Find the value of an annotation, starting with the annotation found on the method, then the class and then parent classes until we either find a non-default value or we reach the top of the hierarchy (Object).

Annotations
@SuppressWarnings:unchecked
findInheritedStringArrayback to summary
private String[] findInheritedStringArray(Class<?> cls, String methodName)

Find the value of a String[] annotation. The difference with the findInherited method above is that TestNG aggregates String[] values across hierarchies. For example, of the method annotation has { "a", "b" } and the class has { "c" }, the returned value will be { "a", "b", "c" }.

invokeMethodback to summary
private Object invokeMethod(Annotation test, String methodName)
joinback to summary
private String[] join(String[] strings, String[] strings2)
maybeCreateNewConfigurationTagback to summary
private IAnnotation maybeCreateNewConfigurationTag(Annotation a, Class<?> annotationClass)
org.testng.internal.annotations back to summary

pack-priv Interface JDK15TagFactory.Default<T>


This interface is used to calculate the default value for various annotation return types. This is used when looking for an annotation in a hierarchy. We can't use null as a default since annotation don't allow nulls, so each type has a different way of defining its own default.

Method Summary

Modifier and TypeMethod and Description
public boolean
isDefault(T t)

Method Detail

isDefaultback to summary
public boolean isDefault(T t)