org.nasdanika.models.coverage.MethodCoverage Maven / Gradle / Ivy
/**
*/
package org.nasdanika.models.coverage;
import org.eclipse.emf.common.util.EList;
import org.jacoco.core.analysis.IMethodCoverage;
import org.objectweb.asm.Type;
/**
*
* A representation of the model object 'Method Coverage'.
*
*
*
* The following features are supported:
*
*
* - {@link org.nasdanika.models.coverage.MethodCoverage#getDescription Description}
* - {@link org.nasdanika.models.coverage.MethodCoverage#getSignature Signature}
* - {@link org.nasdanika.models.coverage.MethodCoverage#getParameterTypes Parameter Types}
*
*
* @see org.nasdanika.models.coverage.CoveragePackage#getMethodCoverage()
* @model
* @generated
*/
public interface MethodCoverage extends SourceCoverage {
/**
* Returns the value of the 'Description' attribute.
*
*
* @return the value of the 'Description' attribute.
* @see #setDescription(String)
* @see org.nasdanika.models.coverage.CoveragePackage#getMethodCoverage_Description()
* @model
* @generated
*/
String getDescription();
/**
* Sets the value of the '{@link org.nasdanika.models.coverage.MethodCoverage#getDescription Description}' attribute.
*
*
* @param value the new value of the 'Description' attribute.
* @see #getDescription()
* @generated
*/
void setDescription(String value);
/**
* Returns the value of the 'Signature' attribute.
*
*
* @return the value of the 'Signature' attribute.
* @see #setSignature(String)
* @see org.nasdanika.models.coverage.CoveragePackage#getMethodCoverage_Signature()
* @model
* @generated
*/
String getSignature();
/**
* Sets the value of the '{@link org.nasdanika.models.coverage.MethodCoverage#getSignature Signature}' attribute.
*
*
* @param value the new value of the 'Signature' attribute.
* @see #getSignature()
* @generated
*/
void setSignature(String value);
/**
* Returns the value of the 'Parameter Types' attribute list.
* The list contents are of type {@link java.lang.String}.
*
*
* @return the value of the 'Parameter Types' attribute list.
* @see org.nasdanika.models.coverage.CoveragePackage#getMethodCoverage_ParameterTypes()
* @model
* @generated
*/
EList getParameterTypes();
default void load(IMethodCoverage data) {
SourceCoverage.super.load(data);
setDescription(data.getDesc());
setSignature(data.getSignature());
if (data.getDesc() != null) {
Type[] argumentTypes = Type.getArgumentTypes(data.getDesc());
EList parameterTypes = getParameterTypes();
if (argumentTypes != null) {
for (Type type: argumentTypes) {
parameterTypes.add(type.getClassName());
}
}
}
}
} // MethodCoverage