001package org.nasdanika.html.model.app.graph.emf; 002 003import static java.lang.annotation.ElementType.METHOD; 004import static java.lang.annotation.RetentionPolicy.RUNTIME; 005 006import java.lang.annotation.Retention; 007import java.lang.annotation.Target; 008import java.util.Collection; 009import java.util.List; 010import java.util.Map; 011import java.util.Map.Entry; 012 013import org.eclipse.emf.ecore.EPackage; 014import org.eclipse.emf.ecore.EReference; 015import org.eclipse.emf.ecore.EcorePackage; 016import org.nasdanika.common.ProgressMonitor; 017import org.nasdanika.graph.emf.EReferenceConnection; 018import org.nasdanika.html.model.app.Label; 019import org.nasdanika.html.model.app.graph.WidgetFactory; 020 021/** 022 * Annotation for an icoming reference builder method. 023 * The method shall have 4 or 5 parameters compatible with parameters of <p/> 024 * 025 * <code>EObjectNodeProcessor.buildIncomingReference( 026 * <br/> {@link EReference} eReference, 027 * <br/> {@link List}<{@link Entry}<{{@link EReferenceConnection}, {@link WidgetFactory}>> referenceIncomingEndpoints, 028 * <br/> {@link Collection}<{@link Label}> labels, 029 * <br/> {@link Map}<{@link EReferenceConnection}, {@link Collection}<{@link Label}>> incomingLabels, 030 * <br/> {@link ProgressMonitor} progressMonitor)</code> 031 * <p/> 032 * In the case of 4 parameters it is the last 4 parameters because the reference is already bound by the annotation. 033 * @author Pavel 034 * 035 */ 036@Retention(RUNTIME) 037@Target(METHOD) 038public @interface IncomingReferenceBuilder { 039 040 /** 041 * {@link EPackage} namespace URI obtained from constants, e.g. <code>{@link EcorePackage}.eNS_URI</code> 042 * @return 043 */ 044 String nsURI(); 045 046 /** 047 * Reference ID, obtained from generated {@link EPackage} constants, e.g. <code>{@link EcorePackage}.ECLASS</code>. 048 * @return 049 */ 050 int classID(); 051 052 /** 053 * Reference ID, obtained from generated {@link EPackage} constants, e.g. <code>{@link EcorePackage}.ECLASS__EALL_ATTRIBUTES</code>. 054 * @return 055 */ 056 int referenceID(); 057 058} 059