blob: 98e6f11d6a6a626db69a08f3686988273b9539e9 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008 E.D.Willink and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
package org.eclipse.qvt.declarative.emof.EMOF.util;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.qvt.declarative.emof.EMOF.EMOFPackage;
/**
* An EMOFTagAnnotationClassMap defines the behaviour of the EAnnotationAdapter
* adapting the EAnnotation created when an EMOF Tag is loaded. It ensures
* that the EAnnotation is marked as a Tag once loading completes.
*/
public class EMOFTagAnnotationClassMap extends RedirectedAnnotationClassMap
{
public EMOFTagAnnotationClassMap(EAnnotationClassMap annotationClassMap) {
super(annotationClassMap, EMOFPackage.Literals.TAG);
}
@Override
public void postLoad(EAnnotationAdapter tagAdapter) {
EAnnotation annotation = tagAdapter.getTarget();
if (annotation.getSource() == null)
annotation.setSource(EMOFAnnotationMappingMetaData.EMOF_TAG_ANNOTATION_SOURCE);
}
}