Examples of OCommandExecutorFunction


Examples of com.orientechnologies.orient.core.command.script.OCommandExecutorFunction

  public Object execute(final Object... iArgs) {
    return executeInContext(null, iArgs);
  }

  public Object executeInContext(final OCommandContext iContext, final Object... iArgs) {
    final OCommandExecutorFunction command = new OCommandExecutorFunction();
    command.parse(new OCommandFunction(getName()));

    final List<String> params = getParameters();

    // CONVERT PARAMETERS IN A MAP
    Map<Object, Object> args = null;

    if (iArgs.length > 0) {
      args = new LinkedHashMap<Object, Object>();
      for (int i = 0; i < iArgs.length; ++i) {
        // final Object argValue = ORecordSerializerStringAbstract.getTypeValue(iArgs[i].toString());
        final Object argValue = iArgs[i];

        if (params != null && i < params.size())
          args.put(params.get(i), argValue);
        else
          args.put("param" + i, argValue);
      }
    }

    return command.executeInContext(iContext, args);
  }
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.