Tabnine Logo
InvokeProxetta
Code IndexAdd Tabnine to your IDE (free)

How to use
InvokeProxetta
in
jodd.proxetta.impl

Best Java code snippets using jodd.proxetta.impl.InvokeProxetta (Showing top 14 results out of 315)

origin: oblac/jodd

/**
 * Creates a new instance of {@link InvokeProxetta}.
 */
public static InvokeProxetta invokeProxetta() {
  return new InvokeProxetta();
}
origin: oblac/jodd

/**
 * {@inheritDoc}
 */
@Override
protected WorkData process(final ClassReader cr, final TargetClassInfoReader targetClassInfoReader) {
  InvokeClassBuilder icb = new InvokeClassBuilder(
      destClassWriter,
      proxetta.getAspects(new InvokeAspect[0]),
      resolveClassNameSuffix(),
      requestedProxyClassName,
      targetClassInfoReader);
  cr.accept(icb, 0);
  return icb.getWorkData();
}
origin: oblac/jodd

@Test
void testCurrentTimeMillis() {
  TimeClass timeClass = (TimeClass) Proxetta.invokeProxetta().withAspects(new InvokeAspect() {
    @Override
    public boolean apply(MethodInfo methodInfo) {
      return methodInfo.isTopLevelMethod();
    }
    @Override
    public InvokeReplacer pointcut(InvokeInfo invokeInfo) {
      if (
          invokeInfo.getClassName().equals("java.lang.System") &&
          invokeInfo.getMethodName().equals("currentTimeMillis")
        ) {
        return InvokeReplacer.with(MySystem.class, "currentTimeMillis");
      }
      return null;
    }
  }).proxy().setTarget(TimeClass.class).newInstance();
  long time = timeClass.time();
  assertEquals(10823, time);
}
origin: oblac/jodd

@Test
void testWimp() {
  Wimp wimp = (Wimp) Proxetta.invokeProxetta().withAspect(new InvokeAspect() {
    @Override
    public boolean apply(MethodInfo methodInfo) {
      return methodInfo.isTopLevelMethod();
    }
    @Override
    public InvokeReplacer pointcut(InvokeInfo invokeInfo) {
      return InvokeReplacer.NONE;
    }
  }).proxy().setTarget(Wimp.class).newInstance();
  int i = wimp.foo();
  assertEquals(0, i);
  String txt = wimp.aaa(3, null, null);
  assertEquals("int3WelcomeToJodd", txt);
  txt = wimp.ccc(3, "XXX", 1, null);
  assertEquals(">4:String:4long:4XXX:ccc:Wimp", txt);
}
origin: oblac/jodd

@Test
void testInterface() {
  InvokeProxetta proxetta = initProxetta();
  try {
    proxetta.proxy().setTarget(Inter.class).newInstance();
    fail("error");
  } catch (ProxettaException ignore) {
  }
}
origin: org.jodd/jodd-wot

public InvokeProxettaBuilder builder(Class target) {
  InvokeProxettaBuilder builder = builder();
  builder.setTarget(target);
  return builder;
}
origin: oblac/jodd

protected InvokeProxetta initProxetta() {
  return Proxetta.invokeProxetta().withAspects(
    invokeInfo -> {
      if (invokeInfo.getMethodName().equals("invvirtual")) {
origin: oblac/jodd

@Test
void testSuper() {
  InvokeProxetta proxetta = initProxetta();
  try {
    proxetta.proxy().setTarget(OneWithSuper.class).define();
    fail("error");
  } catch (ProxettaException ignore) {
  }
}
origin: org.jodd/jodd-wot

public InvokeProxettaBuilder builder(Class target, String targetProxyClassName) {
  InvokeProxettaBuilder builder = builder();
  builder.setTarget(target);
  builder.setTargetProxyClassName(targetProxyClassName);
  return builder;
}
origin: org.jodd/jodd-wot

/**
 * Specifies invoke replacement aspects and creates this <code>Proxetta</code> instance.
 */
public static InvokeProxetta withAspects(InvokeAspect... aspects) {
  return new InvokeProxetta(aspects);
}
origin: org.jodd/jodd-wot

/**
 * {@inheritDoc}
 */
@Override
protected WorkData process(ClassReader cr, TargetClassInfoReader targetClassInfoReader) {
  InvokeClassBuilder icb = new InvokeClassBuilder(
      destClassWriter,
      invokeProxetta.getAspects(),
      resolveClassNameSuffix(),
      requestedProxyClassName,
      targetClassInfoReader);
  cr.accept(icb, 0);
  return icb.getWorkData();
}
origin: oblac/jodd

byte[] klazz = proxetta.proxy().setTarget(One.class).create();
origin: org.jodd/jodd-proxetta

/**
 * Creates a new instance of {@link InvokeProxetta}.
 */
public static InvokeProxetta invokeProxetta() {
  return new InvokeProxetta();
}
origin: org.jodd/jodd-proxetta

/**
 * {@inheritDoc}
 */
@Override
protected WorkData process(final ClassReader cr, final TargetClassInfoReader targetClassInfoReader) {
  InvokeClassBuilder icb = new InvokeClassBuilder(
      destClassWriter,
      proxetta.getAspects(new InvokeAspect[0]),
      resolveClassNameSuffix(),
      requestedProxyClassName,
      targetClassInfoReader);
  cr.accept(icb, 0);
  return icb.getWorkData();
}
jodd.proxetta.implInvokeProxetta

Javadoc

Proxetta that does method (i.e. invocation) replacements.

Most used methods

  • <init>
  • getAspects
  • builder
  • proxy
  • withAspect
  • withAspects
    Specifies invoke replacement aspects and creates this Proxetta instance.

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Join (org.hibernate.mapping)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now