Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Parameter


      parentProfile = Activator.getSysMLProfile();
    } else if (profileQualifiedName.startsWith("Standard")) {
      parentProfile = Activator.getStandardProfile();
    }

    Package profilePackage = parentProfile;

    final String[] profiles = profileQualifiedName.split(":{2}");
    // search the profile in the package hierarchy
    for (int index = 1; index < profiles.length - 1; index++) {
      profilePackage = profilePackage.getNestedPackage(profiles[index]);
    }

    Profile profile = (Profile)profilePackage;

    if (profileQualifiedName.startsWith("SysML")) {
      profile = (Profile)profilePackage.getNestedPackage(profiles[profiles.length - 1]);
    }

    if (profile == null) {
      final String message = "Can't apply the profile " + profileQualifiedName + " on "
          + p.getQualifiedName();
View Full Code Here


   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Parameter(Parameter newBase_Parameter) {
    Parameter oldBase_Parameter = base_Parameter;
    base_Parameter = newBase_Parameter;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ActivitiesPackage.RATE__BASE_PARAMETER, oldBase_Parameter, base_Parameter));
  }
View Full Code Here

   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Parameter(Parameter newBase_Parameter) {
    Parameter oldBase_Parameter = base_Parameter;
    base_Parameter = newBase_Parameter;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ActivitiesPackage.OPTIONAL__BASE_PARAMETER, oldBase_Parameter, base_Parameter));
  }
View Full Code Here

        OCLFactory oclFactory = parent.getOCLFactory();
        UMLReflection<Package, Classifier, Operation, Property, EnumerationLiteral, Parameter, State, CallOperationAction, SendSignalAction, Constraint> uml = parent
            .getUMLReflection();
        Variable<Classifier, Parameter> var = oclFactory
            .createVariable();
        Parameter next = operation.getReturnResult();
        uml.setName(var, uml.getName(next));
        uml.setType(var,
            TypeUtil.resolveType(result, uml.getOCLType(next)));
        var.setRepresentedParameter((Parameter) next);
