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

Examples of sg.edu.nus.comp.simTL.engine.exceptions.ValidationException


    } 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){
View Full Code Here


      }
      try{
        //TODO if this is an EObject in template, this is not allowed!
        parent.eSet(eReference, referencedElement);
      } catch (Exception e){
        throw new ValidationException(
            "Couldn't set reference "
            +eReference==null?"<!noReferenceName!>":eReference.getName()
            + " in "
            +parent==null?"<!noEobjectSet!>":parent.eClass().getName()
            +". Expected type is "
            + eReference==null?"<!noReferenceName!>":
              eReference.getEType()==null?"<!noReferenceType!>":eReference.getEType().getName()
            + " but have "
            + referencedElement==null?"null":referencedElement.eClass().getName(),e);
      }
      set=true;
    } else {
      try{
        referencedList.add(referencedElement);
      } catch(Exception e){
        throw new ValidationException(
          "Couldn't add to reference " + referencedList.toString(),e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.exceptions.ValidationException

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.