<commit_before>package fr.liglab.adele.cream.ipojo.module;

import fr.liglab.adele.cream.annotations.behavior.Behavior;
import fr.liglab.adele.cream.annotations.internal.BehaviorReference;
import fr.liglab.adele.cream.annotations.internal.HandlerReference;
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;

/**
 * Created by aygalinc on 15/01/16.
 */
public class BehaviorProcessor extends AnnotationProcessor<Behavior>  {

	protected static final String BEHAVIOR_ELEMENT = HandlerReference.NAMESPACE +":"+ HandlerReference.BEHAVIOR_MANAGER_HANDLER;

	public BehaviorProcessor(ClassLoader classReferenceLoader) {
		super(Behavior.class,classReferenceLoader);
	}

	@Override
	public void process(Behavior annotation) {
		buildSubBehaviorElement(annotation);
	}

	private void buildSubBehaviorElement(Behavior annotation){
		Element behaviorIndividualElement = new Element(BehaviorReference.BEHAVIOR_INDIVIDUAL_ELEMENT_NAME,"");
		Attribute specAttr = new Attribute(BehaviorReference.SPECIFICATION_ATTRIBUTE_NAME,annotation.spec().getName());
		Attribute implAttr = new Attribute(BehaviorReference.IMPLEMEMENTATION_ATTRIBUTE_NAME,annotation.implem().getName());
		Attribute id = new Attribute(BehaviorReference.ID_ATTRIBUTE_NAME,annotation.id());
		behaviorIndividualElement.addAttribute(specAttr);
		behaviorIndividualElement.addAttribute(implAttr);
		behaviorIndividualElement.addAttribute(id);

		addMetadataElement(BehaviorReference.BEHAVIOR_INDIVIDUAL_ELEMENT_NAME,behaviorIndividualElement,getBehaviorParentElement());

	}

	private boolean checkRootElement(Element root){
		if (ContextEntityProcessor.COMPONENT_TYPE.equals(root.getName())){
			return true;
		}
		return false;
	}

	private String getBehaviorParentElement(){
		Element behaviorElement = getMetadataElement(BEHAVIOR_ELEMENT);
<commit_msg>remove unused method<commit_after>package fr.liglab.adele.cream.ipojo.module;

import fr.liglab.adele.cream.annotations.behavior.Behavior;
import fr.liglab.adele.cream.annotations.internal.BehaviorReference;
import fr.liglab.adele.cream.annotations.internal.HandlerReference;
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;

/**
 * Created by aygalinc on 15/01/16.
 */
public class BehaviorProcessor extends AnnotationProcessor<Behavior>  {

	protected static final String BEHAVIOR_ELEMENT = HandlerReference.NAMESPACE +":"+ HandlerReference.BEHAVIOR_MANAGER_HANDLER;

	public BehaviorProcessor(ClassLoader classReferenceLoader) {
		super(Behavior.class,classReferenceLoader);
	}

	@Override
	public void process(Behavior annotation) {
		buildSubBehaviorElement(annotation);
	}

	private void buildSubBehaviorElement(Behavior annotation){
		Element behaviorIndividualElement = new Element(BehaviorReference.BEHAVIOR_INDIVIDUAL_ELEMENT_NAME,"");
		Attribute specAttr = new Attribute(BehaviorReference.SPECIFICATION_ATTRIBUTE_NAME,annotation.spec().getName());
		Attribute implAttr = new Attribute(BehaviorReference.IMPLEMEMENTATION_ATTRIBUTE_NAME,annotation.implem().getName());
		Attribute id = new Attribute(BehaviorReference.ID_ATTRIBUTE_NAME,annotation.id());
		behaviorIndividualElement.addAttribute(specAttr);
		behaviorIndividualElement.addAttribute(implAttr);
		behaviorIndividualElement.addAttribute(id);

		addMetadataElement(BehaviorReference.BEHAVIOR_INDIVIDUAL_ELEMENT_NAME,behaviorIndividualElement,getBehaviorParentElement());

	}

	private String getBehaviorParentElement(){
		Element behaviorElement = getMetadataElement(BEHAVIOR_ELEMENT);

{'fraction_non_alphanumeric': 0.09009261857984845, 'fraction_numerical': 0.0033679483581251753, 'mean_word_length': 8.045685279187817, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5567802', 'n_tokens_mistral': 1085, 'n_tokens_neox': 986, 'n_words': 150}