Top Description Fields Constructors Methods
org.testng.internal

public Class ClassImpl

extends Object
implements IClass, IObject
Class Inheritance
All Implemented Interfaces
org.testng.internal.IObject, org.testng.IClass
Imports
java.util.Arrays, .List, .Map, org.testng.IClass, .ITest, .ITestContext, .ITestObjectFactory, org.testng.annotations.ITestAnnotation, org.testng.collections.Lists, .Objects, org.testng.internal.annotations.IAnnotationFinder, org.testng.internal.objects.DefaultTestObjectFactory, .Dispenser, .IObjectDispenser, org.testng.internal.objects.pojo.BasicAttributes, .CreationAttributes, .DetailedAttributes, org.testng.xml.XmlClass, .XmlTest

Implementation of an IClass.

Field Summary

Modifier and TypeField and Description
private final List<IObject.IdentifiableObject>
private final IAnnotationFinder
private final Class<?>
private final Map<Class<?>, IClass>
private IObject.IdentifiableObject
private final IObject.IdentifiableObject
private long[]
private final ITestObjectFactory
private final ITestContext
private String
private final XmlClass

Constructor Summary

AccessConstructor and Description
public
ClassImpl(ITestContext context, Class<?> cls, XmlClass xmlClass, IObject.IdentifiableObject instance, Map<Class<?>, IClass> classes, IAnnotationFinder annotationFinder, ITestObjectFactory objectFactory)

Method Summary

Modifier and TypeMethod and Description
public void
addInstance(Object
- The instance to be added.
instance
)

Implements org.testng.IClass.addInstance.

public void
addObject(IObject.IdentifiableObject
- The instance that should be added to the list of instances.
instance
)

Implements org.testng.internal.IObject.addObject.

private static int
private IObject.IdentifiableObject
getDefaultInstance(boolean create, String errMsgPrefix)

public long[]
public Object[]
getInstances(boolean
flag if a new set of instances must be returned (if set to false)
create
)

Implements org.testng.IClass.getInstances.

Returns all the instances the methods will be invoked upon.
public Object[]
getInstances(boolean
flag if a new set of instances must be returned (if set to false)
create
,
String
- Text that should be prefixed to the error message when there are issues. Can be empty.
errorMsgPrefix
)

Overrides default org.testng.IClass.getInstances.

Returns all the instances the methods will be invoked upon.
public String
public IObject.IdentifiableObject[]
getObjects(boolean
- true if objects should be created before returning.
create
,
String
- Text that should be prefixed to the error message when there are issues. Can be empty.
errorMsgPrefix
)

Implements org.testng.internal.IObject.getObjects.

Returns all the instances the methods will be invoked upon.
public Class<?>
public String
public XmlClass
public XmlTest
private DetailedAttributes
newDetailedAttributes(boolean create, String errMsgPrefix)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

identifiableObjectsback to summary
private final List<IObject.IdentifiableObject> identifiableObjects
m_annotationFinderback to summary
private final IAnnotationFinder m_annotationFinder
m_classback to summary
private final Class<?> m_class
m_classesback to summary
private final Map<Class<?>, IClass> m_classes
m_defaultInstanceback to summary
private IObject.IdentifiableObject m_defaultInstance
m_instanceback to summary
private final IObject.IdentifiableObject m_instance
m_instanceHashCodesback to summary
private long[] m_instanceHashCodes
m_objectFactoryback to summary
private final ITestObjectFactory m_objectFactory
m_testContextback to summary
private final ITestContext m_testContext
m_testNameback to summary
private String m_testName
m_xmlClassback to summary
private final XmlClass m_xmlClass

Constructor Detail

ClassImplback to summary
public ClassImpl(ITestContext context, Class<?> cls, XmlClass xmlClass, IObject.IdentifiableObject instance, Map<Class<?>, IClass> classes, IAnnotationFinder annotationFinder, ITestObjectFactory objectFactory)

Method Detail

addInstanceback to summary
public void addInstance(Object instance)

Implements org.testng.IClass.addInstance.

Parameters
instance:Object

Doc from org.testng.IClass.addInstance.

- The instance to be added.

Annotations
@Override
addObjectback to summary
public void addObject(IObject.IdentifiableObject instance)

Implements org.testng.internal.IObject.addObject.

Parameters
instance:IObject.IdentifiableObject

Doc from org.testng.internal.IObject.addObject.

- The instance that should be added to the list of instances.

Annotations
@Override
computeHashCodeback to summary
private static int computeHashCode(Object instance)
getDefaultInstanceback to summary
private IObject.IdentifiableObject getDefaultInstance(boolean create, String errMsgPrefix)
getInstanceHashCodesback to summary
public long[] getInstanceHashCodes()

Implements org.testng.IClass.getInstanceHashCodes, org.testng.internal.IObject.getInstanceHashCodes.

Returns:long[]

Doc from org.testng.internal.IObject.getInstanceHashCodes.

- An array representing the hash codes of the corresponding instances.

Annotations
@Override
getInstancesback to summary
public Object[] getInstances(boolean create)

Implements org.testng.IClass.getInstances.

Doc from org.testng.IClass.getInstances.

Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters
create:boolean

flag if a new set of instances must be returned (if set to false)

Returns:Object[]

All the instances the methods will be invoked upon.

Annotations
@Override
getInstancesback to summary
public Object[] getInstances(boolean create, String errorMsgPrefix)

Overrides default org.testng.IClass.getInstances.

Doc from org.testng.IClass.getInstances.

Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters
create:boolean

flag if a new set of instances must be returned (if set to false)

errorMsgPrefix:String

- Text that should be prefixed to the error message when there are issues. Can be empty.

Returns:Object[]

All the instances the methods will be invoked upon.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.testng.IClass.getName.

Returns:String

Doc from org.testng.IClass.getName.

this test class name. This is the name of the corresponding Java class.

Annotations
@Override
getObjectsback to summary
public IObject.IdentifiableObject[] getObjects(boolean create, String errorMsgPrefix)

Implements org.testng.internal.IObject.getObjects.

Doc from org.testng.internal.IObject.getObjects.

Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters
create:boolean

- true if objects should be created before returning.

errorMsgPrefix:String

- Text that should be prefixed to the error message when there are issues. Can be empty.

Returns:IObject.IdentifiableObject[]

- An array of IdentifiableObject objects

Annotations
@Override
getRealClassback to summary
public Class<?> getRealClass()

Implements org.testng.IClass.getRealClass.

Returns:Class<?>

Doc from org.testng.IClass.getRealClass.

the Java class corresponding to this IClass.

Annotations
@Override
getTestNameback to summary
public String getTestName()

Implements org.testng.IClass.getTestName.

Returns:String

Doc from org.testng.IClass.getTestName.

its test name if this class implements org.testng.ITest, null otherwise.

Annotations
@Override
getXmlClassback to summary
public XmlClass getXmlClass()

Implements org.testng.IClass.getXmlClass.

Returns:XmlClass

Doc from org.testng.IClass.getXmlClass.

the *lt;class> tag this class was found in.

Annotations
@Override
getXmlTestback to summary
public XmlTest getXmlTest()

Implements org.testng.IClass.getXmlTest.

Returns:XmlTest

Doc from org.testng.IClass.getXmlTest.

the <test> tag this class was found in.

Annotations
@Override
newDetailedAttributesback to summary
private DetailedAttributes newDetailedAttributes(boolean create, String errMsgPrefix)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override