View Full Code Here

    List<Integer> colSearchedIndices = new ArrayList<Integer>();
    // for each operation parameter there is one of the same name and type
    OUTER : for(int i = 0; i < in_oOperation1.getOwnedParameters().size(); ++i) {
      for(int j = 0; j < in_oOperation1.getOwnedParameters().size(); ++j) {
        if(!colSearchedIndices.contains(j)) {
          Parameter oParam1 = in_oOperation1.getOwnedParameters().get(i);
          Parameter oParam2 = in_oOperation2.getOwnedParameters().get(j);
          if(oParam1.getName().equals(oParam2.getName()) &&
              oParam1.getType().equals(oParam2.getType())) {
            colSearchedIndices.add(j);
            continue OUTER;
          }
        }
      }
View Full Code Here

//    if(in_oParameter.getReference().equals(in_oReference))
//      return in_oParameter;
    if(in_oReference instanceof TCGOCLAtom) {
      TCGOCLAtom oReferenceAtom = (TCGOCLAtom)in_oReference;
      EObject oReferenceAtomReference = oReferenceAtom.getElement();
      Parameter oReferencedParameter = null;
      if(oReferenceAtomReference instanceof org.eclipse.ocl.uml.Variable) {
        oReferencedParameter = ((org.eclipse.ocl.uml.Variable)oReferenceAtomReference).getRepresentedParameter();
      }
      if(oReferenceAtomReference instanceof org.eclipse.uml2.uml.Property) {
        // nothing
      }
      TCGTransition oTraversedTransition = in_oTransitionInstance.getTransition();
      List<Parameter> colMatchedEventParameters = new ArrayList<Parameter>();
      colMatchedEventParameters.add(oReferencedParameter);
      if(oTraversedTransition != null) {
        colMatchedEventParameters.addAll(
          TCGEventHelperClass.getEventParameters(oReferencedParameter, oTraversedTransition));
      }       
      if(colMatchedEventParameters.contains(in_oParameter.getReference()))
        return in_oParameter;
//        TCGEventHelperClass.getMapExprParamToEventParam().get(oReferencedParameter);
//      if((oMatchedEventParameter != null &&
//          in_oParameter.getReference().equals(oMatchedEventParameter)) ||
//          (oReferencedParameter != null &&
//          in_oParameter.getReference().equals(oReferencedParameter)))
//        return in_oParameter;
    }
    else if(in_oParameter instanceof TCGComplexParameter) {
      TCGComplexParameter oComplexParameter = (TCGComplexParameter)in_oParameter;
      for(TCGParameter oSubParameter : oComplexParameter.getParameter())
      {
        TCGParameter oFoundParameter = findParameterElementMatchingToReference(
            oSubParameter, in_oTransitionInstance, in_oReference);
        if(oFoundParameter != null)
          return oFoundParameter;
      }
    }
    else {
      if(in_oReference instanceof Parameter) {
        Parameter oReferencedParameter = (Parameter)in_oReference;
        TCGTransition oTraversedTransition = in_oTransitionInstance.getTransition();
        List<Parameter> colMatchedEventParameters = new ArrayList<Parameter>();
        colMatchedEventParameters.add(oReferencedParameter);
        if(oTraversedTransition != null) {
          colMatchedEventParameters.addAll(
View Full Code Here

      TCGEvent in_oEvent,
      TCGTransition in_oTransition) {
   
    if(in_oOperation != null) {
      for(TCGParameter oEventParameter : in_oEvent.getParameters()) {
        Parameter oEffectParameter =
          getMatchingParameter(oEventParameter, in_oOperation);
        // get map from transitions to event parameters
        Map<TCGTransition, List<Parameter>> colTransitionToParameterMap =
          getMapParamTransitionMapToEventParameterList().get(oEffectParameter);
        if(colTransitionToParameterMap == null) {
          colTransitionToParameterMap = new HashMap<TCGTransition, List<Parameter>>();
          getMapParamTransitionMapToEventParameterList().put(
              oEffectParameter, colTransitionToParameterMap);
        }
        // list of event parameters
        List<Parameter> colParameters =
          colTransitionToParameterMap.get(in_oTransition);
        if(colParameters == null) {
          colParameters = new ArrayList<Parameter>();
          colTransitionToParameterMap.put(in_oTransition, colParameters);
        }
        Parameter oReferencedParameter = (Parameter)oEventParameter.getReference();
        colParameters.add(oReferencedParameter);
//        getMapExprParamToEventParam().put(oEffectParameter, oEventParameter);
      }
    }
  }
View Full Code Here

        Property oProperty = (Property)oObject;
        if(TypeNameHelperClass.isBooleanTypeName(oProperty.getType().getName()))
          return true;
      }
      else if(oObject instanceof Parameter) {
        Parameter oParam = (Parameter)oObject;
        if(TypeNameHelperClass.isBooleanTypeName(oParam.getType().getName()))
          return true;
      }
    }
    return false;
  }
View Full Code Here

    Operation operation = mock(Operation.class,
        Answers.RETURNS_DEEP_STUBS.get());
    EList<Parameter> params = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Parameter> paramIterator = mock(Iterator.class);
    Parameter parameter = mock(Parameter.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Type type = mock(Type.class, Answers.RETURNS_DEEP_STUBS.get());

    Map<String, String> types = new HashMap<String, String>();
    types.put("umlTypeName", "Collection<de::test::Company>");
    types.put("umlQualifiedTypeName",
        "Data::datatype::Collection<de::test::Company>");

    when(operation.getOwnedParameters()).thenReturn(params);
    when(params.iterator()).thenReturn(paramIterator);
    when(paramIterator.hasNext()).thenReturn(true, false);
    when(paramIterator.next()).thenReturn(parameter);
    when(parameter.getDirection()).thenReturn(
        ParameterDirectionKind.get(ParameterDirectionKind.IN));
    when(parameter.getType()).thenReturn(type);
    when(parameter.getName()).thenReturn("companies");
    when(type.getName()).thenReturn("Collection<Company>");
    when(type.getQualifiedName()).thenReturn(
        "Data::datatype::Collection<Company>");
    when(dataTypeUtils.isParameterizedType(Mockito.anyString()))
        .thenReturn(true);
View Full Code Here

    Operation operation = mock(Operation.class,
        Answers.RETURNS_DEEP_STUBS.get());
    EList<Parameter> parameters = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Parameter> paramIterator = mock(Iterator.class);
    Parameter parameter = mock(Parameter.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Type type = mock(Type.class, Answers.RETURNS_DEEP_STUBS.get());

    when(operation.getOwnedParameters()).thenReturn(parameters);
    when(parameters.iterator()).thenReturn(paramIterator);
    when(paramIterator.hasNext()).thenReturn(true, false);
    when(paramIterator.next()).thenReturn(parameter);
    when(parameter.getDirection()).thenReturn(
        ParameterDirectionKind.IN_LITERAL);
    when(parameter.getType()).thenReturn(type);
    when(parameter.getName()).thenReturn("person");
    when(parameter.getUpper()).thenReturn(0);
    when(type.getName()).thenReturn("Person");
    when(type.getQualifiedName()).thenReturn("de.component.Person");

    interfaceGenerator.generateMethodParams(ast, td, operation, md);
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.