Package edu.cmu.cs.fusion

Examples of edu.cmu.cs.fusion.FusionTypeCheckException


        result = processRelationshipResults(queryResult, types);
        deltas.add(result);
      }
     
    } catch (XQException e) {
      throw new FusionTypeCheckException(context.getFullyQualifiedName(), file, e);
    } catch (JavaModelException e) {
      throw new FusionTypeCheckException(context.getFullyQualifiedName(), file, e);
    } catch (XPathException e) {
      throw new FusionTypeCheckException(context.getFullyQualifiedName(), file, e);
    }
    return !deltas.isEmpty() ? RelationshipDelta.joinAlt(deltas) : new RelationshipDelta();
  }
View Full Code Here


      exp.bindString(new QName(DOC), file.getAbsolutePath().replace('\\', '/'), null);
       
      XQResultSequence queryResult = exp.executeQuery();
      return processBindingResults(queryResult);
    } catch (XQException e) {
      throw new FusionTypeCheckException(e);
    } catch (XPathException e) {
      throw new FusionTypeCheckException(e);
    }
  }
View Full Code Here

    while (results.next()) {
      Element relElement = (Element) results.getObject();
      String relName = relElement.getAttribute("name");
      Effect effect = Effect.valueOf(relElement.getAttribute("effect"));
      if (effect == null || effect == Effect.TEST)
        throw new FusionTypeCheckException(effect);
     
      relName = Utilities.resolveType(context, relName);
      Relation relType = relEnv.findRelation(relName);
      if (relType == null)
        throw new FusionTypeCheckException(relName);
     
      ObjectLabel[] labArr = getLabels(relElement, relType, types);
      Relationship rel = new Relationship(relType, labArr);
     
      delta.setRelationship(rel, effect == Effect.ADD ? SevenPointLattice.TRU : SevenPointLattice.FAL);
View Full Code Here

  private ObjectLabel[] getLabels(Element relElement, Relation relation, TypeHierarchy types) throws FusionTypeCheckException {
    NodeList nodes = relElement.getElementsByTagName("Object");
    String[] relTypes = relation.getFullyQualifiedTypes();
   
    if (relTypes.length != nodes.getLength())
      throw new FusionTypeCheckException(relation, relTypes.length, nodes.getLength());
    ObjectLabel[] labels = new ObjectLabel[relTypes.length];
   
    for (int ndx = 0; ndx < nodes.getLength(); ndx++) {
      Element node = (Element) nodes.item(ndx);
      String name = node.getAttribute("name");
      String type = node.getAttribute("type");
      labels[ndx] = createLabel(name, type);
     
      if (!(types.isSubtypeCompatible(type, relTypes[ndx])))
        throw new FusionTypeCheckException(relation, ndx, type, name);
    }
    return labels;
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.FusionTypeCheckException

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.