Codota Logo
Method.isSynthetic
Code IndexAdd Codota to your IDE (free)

How to use
isSynthetic
method
in
java.lang.reflect.Method

Best Java code snippets using java.lang.reflect.Method.isSynthetic (Showing top 20 results out of 3,123)

  • Common ways to obtain Method
private void myMethod () {
Method m =
  • Codota IconClass clazz;clazz.getMethod("<changeme>")
  • Codota IconClass clazz;String name;Class[] parameterTypes;clazz.getMethod(name, parameterTypes)
  • Codota IconPropertyDescriptor pd;pd.getReadMethod()
  • Smart code suggestions by Codota
}
origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public boolean isSynthetic() {
  return method.isSynthetic();
}
origin: google/guava

private static boolean isEqualsDefined(Class<?> cls) {
 try {
  return !cls.getDeclaredMethod("equals", Object.class).isSynthetic();
 } catch (NoSuchMethodException e) {
  return false;
 }
}
origin: killbill/killbill

@Override
public boolean matches(final Method method) {
  return method.isSynthetic();
}
origin: spring-projects/spring-loaded

public boolean callMethodIsSynthetic(Method m) {
  return m.isSynthetic();
}
origin: junit-team/junit4

private static boolean isMatchesSafelyMethod(Method method) {
  return "matchesSafely".equals(method.getName())
      && method.getParameterTypes().length == 1
      && !method.isSynthetic();
}
origin: prestodb/presto

private boolean _isIncludableMemberMethod(Method m)
{
  if (Modifier.isStatic(m.getModifiers())
      // Looks like generics can introduce hidden bridge and/or synthetic methods.
      // I don't think we want to consider those...
      || m.isSynthetic() || m.isBridge()) {
    return false;
  }
  // also, for now we have no use for methods with more than 2 arguments:
  // (2 argument methods for "any setter", fwtw)
  int pcount = m.getParameterTypes().length;
  return (pcount <= 2);
}
origin: google/j2objc

/**
 * @param method The method to examine.
 * @return true if this method references the relevant type
 */
protected boolean canObtainExpectedTypeFrom(Method method) {
  return method.getName().equals(methodName)
      && method.getParameterTypes().length == expectedNumberOfParameters
      && !method.isSynthetic();
}
origin: google/j2objc

private static boolean isMatchesSafelyMethod(Method method) {
  return method.getName().equals("matchesSafely")
      && method.getParameterTypes().length == 1
      && !method.isSynthetic();
}
origin: redisson/redisson

private boolean _isIncludableMemberMethod(Method m)
{
  if (Modifier.isStatic(m.getModifiers())
      // Looks like generics can introduce hidden bridge and/or synthetic methods.
      // I don't think we want to consider those...
      || m.isSynthetic() || m.isBridge()) {
    return false;
  }
  // also, for now we have no use for methods with more than 2 arguments:
  // (2 argument methods for "any setter", fwtw)
  int pcount = m.getParameterTypes().length;
  return (pcount <= 2);
}
origin: spring-projects/spring-framework

/**
 * Determine whether the given method is declared by the user or at least pointing to
 * a user-declared method.
 * <p>Checks {@link Method#isSynthetic()} (for implementation methods) as well as the
 * {@code GroovyObject} interface (for interface methods; on an implementation class,
 * implementations of the {@code GroovyObject} methods will be marked as synthetic anyway).
 * Note that, despite being synthetic, bridge methods ({@link Method#isBridge()}) are considered
 * as user-level methods since they are eventually pointing to a user-declared generic method.
 * @param method the method to check
 * @return {@code true} if the method can be considered as user-declared; [@code false} otherwise
 */
public static boolean isUserLevelMethod(Method method) {
  Assert.notNull(method, "Method must not be null");
  return (method.isBridge() || (!method.isSynthetic() && !isGroovyObjectMethod(method)));
}
origin: org.hamcrest/hamcrest-all

/**
 * @param method The method to examine.
 * @return true if this method references the relevant type
 */
protected boolean canObtainExpectedTypeFrom(Method method) {
  return method.getName().equals(methodName)
      && method.getParameterTypes().length == expectedNumberOfParameters
      && !method.isSynthetic();
}
origin: Atmosphere/atmosphere

public final static Set<Method> getInheritedPrivateMethod(Class<?> type) {
  Set<Method> result = new HashSet<>();
  Class<?> i = type;
  while (i != null && i != Object.class) {
    for (Method m : i.getDeclaredMethods()) {
      if (!m.isSynthetic()) {
        result.add(m);
      }
    }
    i = i.getSuperclass();
  }
  return result;
}
origin: hamcrest/JavaHamcrest

/**
 * @param method The method to examine.
 * @return true if this method references the relevant type
 */
private boolean canObtainExpectedTypeFrom(Method method) {
  return method.getName().equals(methodName)
      && method.getParameterTypes().length == expectedNumberOfParameters
      && !method.isSynthetic();
}
origin: google/guava

private static ImmutableList<Method> getAnnotatedMethodsNotCached(Class<?> clazz) {
 Set<? extends Class<?>> supertypes = TypeToken.of(clazz).getTypes().rawTypes();
 Map<MethodIdentifier, Method> identifiers = Maps.newHashMap();
 for (Class<?> supertype : supertypes) {
  for (Method method : supertype.getDeclaredMethods()) {
   if (method.isAnnotationPresent(Subscribe.class) && !method.isSynthetic()) {
    // TODO(cgdecker): Should check for a generic parameter type and error out
    Class<?>[] parameterTypes = method.getParameterTypes();
    checkArgument(
      parameterTypes.length == 1,
      "Method %s has @Subscribe annotation but has %s parameters."
        + "Subscriber methods must have exactly 1 parameter.",
      method,
      parameterTypes.length);
    MethodIdentifier ident = new MethodIdentifier(method);
    if (!identifiers.containsKey(ident)) {
     identifiers.put(ident, method);
    }
   }
  }
 }
 return ImmutableList.copyOf(identifiers.values());
}
origin: cucumber/cucumber-jvm

