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

How to use
isPublicMethod
method
in
jodd.proxetta.MethodInfo

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

origin: oblac/jodd

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

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

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isPublicMethod()
        && methodInfo.matchMethodName("set*")
        && methodInfo.hasOneArgument()
        ;
  }
}
origin: oblac/jodd

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isPublicMethod()
        && methodInfo.hasReturnValue()
        && (methodInfo.matchMethodName("get*") || (methodInfo.matchMethodName("is*")))
        && methodInfo.hasNoArguments()
        ;
  }
}
origin: oblac/jodd

  @Override
  public boolean apply(final MethodInfo methodInfo) {

    if (methodInfo.hasReturnValue()
        && (methodInfo.matchMethodName("get*") || (methodInfo.matchMethodName("is*")))
        && methodInfo.hasNoArguments()) {
      // getter
      return false;
    }

    if (methodInfo.matchMethodName("set*")
        && methodInfo.hasOneArgument()) {
      // setter
      return false;
    }

    return methodInfo.isPublicMethod();
  }
}
origin: oblac/jodd

/**
 * Returns {@link WrapperProxetta} used for building loggable prepared statements.
 * Initializes proxetta when called for the first time.
 */
protected BaseLoggableFactory(final Class<T> targetClass) {
  this.targetClass = targetClass;
  this.proxetta = Proxetta.wrapperProxetta().withAspect(ProxyAspect.of(LoggableAdvice.class, methodInfo -> {
    int argumentsCount = methodInfo.getArgumentsCount();
    char argumentType = 0;
    if (argumentsCount >= 1) {
      argumentType = methodInfo.getArgument(1).getOpcode();
    }
    return
      methodInfo.getReturnType().getOpcode() == 'V' &&			// void-returning method
        argumentType == 'I' &&									// first argument type
        methodInfo.isPublicMethod() &&
        methodInfo.getMethodName().startsWith("set") &&			// set*
        (argumentsCount == 2 || argumentsCount == 3);			// number of arguments
  }));
}
origin: oblac/jodd

Calc calc = new CalcImpl();
WrapperProxetta proxetta = Proxetta.wrapperProxetta().withAspects(new ProxyAspect(StatCounterAdvice.class, methodInfo -> !methodInfo.isRootMethod() && methodInfo.isPublicMethod()));
origin: oblac/jodd

@Test
void testClassWrapperCastToInterface() throws Exception {
  Calc calc = new CalcImpl();
  WrapperProxetta proxetta = Proxetta.wrapperProxetta().withAspect(new ProxyAspect(StatCounterAdvice.class, methodInfo -> !methodInfo.isRootMethod() && methodInfo.isPublicMethod()));
  //proxetta.setDebugFolder("/Users/igor");
  // wrapper over CLASS casted to interface,
  // resulting object has ONE interface
  // ALL target methods are wrapped
  WrapperProxettaFactory builder = proxetta.proxy().setTarget(calc.getClass()).setTargetInterface(Calc.class).setTargetProxyClassName(".CalcImpl2");
  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);
  assertNotNull(calc2Class.getMethod("customMethod"));
}
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

WrapperProxetta proxetta = Proxetta.wrapperProxetta().withAspect(new ProxyAspect(StatCounterAdvice.class, methodInfo -> methodInfo.isPublicMethod() &&
    (methodInfo.getMethodName().equals("hello") || methodInfo.getMethodName().equals("ola"))));
origin: org.jodd/jodd-proxetta

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

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

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isPublicMethod()
        && methodInfo.matchMethodName("set*")
        && methodInfo.hasOneArgument()
        ;
  }
}
origin: org.jodd/jodd-proxetta

  @Override
  public boolean apply(final MethodInfo methodInfo) {
    return
        methodInfo.isPublicMethod()
        && methodInfo.hasReturnValue()
        && (methodInfo.matchMethodName("get*") || (methodInfo.matchMethodName("is*")))
        && methodInfo.hasNoArguments()
        ;
  }
}
origin: org.jodd/jodd-proxetta

  @Override
  public boolean apply(final MethodInfo methodInfo) {

    if (methodInfo.hasReturnValue()
        && (methodInfo.matchMethodName("get*") || (methodInfo.matchMethodName("is*")))
        && methodInfo.hasNoArguments()) {
      // getter
      return false;
    }

    if (methodInfo.matchMethodName("set*")
        && methodInfo.hasOneArgument()) {
      // setter
      return false;
    }

    return methodInfo.isPublicMethod();
  }
}
origin: org.jodd/jodd-db

/**
 * Returns {@link WrapperProxetta} used for building loggable prepared statements.
 * Initializes proxetta when called for the first time.
 */
protected BaseLoggableFactory(final Class<T> targetClass) {
  this.targetClass = targetClass;
  this.proxetta = Proxetta.wrapperProxetta().withAspect(ProxyAspect.of(LoggableAdvice.class, methodInfo -> {
    int argumentsCount = methodInfo.getArgumentsCount();
    char argumentType = 0;
    if (argumentsCount >= 1) {
      argumentType = methodInfo.getArgument(1).getOpcode();
    }
    return
      methodInfo.getReturnType().getOpcode() == 'V' &&			// void-returning method
        argumentType == 'I' &&									// first argument type
        methodInfo.isPublicMethod() &&
        methodInfo.getMethodName().startsWith("set") &&			// set*
        (argumentsCount == 2 || argumentsCount == 3);			// number of arguments
  }));
}
jodd.proxettaMethodInfoisPublicMethod

Javadoc

Returns true if method is public.

Popular methods of MethodInfo

  • getArgumentsCount
    Returns number of method arguments.
  • getMethodName
    Returns method name.
  • getReturnType
    Returns return TypeInfo.
  • getArgument
    Returns methods argument (1-indexed).
  • 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.
  • isTopLevelMethod
    Returns true if method is declared in top-level class.
  • 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

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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