Esempio n. 1
0
  protected static void printAndInterpretTemplateLines(
      Collection<String> templateLines,
      boolean forcePrintHitHeader,
      boolean newLineBetweenHits,
      NodeOrRelationship entity,
      GraphDatabaseShellServer server,
      Session session,
      Output out)
      throws ShellException, RemoteException {
    if (templateLines.isEmpty() || forcePrintHitHeader) {
      out.println(getDisplayName(server, session, entity, true));
    }

    if (!templateLines.isEmpty()) {
      Map<String, Object> data = new HashMap<String, Object>();
      data.put("i", entity.getId());
      for (String command : templateLines) {
        String line = TextUtil.templateString(command, data);
        server.interpretLine(session.getId(), line, out);
      }
    }
    if (newLineBetweenHits) {
      out.println();
    }
  }