Tabnine Logo
MethodInfo.isTopLevelMethod
Code IndexAdd Tabnine to your IDE (free)

How to use
isTopLevelMethod
method
in
jodd.proxetta.MethodInfo

Best Java code snippets using jodd.proxetta.MethodInfo.isTopLevelMethod (Showing top 8 results out of 315)

origin: oblac/jodd

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isTopLevelMethod() &&
          methodInfo.isPublicMethod();
  }
}
origin: oblac/jodd

@Override
public boolean apply(MethodInfo methodInfo) {
  return methodInfo.isTopLevelMethod();
}
origin: oblac/jodd

@Override
public boolean apply(MethodInfo methodInfo) {
  return methodInfo.isTopLevelMethod();
}
origin: oblac/jodd

@Test
void testInterfaceWrapper() throws Exception {
  Calc calc = new CalcImpl();
  WrapperProxetta proxetta = Proxetta.wrapperProxetta().withAspect(new ProxyAspect(StatCounterAdvice.class, methodInfo -> methodInfo.isTopLevelMethod() && methodInfo.isPublicMethod()));
  //proxetta.setDebugFolder("/Users/igor");
  // wrapper over INTERFACE
  // resulting object has ONE interface
  // only interface methods are wrapped
  WrapperProxettaFactory builder = proxetta.proxy().setTarget(Calc.class).setTargetProxyClassName(".CalcImpl3");
  Class<Calc> calc2Class = builder.define();
  Calc calc2 = calc2Class.newInstance();
  builder.injectTargetIntoWrapper(calc, calc2);
  assertEquals(1, StatCounter.counter);    // counter in static block !!!
  calc2.hello();
  assertEquals(2, StatCounter.counter);
  assertEquals(10, calc2.calculate(3, 7));
  assertEquals(3, StatCounter.counter);
  try {
    calc2Class.getMethod("customMethod");
    fail("error");
  } catch (Exception ex) {
  }
}
origin: oblac/jodd

assertEquals("Ljava/lang/String;", mi.getArgument(1).getName());
assertTrue(mi.isTopLevelMethod());
origin: org.jodd/jodd-wot

/**
 * Returns <code>true</code> if method is a top-level method.
 */
public boolean isTopLevelMethod(MethodInfo methodInfo) {
  return methodInfo.isTopLevelMethod();
}
origin: org.jodd/jodd-proxetta

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isTopLevelMethod() &&
          methodInfo.isPublicMethod();
  }
}
origin: org.jodd/jodd-wot

  public boolean apply(MethodInfo methodInfo) {
    int argumentsCount = methodInfo.getArgumentsCount();
    char argumentType = 0;
    if (argumentsCount >= 1) {
      argumentType = methodInfo.getArgumentOpcodeType(1);
    }
    return
        methodInfo.getReturnOpcodeType() == 'V' &&				// void-returning method
        argumentType == 'I' &&									// first argument type
        methodInfo.isTopLevelMethod() &&						// top-level
        methodInfo.getMethodName().startsWith("set") &&			// set*
        (argumentsCount == 2 || argumentsCount == 3);			// number of arguments
  }
}));
jodd.proxettaMethodInfoisTopLevelMethod

Javadoc

Returns true if method is declared in top-level class.

Popular methods of MethodInfo

  • getArgumentsCount
    Returns number of method arguments.
  • getMethodName
    Returns method name.
  • getReturnType
    Returns return TypeInfo.
  • getArgument
    Returns methods argument (1-indexed).
  • isPublicMethod
    Returns true if method is public.
  • getAnnotations
    Returns annotation infos, if there is any.
  • getClassname
    Returns bytecode-like class name.
  • getDeclaredClassName
    Returns declared class name for inner methods or #getClassname() for top-level methods.
  • getSignature
    Returns java-like method signature.
  • getAccessFlags
    Returns methods access flags.
  • getClassInfo
    Returns target jodd.proxetta.ClassInfo.
  • getDescription
    Returns bytecode-like method description.
  • getClassInfo,
  • getDescription,
  • getExceptions,
  • getAllArgumentsSize,
  • getArgumentOffset,
  • hasAnnotation,
  • hasNoArguments,
  • hasOneArgument,
  • hasReturnValue

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Permission (java.security)
    Legacy security code; do not use.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JLabel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 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