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 outgoing reference builder method. 
023 * The method shall have 4 or 5 parameters compatible with parameters of <p/>
024 * 
025 *  <code>EObjectNodeProcessor.buildOutgoingReference(
026 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link EReference} eReference,
027 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link List}&lt;{@link Entry}&lt;{{@link EReferenceConnection}, {@link WidgetFactory}&gt;&gt; referenceOutgoingEndpoints,
028 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link Collection}&lt;{@link Label}&gt; labels,
029 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link Map}&lt;{@link EReferenceConnection}, {@link Collection}&lt;{@link Label}&gt;&gt outgoingLabels,
030 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@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 OutgoingReferenceBuilder {
039
040        /**
041         * Reference ID, obtained from EPackage constants, e.g. <code>{@link EcorePackage}.ECLASS__EALL_ATTRIBUTES</code>.
042         * @return
043         */
044        int referenceID();
045        
046        /**
047         * Declaring class ID, obtained from EPackage constants, e.g. <code>{@link EcorePackage}.ECLASS</code>.
048         * Declaring class ID may need to be specified in situations with multiple inheritance where the reference builder
049         * method is defined in a common sub-class. 
050         * @return
051         */
052        int classID(); 
053        
054        /**
055         * Namespace URI of declaring class' {@link EPackage}, obtained from EPackage constants, e.g. <code>{@link EcorePackage}.eNS_URI</code>.
056         * Namespace URI may need to be specified in situations with multiple inheritance where the reference builder
057         * method is defined in a common sub-class. 
058         * @return
059         */     
060        String nsURI();
061        
062}
063