Package org.stjs.generator

Examples of org.stjs.generator.STJSRuntimeException


        String name = jarEntry.getName();
        addFileObject(jarUri, name, rootEntryName, rootEnd, result, recursive);
      }
    }
    catch (IOException e) {
      throw new STJSRuntimeException("Wasn't able to open " + packageFolderURL + " as a jar file", e);
    }
    return result;
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  private <T extends Tree> ContributorHolder<T> getHolder(Class<?> contributorClass) {
    Class<?> treeNodeClass = getTreeNodeClass(contributorClass);
    if (treeNodeClass == null) {
      throw new STJSRuntimeException("Cannot guess the tree node class from the contributor " + contributorClass + ". ");
    }
    ContributorHolder<T> holder = (ContributorHolder<T>) contributors.get(treeNodeClass);
    if (holder == null) {
      holder = new ContributorHolder<T>();
      contributors.put(treeNodeClass, holder);
View Full Code Here

    Enumeration<URL> configFiles;
    try {
      configFiles = Thread.currentThread().getContextClassLoader().getResources(STJS_PLUGINS_CONFIG_FILE);
    }
    catch (IOException e) {
      throw new STJSRuntimeException(e);
    }
    while (configFiles.hasMoreElements()) {
      loadConfigFile(configFiles.nextElement());
    }
  }
View Full Code Here

      for (Map.Entry<Object, Object> entry : props.entrySet()) {
        loadPlugin(entry.getKey().toString(), entry.getValue().toString());
      }
    }
    catch (IOException e) {
      throw new STJSRuntimeException(e);
    }

    finally {
      Closeables.closeQuietly(input);
    }
View Full Code Here

    STJSGenerationPlugin<JS> plugin;
    try {
      plugin = (STJSGenerationPlugin<JS>) Class.forName(value).newInstance();
    }
    catch (InstantiationException e) {
      throw new STJSRuntimeException(e);
    }
    catch (IllegalAccessException e) {
      throw new STJSRuntimeException(e);
    }
    catch (ClassNotFoundException e) {
      throw new STJSRuntimeException(e);
    }
    if (plugin.loadByDefault()) {
      plugin.contributeCheckVisitor(checkVisitor);
      plugin.contributeWriteVisitor(writerVisitor);
      mandatoryPlugins.put(key, plugin);
View Full Code Here

    newPlugins.writerVisitor = new WriterVisitor<JS>(writerVisitor);

    for (String pluginName : usePlugins.value()) {
      STJSGenerationPlugin<JS> plugin = optionalPlugins.get(pluginName);
      if (plugin == null) {
        throw new STJSRuntimeException("The class:" + clazz.getName() + " need an unknown Generation Plugin :" + pluginName);
      }
      plugin.contributeCheckVisitor(newPlugins.checkVisitor);
      plugin.contributeWriteVisitor(newPlugins.writerVisitor);
    }
    return newPlugins;
View Full Code Here

    }
    catch (IOException e) {
      // TODO : this is not really going to be working on all OS!
      if (e.getMessage().contains("Cannot run program")) {
        String errMsg = "Please install node.js to use this feature https://github.com/joyent/node/wiki/Installation";
        throw new STJSRuntimeException(errMsg, e);
      }
      throw new STJSRuntimeException(e);
    }
    catch (InterruptedException e) {
      throw new STJSRuntimeException(e);
    }
  }
View Full Code Here

  }

  private Class<?> primitiveClass(TypeMirror type) {
    Class<?> cls = PRIMITIVE_CLASSES.get(type.toString());
    if (cls == null) {
      throw new STJSRuntimeException("Cannot load class " + type);
    }
    return cls;
  }
View Full Code Here

TOP

Related Classes of org.stjs.generator.STJSRuntimeException

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.