Package sg.edu.nus.comp.simTL.engine.tracing

Examples of sg.edu.nus.comp.simTL.engine.tracing.ReferenceFromParent


      EStructuralFeature newSFInSource = (EStructuralFeature)notification.getFeature();
      int position = notification.getPosition()==Notification.NO_INDEX
                ?Util.NO_POSITION
                :notification.getPosition();
     
      ReferenceFromParent referenceFromParent = null;
      if(newSFInSource instanceof EAttribute){
        referenceFromParent = new Reference2Attribute(source,(EAttribute)newSFInSource);
      } else {
        referenceFromParent = new Reference2Element(source,(EReference)newSFInSource, template);
      }
View Full Code Here


      log.debug("Removed element "+Util.getFullName(tChild)+" from element " + Util.getFullName(tParent));
//      checkWhetherAnIfBecameValidAgain(tParent,tObjectETLRC.getTraceLink().getStaticContext());
      return;
    }
    //Sometimes tObject is NOT parent of tChild! (for and if)
    ReferenceFromParent tChildParent2tChildRef = template.getParentFrom(tChild, tChildContext);
    EObject tChildParent = tChildParent2tChildRef.getParent();
    //FOR-LOOP
    if(TForLoop.isTForLoop(tChildParent)){
      TForLoop forLoop = new TForLoop(tChildParent, tChildContext, template);
      List<EObject> loopBody= template.getChildrenFrom(
          forLoop.getTElement(), forLoop.getOLReference(), tChildContext);
View Full Code Here

   * If methodStatement is indeed an unary operation
   */
  private void resolveEmbeddedMethodStatement(IContext context, ITemplate template) throws SimTLException{
    embeddedMethodStatement = new TMethodStatement(embeddedMethodStatementEO,context,template);
    //TODO since we have only negation no checks are needed
    ReferenceFromParent temp = embeddedMethodStatement.getReferenceFromParent();
    if(!(temp instanceof Reference2Attribute)){
      throw new ValidationException("Negation Operation only for referenced attributes!");
    }
    Reference2Attribute temp2 = (Reference2Attribute)temp;
    temp2.setNegateValue(!temp2.isNegateValue());
View Full Code Here

    if(TPlaceholder.isTPlaceholder(tObject)){
      return;
    } else if(TForLoop.isTForLoop(tObject)){
      log.debug("Evaluating loop");
      TForLoop loop = new TForLoop(tObject,currentContext,template);
      ReferenceFromParent pReferenceFromParent = loop.getSetToBeIterated().getReferenceFromParent();
      if(pReferenceFromParent instanceof Reference2Attribute){
        throw new ValidationException("For-loop references an attribute and no list of elements! " + Util.getFullName(loop.getTElement()));
      } else if(!((Reference2Element)pReferenceFromParent).getReferenceToChildren().isMany()){
        throw new ValidationException("For-loop doesn't reference a list of elements! " + Util.getFullName(loop.getTElement()));
      }
     
      List<?> parameterList = (List<?>)pReferenceFromParent.getReferencedValue();
      //FOR-LOOP
      for(Object o : parameterList){
//        if(!(o instanceof EObject)){
//          throw new ValidationException("For-loop methodCall ("+loop.getSetToBeIterated().toString()+") does not return a list of ModelElements but Attributes");
//        }
View Full Code Here

                iAttributeClass
              )
            )
          ));
    } else{
      ReferenceFromParent refFromParent =
        checkPlaceholder(tAttributeClass,iAttributeClass,tObject,iObject);
      if(refFromParent!=null){
        //HANDLE TRACELINK
        //1) importedModel - resultModel
        StaticContext staticContext = currentContext.saveToStaticContext();
        modelCorrespondence.add(
          new TraceLink(
            staticContext,
            new TraceLinkNode(
              getImportedModel(refFromParent.getParent().eResource()),
              (Reference2Attribute)refFromParent
            ),
            new TraceLinkNode(
              instance,
              new Reference2Attribute(
View Full Code Here

            return null;
          }
          EObject placeHolder = phList.iterator().next();
          //Check if is xframeElement and assume it to be a placeholder then
          TPlaceholder phe = new TPlaceholder(placeHolder,currentContext,template);
          ReferenceFromParent pReferenceFromParent = phe.getTMethodStatement().getReferenceFromParent();
         
          Object pValue = pReferenceFromParent.getReferencedValue();

          //FIXME Do some type checking!!

          if(pValue!=null){
            iObject.eSet(iAttributeClass, pValue);
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.tracing.ReferenceFromParent

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.