private Method getAcceptMethod(Class<? extends StepdefBody> bodyClass) {
  List<Method> acceptMethods = new ArrayList<>();
  for (Method method : bodyClass.getDeclaredMethods()) {
    if (!method.isBridge() && !method.isSynthetic() && "accept".equals(method.getName())) {
      acceptMethods.add(method);
    }
  }
  if (acceptMethods.size() != 1) {
    throw new IllegalStateException(format(
      "Expected single 'accept' method on body class, found '%s'", acceptMethods));
  }
  return acceptMethods.get(0);
}
origin: org.springframework/spring-core

/**
 * Determine whether the given method is declared by the user or at least pointing to
 * a user-declared method.
 * <p>Checks {@link Method#isSynthetic()} (for implementation methods) as well as the
 * {@code GroovyObject} interface (for interface methods; on an implementation class,
 * implementations of the {@code GroovyObject} methods will be marked as synthetic anyway).
 * Note that, despite being synthetic, bridge methods ({@link Method#isBridge()}) are considered
 * as user-level methods since they are eventually pointing to a user-declared generic method.
 * @param method the method to check
 * @return {@code true} if the method can be considered as user-declared; [@code false} otherwise
 */
public static boolean isUserLevelMethod(Method method) {
  Assert.notNull(method, "Method must not be null");
  return (method.isBridge() || (!method.isSynthetic() && !isGroovyObjectMethod(method)));
}
origin: org.codehaus.jackson/jackson-mapper-asl

protected boolean _isIncludableMethod(Method m, MethodFilter filter)
{
  if (filter != null && !filter.includeMethod(m)) {
    return false;
  }
  /* 07-Apr-2009, tatu: Looks like generics can introduce hidden
   *   bridge and/or synthetic methods. I don't think we want to
   *   consider those...
   */
  if (m.isSynthetic() || m.isBridge()) {
    return false;
  }
  return true;
}
origin: google/guava

 private ImmutableList<Method> getVisibleMethods(Class<?> cls) {
  // Don't use cls.getPackage() because it does nasty things like reading
  // a file.
  String visiblePackage = Reflection.getPackageName(cls);
  ImmutableList.Builder<Method> builder = ImmutableList.builder();
  for (Class<?> type : TypeToken.of(cls).getTypes().rawTypes()) {
   if (!Reflection.getPackageName(type).equals(visiblePackage)) {
    break;
   }
   for (Method method : type.getDeclaredMethods()) {
    if (!method.isSynthetic() && isVisible(method)) {
     builder.add(method);
    }
   }
  }
  return builder.build();
 }
}
origin: aws/aws-sdk-java

/**
 * Returns whether the method given is a getter method we should serialize /
 * deserialize to the service. The method must begin with "get" or "is",
 * have no arguments, belong to a class that declares its table, and not be
 * marked ignored.
 */
private static boolean isRelevantGetter(Method m) {
  return (m.getName().startsWith("get") || m.getName().startsWith("is"))
      && m.getParameterTypes().length == 0
      && ! (m.isBridge() || m.isSynthetic())
      && isDocumentType(m.getDeclaringClass())
      && !ReflectionUtils.getterOrFieldHasAnnotation(m, DynamoDBIgnore.class);
}
origin: prestodb/presto

private static ImmutableList<Method> getAnnotatedMethodsNotCached(Class<?> clazz) {
 Set<? extends Class<?>> supertypes = TypeToken.of(clazz).getTypes().rawTypes();
 Map<MethodIdentifier, Method> identifiers = Maps.newHashMap();
 for (Class<?> supertype : supertypes) {
  for (Method method : supertype.getDeclaredMethods()) {
   if (method.isAnnotationPresent(Subscribe.class) && !method.isSynthetic()) {
    // TODO(cgdecker): Should check for a generic parameter type and error out
    Class<?>[] parameterTypes = method.getParameterTypes();
    checkArgument(
      parameterTypes.length == 1,
      "Method %s has @Subscribe annotation but has %s parameters."
        + "Subscriber methods must have exactly 1 parameter.",
      method,
      parameterTypes.length);
    MethodIdentifier ident = new MethodIdentifier(method);
    if (!identifiers.containsKey(ident)) {
     identifiers.put(ident, method);
    }
   }
  }
 }
 return ImmutableList.copyOf(identifiers.values());
}
java.lang.reflectMethodisSynthetic

Javadoc

Returns true if this method is a synthetic method; returns false otherwise.

Popular methods of Method

  • invoke
    Returns the result of dynamically invoking this method. Equivalent to receiver.methodName(arg1, arg2
  • getName
  • getParameterTypes
  • getReturnType
  • setAccessible
  • getDeclaringClass
  • getAnnotation
  • getModifiers
  • isAnnotationPresent
  • getGenericReturnType
    Returns the return type of this method as a Type instance.
  • getParameterAnnotations
  • getGenericParameterTypes
    Returns the parameter types as an array of Type instances, in declaration order. If this method has
  • getParameterAnnotations,
  • getGenericParameterTypes,
  • isAccessible,
  • equals,
  • getAnnotations,
  • toString,
  • getExceptionTypes,
  • getParameterCount,
  • isBridge

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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