Examples of InjectionException


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

  }
 
  protected EPackage resolveObjectLanguagePackage() throws SimTLException{
    String olS = findTemplateAnnotation().getDetails().get(ANNOTATION_OBJECT_LANGUAGE);
    if(olS==null){
      throw new InjectionException("No \"" + ANNOTATION_OBJECT_LANGUAGE + "\" annotation details at annotation " + ANNOTATION_TEMPLATE_CLASS);
    }
    URI objectLanguageURI = null;
    try{
      objectLanguageURI = URI.createURI(olS);
    } catch (Exception e){
View Full Code Here

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

  }
 
  protected Resource.Factory resolveTextResourceFactory() throws SimTLException{
    String olS = findTemplateAnnotation().getDetails().get(ANNOTATION_OBJECT_LANGUAGE_FACTORY);
    if(olS==null){
      throw new InjectionException("No \"" + ANNOTATION_OBJECT_LANGUAGE_FACTORY + "\" annotation details at annotation " + ANNOTATION_TEMPLATE_CLASS);
    }
    //FIXME use Eclipse class loader and remove dependency to object language
    Class<?> factoryClass=null;
    try {
      factoryClass = Class.forName(olS);
    } catch (ClassNotFoundException e) {
      throw new ValidationException("No such class found:"+ olS+". Please make this language available",e);
    }
    Object factoryO=null;
    try {
      factoryO = factoryClass.getConstructor().newInstance();
    } catch (Exception e){
      throw new InjectionException("Couldn't instantiate with empty constructor. Please make this language available",e);
    }
    if(!(factoryO instanceof Resource.Factory)){
      throw new InjectionException("Referenced class is no ResourceFactory: " + olS);
    }
    return (Resource.Factory)factoryO;
  }
View Full Code Here

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

  }
 
  protected String resolveObjectLanguageExtension() throws SimTLException{
    String olS = findTemplateAnnotation().getDetails().get(ANNOTATION_OBJECT_LANGUAGE_EXTENSION);
    if(olS==null){
      throw new InjectionException("No \"" + ANNOTATION_OBJECT_LANGUAGE_EXTENSION + "\" annotation details at annotation " + ANNOTATION_TEMPLATE_CLASS);
    }
    return olS;
  }
View Full Code Here

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

    log.debug("Unify attributes of " + Util.getFullName(iObject) + "("+iObject.eClass().getEAllAttributes().size()+")");
    for(EAttribute iAtt : iObject.eClass().getEAllAttributes()){
      log.debug("Unify attribute " + iAtt.getName());
      EAttribute tAtt = (EAttribute)tObject.eClass().getEStructuralFeature(iAtt.getName());
      if(tAtt==null){
        throw new InjectionException("tiObject has an eAttribute which doesn't exist in tObject: " + iAtt.getName()
            +". Size of attributeList in class of tObject: " +tObject.eClass().getEAttributes().size());
      }
     
      Object iAttO =iObject.eGet(iAtt);
      Object tAttO = tObject.eGet(tAtt);
View Full Code Here

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

   * @param tiObject The respective eObject in template instance corresponding to the <code>tObject</code>
   */
  private void evaluateTAttribute(EAttribute tAttributeClass, EObject tObject, EObject iObject) throws SimTLException{
    EAttribute iAttributeClass = (EAttribute)iObject.eClass().getEStructuralFeature(tAttributeClass.getName());
    if(iAttributeClass==null){
      throw new InjectionException("No tiAttributeClass found for tAttributeClass " + tObject.eClass().getName()+"."+tAttributeClass.getName());
    }
    //TODO validate that not both attribute and placeholder are set
   
    if(checkActualAttribute(tAttributeClass,iAttributeClass,tObject,iObject)){
      modelCorrespondence.add(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.