Package org.acmestudio.acme.core.resource

Examples of org.acmestudio.acme.core.resource.IAcmeResource


    StandaloneEnvironment.instance().useTypeChecker(
        TypeCheckerType.SYNCHRONOUS);
   
    System.setProperty("ACME_FAMILY_SEARCH_PATH", familyPath);

    IAcmeResource resource;
    File tmp = null;
   
    try {
      // There is a problem with AcmeLib: If does not
      // reload a file if it was loaded before, even if
      // it has changed after the first load.
      // The workaround is copying the file to a new
      // location everytime, loading it from there
      // and then deleting the copy.
      tmp = File.createTempFile("acmeTemp", ".acme");
      FileInputStream fis  = new FileInputStream(adlFilename);
        FileOutputStream fos = new FileOutputStream(tmp);
        byte[] buf = new byte[1024];
        int i = 0;
        while((i=fis.read(buf))!=-1) {
          fos.write(buf, 0, i);
          }
        fis.close();
        fos.close();
     
      resource = StandaloneResourceProvider.instance()
          .acmeResourceForString(tmp.getPath());
    } catch (Exception e) {
      throw new ArchMapperException(e);
    } finally {
      if (tmp != null) {
        tmp.delete();
      }
    }
   
    IAcmeModel model = resource.getModel();
    IAcmeSystem sys = model.getSystems().iterator().next();
   
    conf = new Configuration();
    conf.setName(sys.getName());
    if (sys.getDeclaredTypes().size() > 0) {
View Full Code Here

TOP

Related Classes of org.acmestudio.acme.core.resource.IAcmeResource

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.