Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom


    }

    @Test
    public void cvtConvertible_2() throws SignatureException {
        final Object x = "hej";
        final OtpErlangObject obj = new OtpErlangAtom("hej d�");
        final Object y = TypeConverter.erlang2java(obj, Cvt.class);
        assertTrue(x.equals(y));
    }
View Full Code Here


            return defaultValue;
        }

        public OtpErlangObject toTerm(final boolean currentValue) {
            if (currentValue) {
                return new OtpErlangAtom(getName());
            }
            return null;
        }
View Full Code Here

        }

        @Override
        public OtpErlangObject toTerm(final boolean currentValue) {
            if (currentValue) {
                return new OtpErlangAtom(getName());
            }
            return new OtpErlangAtom("no" + getName());
        }
View Full Code Here

            final int i = 0;
            for (final Pair<String, String> value : values) {
                final String key = value.getKey();
                final String val = value.getValue();

                final OtpErlangAtom tag = new OtpErlangAtom(getName());
                final OtpErlangAtom okey = new OtpErlangAtom(key);
                if (Strings.isNullOrEmpty(val)) {
                    defines[i] = OtpErlang.mkTuple(tag, okey);
                } else {
                    final OtpErlangObject ovalue = OtpErlang.getTermParser().parse(val);
                    defines[i] = OtpErlang.mkTuple(tag, okey, ovalue);
View Full Code Here

        }

        public OtpErlangObject toTerm(final Iterable<String> value) {
            final List<OtpErlangObject> result = Lists.newArrayList();
            for (final String path : value) {
                result.add(OtpErlang.mkTuple(new OtpErlangAtom(getName()),
                        new OtpErlangString(path)));
            }
            return OtpErlang.mkList(result);
        }
View Full Code Here

                final String tooltip) {
            super(name, description, tooltip);
        }

        public OtpErlangObject toTerm(final String value) {
            return OtpErlang.mkTuple(new OtpErlangAtom(getName()), new OtpErlangAtom(
                    value));
        }
View Full Code Here

        if (kind == Kinds.INCLUDES || kind == Kinds.INCLUDE_LIBS) {
            return "\"" + string + "\"";
        }
        if (kind == Kinds.MODULES) {
            final String string1 = string.substring(0, string.length() - 1);
            return new OtpErlangAtom(string1).toString() + ":";
        }
        return string;
    }
View Full Code Here

    @Override
    public OtpErlangObject getOtpDoc(final IOtpRpc b,
            final ErlangFunctionCall functionCall, final String stateDir) {
        OtpErlangObject res = null;
        final OtpErlangTuple input = new OtpErlangTuple(new OtpErlangObject[] {
                new OtpErlangAtom("external"),
                new OtpErlangAtom(functionCall.getModule()),
                new OtpErlangAtom(functionCall.getName()),
                new OtpErlangInt(functionCall.getArity()), new OtpErlangString("") });
        try {
            res = b.call(ERLIDE_OTP_DOC, "get_doc", "sxs", functionCall.getModule(),
                    input, stateDir);
        } catch (final RpcException e) {
View Full Code Here

    }

    private List<OtpErlangTuple> fixIndentPrefs(final Map<String, String> m) {
        final List<OtpErlangTuple> result = new ArrayList<OtpErlangTuple>(m.size());
        for (final Map.Entry<String, String> e : m.entrySet()) {
            final OtpErlangAtom a = new OtpErlangAtom(e.getKey());
            final String s = e.getValue();
            int n;
            if ("false".equals(s)) {
                n = 0;
            } else if ("true".equals(s)) {
View Full Code Here

            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                for (final OtpErlangObject i : l) {
                    if (i instanceof OtpErlangAtom) {
                        final OtpErlangAtom m = (OtpErlangAtom) i;
                        result.add(m.atomValue());
                    }
                }
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangAtom

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.