Package org.nutz.aop

Examples of org.nutz.aop.ClassDefiner


    a1.returnObjectArray();
  }

  @Test
  public void testCreate2() throws Throwable {
    ClassDefiner cd = Nutzs.cd();

    Class<?> obj = classAgent.define(cd, Aop1.class);
    Class<?> obj2 = classAgent.define(cd, Aop1.class);
    assertEquals(obj, obj2);
  }
View Full Code Here


    ClassAgent ca = getNewClassAgent();
    ca.addInterceptor(MethodMatcherFactory.matcher(".*"), new MethodCounter(cc));
    ClassAgent ca2 = getNewClassAgent();
    ca2.addInterceptor(MethodMatcherFactory.matcher(".*"), new MethodCounter(cc));

    ClassDefiner cd = Nutzs.cd();

    Class<? extends Moose> c = ca.define(cd, Moose.class);
    Moose m = c.newInstance();
    m.doSomething(BEH.run);
    assertEquals("[2, 2, 0, 0]", Json.toJson(cc));
View Full Code Here

        a1.returnObjectArray();
    }

    @Test
    public void testCreate2() throws Throwable {
        ClassDefiner cd = Nutzs.cd();

        Class<?> obj = classAgent.define(cd, Aop1.class);
        Class<?> obj2 = classAgent.define(cd, Aop1.class);
        assertEquals(obj, obj2);
    }
View Full Code Here

        a1.returnObjectArray();
    }

    @Test
    public void testCreate2() throws Throwable {
        ClassDefiner cd = Nutzs.cd();

        Class<?> obj = classAgent.define(cd, Aop1.class);
        Class<?> obj2 = classAgent.define(cd, Aop1.class);
        assertEquals(obj, obj2);
    }
View Full Code Here

        ClassAgent ca = getNewClassAgent();
        ca.addInterceptor(MethodMatcherFactory.matcher(".*"), new MethodCounter(cc));
        ClassAgent ca2 = getNewClassAgent();
        ca2.addInterceptor(MethodMatcherFactory.matcher(".*"), new MethodCounter(cc));

        ClassDefiner cd = Nutzs.cd();

        Class<? extends Moose> c = ca.define(cd, Moose.class);
        Moose m = c.newInstance();
        m.doSomething(BEH.run);
        assertEquals("[2, 2, 0, 0]", Json.toJson(cc));
View Full Code Here

TOP

Related Classes of org.nutz.aop.ClassDefiner

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.