Package net.amin.mobateg.helper.variables

Examples of net.amin.mobateg.helper.variables.TCGVariable


  private static void oclAtomConstraintVisitor(TCGOCLAtomImpl tcgOCLAtomConstraint){
   
    if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();
     
      TCGVariable toBeAdd = new TCGVariable();
      toBeAdd.setName(oProp.getName());
      toBeAdd.setType(typeOfVariable(oProp.getType()));
      toBeAdd.setIsParameter(false);
     
      if(!((PropertyCallExp)(tcgOCLAtomConstraint.getOclReference())).isMarkedPre()){
        //Add property     
        if(!propertyThatHasNotAtPre.contains(toBeAdd))
          propertyThatHasNotAtPre.add(toBeAdd);
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      Variable oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {       
        //add variable
        TCGVariable toBeAdd = new TCGVariable();
        if(oVar.getRepresentedParameter() != null && oVar.getRepresentedParameter().getDefaultValue() != null)
          toBeAdd.setInitialValue(oVar.getRepresentedParameter().getDefaultValue().stringValue());
        toBeAdd.setName(oVar.getName());
        toBeAdd.setType(typeOfVariable(oVar.getType()));
        toBeAdd.setIsParameter(true);
        if(toBeAdd.getType() != null && !propertyThatHasNotAtPre.contains(toBeAdd))
          propertyThatHasNotAtPre.add(toBeAdd);   
      }
    }
  }
View Full Code Here


    if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      Variable oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {       
        //add variable
        TCGVariable toBeAdd = new TCGVariable();
        if(oVar.getRepresentedParameter() != null && oVar.getRepresentedParameter().getDefaultValue() != null)
          toBeAdd.setInitialValue(oVar.getRepresentedParameter().getDefaultValue().stringValue());
        toBeAdd.setName(oVar.getName());
        toBeAdd.setType(typeOfVariable(oVar.getType()));
        toBeAdd.setIsParameter(true);
        if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
          AllVariables.add(toBeAdd);   
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();

      //Add property
      TCGVariable toBeAdd = new TCGVariable();
      if(oProp.getDefaultValue() != null)
        toBeAdd.setInitialValue(oProp.getDefaultValue().stringValue());
      toBeAdd.setName(oProp.getName());
      toBeAdd.setType(typeOfProperty(oProp.getType()));
      toBeAdd.setIsParameter(false);
      if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
        AllVariables.add(toBeAdd);
    }   
  }
View Full Code Here

TOP

Related Classes of net.amin.mobateg.helper.variables.TCGVariable

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.