Codota Logo
MethodInfo.isPublicMethod
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
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

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now