package br.uem.din.architectureEvolution.helpers;

import com.sdmetrics.model.ModelElement;

public class StereotypeHelper {

	private static final String VARIATION_POINT = "variationPoint";
	private static final String VARIABILITY = "variability";
	private static final String FEATURE = "Feature";
	private static final String CONCERN = "Concern";

	public static boolean isVariationPoint(ModelElement stereotype) {
		return stereotype.getName().equalsIgnoreCase(VARIATION_POINT);
	}
	
	public static boolean isFeature(ModelElement element) {
		for (ModelElement stereotype : ModelElementHelper.getStereotypes(element)) 			
			if (stereotype.getName().equalsIgnoreCase(FEATURE)) 
				return true;
		return false;
	}
	
	public static boolean isVariability(ModelElement element){
		for (ModelElement stereotype : ModelElementHelper.getStereotypes(element)) 			
			if (stereotype.getName().equalsIgnoreCase(VARIABILITY)) 
				return true;		
		return false;
	}

	public static boolean isConcern(ModelElement stereotype) {	
		for (ModelElement subStereotype : ModelElementHelper.getStereotypes(stereotype)) 			
			if (subStereotype.getName().equalsIgnoreCase(CONCERN)) 
				return true;
		return false;
	}	
}
