private static void renderErlangString(OtpErlangString str, XValueTextRenderer renderer) { if (isPrintable(str)) { renderer.renderSpecialSymbol("'"); renderer.renderValue( str .stringValue() .replace("'", "\\'") ); renderer.renderSpecialSymbol("'"); } else { renderObject(new OtpErlangList(str.stringValue()), renderer); } }
public OtpErlangObject executeErlangRpc(String module, String function, OtpErlangObject... args) { return executeRpc(module, function, new OtpErlangList(args)); }
@Override public Object clone() { try { return new OtpErlangList(elements(), getLastTail()); } catch (final OtpErlangException e) { throw new AssertionError(this); } }
public OtpErlangObject toErlang(Object obj) throws ErlangConversionException { if (obj instanceof OtpErlangObject) { return (OtpErlangObject) obj; } if (obj instanceof Object[]) { Object[] objectsToConvert = (Object[]) obj; if (objectsToConvert.length != 0) { ArrayList<OtpErlangObject> tempList = new ArrayList<OtpErlangObject>(); for (Object objectToConvert : objectsToConvert) { OtpErlangObject erlangObject = convertBasicTypeToErlang(objectToConvert); tempList.add(erlangObject); } OtpErlangObject ia[] = new OtpErlangObject[tempList.size()]; return new OtpErlangList(tempList.toArray(ia)); } else { return new OtpErlangList(); } } else { return convertBasicTypeToErlang(obj); } }
/** * Send an RPC request to the remote Erlang node. This convenience function * creates the following message and sends it to 'rex' on the remote node: * * <pre> * { self, { call, Mod, Fun, Args, user } } * </pre> * * <p> * Note that this method has unpredicatble results if the remote node is not * an Erlang node. * </p> * * @param mod * the name of the Erlang module containing the function to be * called. * @param fun * the name of the function to call. * @param args * an array of Erlang terms, to be used as arguments to the * function. * * @exception java.io.IOException * if the connection is not active or a communication error * occurs. */ public void sendRPC(final String mod, final String fun, final OtpErlangObject[] args) throws IOException { sendRPC(mod, fun, new OtpErlangList(args)); }
return new OtpErlangList(this);
+ " **~n"); msgbody[2] = new OtpErlangList(); // empty list