Examples of ToStringOption


Examples of org.rythmengine.toString.ToStringOption

            skips.add(fn);
            return true;
        }

        int mod = f.getModifiers();
        ToStringOption op = meta.option;
        if (!op.appendTransient && Modifier.isTransient(mod) || !op.appendStatic && Modifier.isStatic(mod)) {
            skips.add(fn);
            return true;
        }
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

            skips.add(fn);
            return true;
        }

        int mod = m.getModifiers();
        ToStringOption op = meta.option;
        if (!op.appendTransient && Modifier.isTransient(mod) || !op.appendStatic && Modifier.isStatic(mod)) {
            skips.add(fn);
            return true;
        }
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

    }

    private List<String> tokenList = new ArrayList<String>();

    private void appendFieldsIn(Class<?> c) {
        ToStringOption o = meta.option;
        Field[] fa = c.getDeclaredFields();
        for (Field f : fa) {
            String fn = f.getName();
            if (!tokenList.contains(fn)) tokenList.add(fn);
            if (shouldSkip(f)) {
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

            expressions.put(fn, fn);
        }
    }

    private void appendMethodsIn(Class<?> c) {
        ToStringOption o = meta.option;
        Method[] ma = c.getDeclaredMethods();
        for (Method m : ma) {
            String mn = m.getName();
            if ("getClass".equals(mn)) continue;
            String fn = null;
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

        }
    }

    private void parse() {
        Class<?> c = meta.clazz;
        ToStringOption o = meta.option;
        addBuilder(new AppendStartToken(this));
        this.appendIn(c);
        while (c.getSuperclass() != null && c != o.upToClass) {
            c = c.getSuperclass();
            this.appendIn(c);
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

            c = engine.classLoader().loadClass(cs);
        } catch (ClassNotFoundException e) {
            throw new IllegalArgumentException("Class not found: " + cs);
        }

        ToStringOption o = ToStringOption.valueOf(os);
        ToStringStyle st = ToStringStyle.valueOf(ss);
        return new AutoToStringData(c, o, st);
    }
View Full Code Here

Examples of org.rythmengine.toString.ToStringOption

        String s = data.toString();
        assertContains(s, "[foo=bar,bar=5]");
        assertContains(s, "org.rythmengine.advanced.to_string.ToStringTest$Data");
       
        // test with output transient and static fields
        s = Rythm.toString(data, new ToStringOption(true, true), null);
        assertContains(s, "[foo=bar,bar=5,tFoo=bar,sBar=0]");
       
        // test with multi-line style
        s = data.toString(ToStringStyle.MULTI_LINE_STYLE);
        assertMatches(s, ".*foo=bar\\s+bar=5.*");
 
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.