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.EOperation;
014import org.eclipse.emf.ecore.EPackage;
015import org.eclipse.emf.ecore.EcorePackage;
016import org.nasdanika.common.ProgressMonitor;
017import org.nasdanika.graph.emf.EOperationConnection;
018import org.nasdanika.html.model.app.Label;
019import org.nasdanika.html.model.app.graph.WidgetFactory;
020
021/**
022 * Annotation for an outgoing operation builder method. 
023 * The method shall have 4 or 5 parameters compatible with parameters of <p/>
024 * 
025 *  <code>EObjectNodeProcessor.buildOutgoingOperation(
026 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link EOperation} eOperation,
027 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link List}&lt;{@link Entry}&lt;{{@link EOperationConnection}, {@link WidgetFactory}&gt;&gt; operationOutgoingEndpoints,
028 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link Collection}&lt;{@link Label}&gt; labels,
029 * <br/>&nbsp;&nbsp;&nbsp;&nbsp;                        {@link Map}&lt;{@link EOperationConnection}, {@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 operation is already bound by the annotation.                     
033 * @author Pavel
034 *
035 */
036@Retention(RUNTIME)
037@Target(METHOD)
038public @interface OutgoingOperationBuilder {
039
040        /**
041         * Operation ID, obtained from EPackage constants, e.g. <code>{@link EcorePackage}.EOBJECT___ECONTAINER</code>.
042         * @return
043         */
044        int value();
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() default -1; 
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() default "";
061        
062}
063