Examples of Module


Examples of edu.harvard.hul.ois.jhove.Module

  public ToolOutput extractInfo(File file) throws FitsToolException {
    Document dom = null;
    try {
      dom = characterize(file);
      String jhoveModule = XmlUtils.getDomValue(dom,"reportingModule");
      Module mod = jhove.getModule(jhoveModule);
      dom = getFileInfo(file,mod);
    } catch (Exception e) {
      throw new FitsToolException("Jhove error while processing "+file.getName(),e);
    }
    catch (OutOfMemoryError e) {
View Full Code Here

Examples of edu.isi.stella.Module

    if (answer.nextP()) {
      // Here we take apart the first tuple, held in the "value" field
      // of the PLIterator instance.  Also, these interface functions
      // require the actual module object and not just its name.  So
      // we look that up and use it.
      Module mod = PLI.getModule(workingModule, null);
      Stella_Object instance = PLI.getNthValue(answer.value, 0, mod, null);
      String cname = PLI.getNthString(answer.value, 1, mod, null);
      int employees = PLI.getNthInteger(answer.value, 2, mod, null);
      System.out.println("Returns object " + instance
       + " with name \"" + cname
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Module

      }
    };

    System.out.println("=========== Parsing+Typechecking " + theory
        + " =============");
    Module world;
    try {
      world = CompUtil.parseEverything_fromFile(rep, null, theory);
      // Choose some default options for how you want to execute the
      // commands
      A4Options options = new A4Options();
      options.solver = A4Options.SatSolver.SAT4J;

      for (Command command : world.getAllCommands()) {
        // Execute the command
        System.out.println("============ Command " + command
            + ": ============");
        A4Solution ans = TranslateAlloyToKodkod.execute_command(rep,
            world.getAllReachableSigs(), command, options);
        // Print the outcome
        // System.out.println(ans);
        int cont = 1;
        long tempoAntes = System.currentTimeMillis();
View Full Code Here

Examples of etch.compiler.ast.Module

      else
        clo.lh.report( LogHandler.LEVEL_INFO, "Compiling..." );
     
      final EtchGrammar parser = new EtchGrammar( clo.backend, is );
       
        final Module m;
       
        // Parse .etch source
        try
        {
            m = parser.module( clo );
            clo.lh.report( LogHandler.LEVEL_INFO, "Parsed Ok." );
           
            m.check();
            clo.lh.report( LogHandler.LEVEL_INFO, "Checked Ok." );
        }
        catch ( ParseException e )
        {
            String fmt = e.getMessage();
View Full Code Here

Examples of fr.tm.elibel.smartqvt.qvt.qvtoperational.Module

        m.load();
        Iterator iter = m.getAllContents();
        while (iter.hasNext()) {
          EObject eobj = (EObject) iter.next();
          if (eobj instanceof Module) {
            Module module = (Module) eobj;
            result.add(module);
          }
        }
      } catch (Exception e) {
        logger.log(Level.SEVERE, "failed to read " + location, e);
View Full Code Here

Examples of gri.gridp.modules.Module

      elem.addContent(functionsElem);
    }
  }

  public Module readModule(Element element) throws IOException {
    Module module = new Module();

    String id = element.getAttributeValue("id");
    if (id != null)
      module.setId(id);

    List children = element.getChildren();
    for (int i = 0; i < children.size(); i++) {
      Element child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("info")) {
        ModuleInfo info = modInfoSerializer.readModuleInfo(child);
        if (info != null)
          module.setModuleInfo(info);
      }

      else if (name.equals("parameters")) {
        List parameters = paramSerializer.readList(child);
        for (int j = 0; j < parameters.size(); j++) {
          Parameter param = (Parameter)parameters.get(j);
          module.addParameter(param);
        }
      }

      else if (name.equals("outputs")) {
        List outputs = new ListSerializer(outputSerializer, "output").readList(child);
        for (int j=0; j<outputs.size(); j++)
          module.addOutput((Output)outputs.get(j));
      }

      else if (name.equals("functions")) {
        ListSerializer serializer = new ListSerializer(
            new FunctionSerializer(
                module.getParameterMap(), module.getOutputMap()),
        "function");
        List functions = serializer.readList(child);
        for (int functionIndex=0; functionIndex<functions.size(); functionIndex++) {
          Function function = (Function)functions.get(functionIndex);   
          module.addFunction(function);
        }
      }

      /*
      else if (name.equals("function")) {
    Function f = new FunctionSerializer(module.getParameterMap()).readFunction(elem);
    if (f != null)
        module.addFunction(f);
      }*/

    }

    //validate:
    if (module.getModuleInfo() == null)
      module.setModuleInfo(new ModuleInfo("unknown program"));

    //name functions:
    List functions = module.getFunctionList();
    Function func;
    for (int i=0; i<functions.size(); i++) {
      func = (Function)functions.get(i);
      if (func.getInfo().getTitle() == null) {
        String suffix = (i == 0) ?
            "" : " (" + String.valueOf(i+1) + ")";

        func.getInfo().setTitle(module.getModuleInfo().getTitle() + suffix);
      }
    }

    return module;
  }
View Full Code Here

Examples of ir.xweb.module.Module

    String api = request.getParameter("api");
        if(api == null) {
            throw new ServletException(Constants.SESSION_MANAGER + " parameter not found (please set module name)");
        }
   
    Module module = manager.getModule(api);
    if(module != null) {
            //logger.trace("Call module: " + module.getInfo().getName());

            try {
                XWebUser user = (XWebUser) request.getSession().getAttribute(Constants.SESSION_USER);

          module.process(getServletContext(), request, response, user == null ? null : user.getRole());
            } catch (ModuleException ex) {

                //int errorCode = ex.getErrorCode();
                int responseCode = ex.getReponseCode();

                if(responseCode == HttpServletResponse.SC_NOT_FOUND) {
                    logger.trace("Data not found. " +
                            "Module: " + module.getInfo().getName() +
                            " Code: " + ex.getErrorCode(), ex);
                } else if(module.redirectAuthFail() && responseCode == HttpServletResponse.SC_UNAUTHORIZED) {
                    // OK!
                    // When Authentication exception happen, we it be possible (module have this feature and
                    // redirect URL was available) we will redirect connection to authentication page

                    // TODO: Not support after modular Authentication
                    /*String redirect = manager.getProperty(Constants.AUTHENTICATION_REDIRECT);
                    if(redirect != null) {
                        String uri = request.getRequestURI().substring(request.getContextPath().length());

                        response.sendRedirect(getServletContext().getContextPath()
                                + redirect + "?url="
                                + getServletContext().getContextPath()
                                + URLEncoder.encode(uri + "?" + request.getQueryString(), "UTF-8"));

                        return;
                    }*/
                } else {
                    logger.error("Error in module process." +
                            " Module: " + module.getInfo().getName() +
                            " Code: " + ex.getErrorCode(), ex);
                }

                if(!response.isCommitted()) {
                    response.addHeader("xweb-error-code", Integer.toString(ex.getErrorCode()));
                    response.sendError(
                            responseCode > 0 ? responseCode: HttpServletResponse.SC_BAD_REQUEST,
                            "Error in module: " + api + " Cause: " + ex.getMessage());
                }
            } catch (Exception ex) {
                logger.error("Error in module process. Module: "
                      + module.getInfo().getName()
                    + " : " + ex.getMessage(), ex);
                response.sendError(HttpServletResponse.SC_BAD_REQUEST,
                        "Error in module: " + api + " Cause: " + ex.getMessage());
            }
    } else {
View Full Code Here

Examples of model.Module

    // creation de l'UV
    UV RechercheOperationnelle = new UV("Recherche Operetionnelle", 0, 14);
    // ------------------------------------------------------------------
    // construction des modules
    int nbModules = 2;
    Module complexite = new Module("Complexite");
    Module graphes = new Module("Graphes");
    // --------------------------------------- on a 2 module differents
    // construction des creneaux libres
    IntegerVariable cls1 = new IntegerVariable("debut 1", 0, 0);
    IntegerVariable clf1 = new IntegerVariable("fin 1", 3, 3);
    IntegerVariable cld1 = new IntegerVariable("duree 1", 3, 3);
View Full Code Here

Examples of models.Module

            result = badRequest(moduleRegistrationForm.render(user,
                                                              form));
        }
        else
        {
            Module module = form.get();
            module.owner = user;
            module.rating = new Rating(true);
            module.save();

            createHistoricalEvent("New module - " + module.name,
                                  String.format("%s (%s) created a new module - %s",
                                                user.displayName,
                                                user.userName,
View Full Code Here

Examples of net.hasor.core.Module

public class UserControllerTest {
    @Test
    public void userControllerTest() throws Throwable {
        System.out.println("--->>userControllerTest<<--");
        //1.创建一个标准的 Hasor 容器。
        AppContext appContext = Hasor.createAppContext(new Module() {
            public void loadModule(ApiBinder apiBinder) throws Throwable {
                /*绑定一个接口的实现类*/
                apiBinder.installModule(new ControllerModule());
            }
        });
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.