Package edu.cmu.cs.fusion.constraint

Examples of edu.cmu.cs.fusion.constraint.XMLContext


    try {
      if (resource instanceof IFile && resource.getFileExtension() != null && resource.getFileExtension().equals(FUSION_FILE)) {
        File file = resource.getLocation().toFile();
        Logger.getLogger(FusionAnalysis.FUSION_LOGGER).log(Level.WARNING, "Parsing Fusion file " + resource.getName());
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file);
        XMLContext context = createContext(file.getAbsolutePath(), doc);
        setChanged();
        notifyObservers(new Triple<IResource, Document, XMLContext>(resource, doc, context));
        return false;
      }
       
View Full Code Here


    }
    return true;
  }

  private XMLContext createContext(String absolutePath, Document doc) {
    XMLContext context = new XMLContext(absolutePath);
    NodeList imports = doc.getDocumentElement().getElementsByTagName(IMPORT);
    for (int ndx = 0; ndx < imports.getLength(); ndx++) {
      Element importElement = (Element) imports.item(ndx);
      context.addType(importElement.getAttribute(NAME));
    }
    return context;
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.constraint.XMLContext

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.