Codota Logo
Executable.getGenericParameterTypes
Code IndexAdd Codota to your IDE (free)

How to use
getGenericParameterTypes
method
in
java.lang.reflect.Executable

Best Java code snippets using java.lang.reflect.Executable.getGenericParameterTypes (Showing top 13 results out of 315)

  • Common ways to obtain Executable
private void myMethod () {
Executable e =
  • Codota IconParameter parameter;parameter.getDeclaringExecutable()
  • Codota IconInjectionPoint injectionPoint;(Executable) injectionPoint.getMember()
  • Codota IconParameterContext parameterContext;parameterContext.getDeclaringExecutable()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

/**
 * Return the generic type of the method/constructor parameter.
 * @return the parameter type (never {@code null})
 * @since 3.0
 */
public Type getGenericParameterType() {
  Type paramType = this.genericParameterType;
  if (paramType == null) {
    if (this.parameterIndex < 0) {
      Method method = getMethod();
      paramType = (method != null ? method.getGenericReturnType() : void.class);
    }
    else {
      Type[] genericParameterTypes = this.executable.getGenericParameterTypes();
      int index = this.parameterIndex;
      if (this.executable instanceof Constructor &&
          ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
          genericParameterTypes.length == this.executable.getParameterCount() - 1) {
        // Bug in javac: type array excludes enclosing instance parameter
        // for inner classes with at least one generic constructor parameter,
        // so access it with the actual parameter index lowered by 1
        index = this.parameterIndex - 1;
      }
      paramType = (index >= 0 && index < genericParameterTypes.length ?
          genericParameterTypes[index] : getParameterType());
    }
    this.genericParameterType = paramType;
  }
  return paramType;
}
origin: org.springframework/spring-core

/**
 * Return the generic type of the method/constructor parameter.
 * @return the parameter type (never {@code null})
 * @since 3.0
 */
public Type getGenericParameterType() {
  Type paramType = this.genericParameterType;
  if (paramType == null) {
    if (this.parameterIndex < 0) {
      Method method = getMethod();
      paramType = (method != null ? method.getGenericReturnType() : void.class);
    }
    else {
      Type[] genericParameterTypes = this.executable.getGenericParameterTypes();
      int index = this.parameterIndex;
      if (this.executable instanceof Constructor &&
          ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
          genericParameterTypes.length == this.executable.getParameterCount() - 1) {
        // Bug in javac: type array excludes enclosing instance parameter
        // for inner classes with at least one generic constructor parameter,
        // so access it with the actual parameter index lowered by 1
        index = this.parameterIndex - 1;
      }
      paramType = (index >= 0 && index < genericParameterTypes.length ?
          genericParameterTypes[index] : getParameterType());
    }
    this.genericParameterType = paramType;
  }
  return paramType;
}
origin: com.github.XDean/spring-annotation

/**
 * Return the generic type of the method/constructor parameter.
 *
 * @return the parameter type (never {@code null})
 * @since 3.0
 */
public Type getGenericParameterType() {
 Type paramType = this.genericParameterType;
 if (paramType == null) {
  if (this.parameterIndex < 0) {
   Method method = getMethod();
   paramType = (method != null ? method.getGenericReturnType() : void.class);
  } else {
   paramType = this.executable.getGenericParameterTypes()[this.parameterIndex];
  }
  this.genericParameterType = paramType;
 }
 return paramType;
}
origin: org.hibernate.validator/hibernate-validator

ParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext, int parameterIndex) {
  super(
    executableContext.getTypeContext().getConstraintMapping(),
    executableContext.executable.getGenericParameterTypes()[parameterIndex]
  );
  this.executableContext = executableContext;
  this.parameterIndex = parameterIndex;
}
origin: com.oracle.truffle/truffle-api

protected SingleMethodDesc(Executable executable) {
  this.varArgs = executable.isVarArgs();
  this.parameterTypes = executable.getParameterTypes();
  this.genericParameterTypes = executable.getGenericParameterTypes();
}
origin: org.graalvm.truffle/truffle-api

protected SingleMethod(Executable executable) {
  this.varArgs = executable.isVarArgs();
  this.parameterTypes = executable.getParameterTypes();
  this.genericParameterTypes = executable.getGenericParameterTypes();
}
origin: org.hibernate.validator/hibernate-validator

/**
 * Returns the type of the parameter of the given method with the given parameter index.
 *
 * @param executable The executable of interest.
 * @param parameterIndex The index of the parameter for which the type should be returned.
 *
 * @return The erased type.
 */
public static Type typeOf(Executable executable, int parameterIndex) {
  Type[] genericParameterTypes = executable.getGenericParameterTypes();
  // getGenericParameterTypes() doesn't return synthetic parameters; in this case fall back to getParameterTypes()
  if ( parameterIndex >= genericParameterTypes.length ) {
    genericParameterTypes = executable.getParameterTypes();
  }
  Type type = genericParameterTypes[parameterIndex];
  if ( type instanceof TypeVariable ) {
    type = TypeHelper.getErasedType( type );
  }
  return type;
}
origin: org.minijax/minijax-core

private Provider<?>[] getParamProviders(final Key<?> key, final Executable executable, final Set<Key<?>> chain) {
  final Class<?>[] paramClasses = executable.getParameterTypes();
  final Type[] paramTypes = executable.getGenericParameterTypes();
  final Annotation[][] annotations = executable.getParameterAnnotations();
  final Provider<?>[] result = new Provider<?>[paramTypes.length];
  for (int i = 0; i < paramTypes.length; ++i) {
    result[i] = getParamProvider(key, paramClasses[i], paramTypes[i], annotations[i], chain);
  }
  return result;
}
origin: com.oracle.substratevm/library-support

executable.getGenericParameterTypes();
executable.getGenericExceptionTypes();
executable.getParameters();
origin: org.apache.bval/bval-jsr

ValidateParameters(ApacheFactoryContext validatorContext, T object, E executable, Object[] parameterValues,
  Class<?>[] groups, Meta<E> meta) {
  super(validatorContext, groups, meta);
  this.object = object;
  this.parameterValues =
    Validate.notNull(parameterValues, IllegalArgumentException::new, "null parameter values").clone();
  final Type[] genericParameterTypes = executable.getGenericParameterTypes();
  Exceptions.raiseUnless(parameterValues.length == genericParameterTypes.length, IllegalArgumentException::new,
    PARAMETERS_DO_NOT_MATCH);
  IntStream.range(0, genericParameterTypes.length)
    .forEach(n -> Exceptions.raiseUnless(TypeUtils.isInstance(parameterValues[n], genericParameterTypes[n]),
      IllegalArgumentException::new, PARAMETERS_DO_NOT_MATCH));
}
origin: org.apache.tomee.patch/bval-jsr

ValidateParameters(ApacheFactoryContext validatorContext, T object, E executable, Object[] parameterValues,
  Class<?>[] groups, Meta<E> meta) {
  super(validatorContext, groups, meta);
  this.object = object;
  this.parameterValues =
    Validate.notNull(parameterValues, IllegalArgumentException::new, "null parameter values").clone();
  final Type[] genericParameterTypes = executable.getGenericParameterTypes();
  Exceptions.raiseUnless(parameterValues.length == genericParameterTypes.length, IllegalArgumentException::new,
    PARAMETERS_DO_NOT_MATCH);
  IntStream.range(0, genericParameterTypes.length)
    .forEach(n -> Exceptions.raiseUnless(TypeUtils.isInstance(parameterValues[n], genericParameterTypes[n]),
      IllegalArgumentException::new, PARAMETERS_DO_NOT_MATCH));
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Return the generic type of the method/constructor parameter.
 * @return the parameter type (never {@code null})
 * @since 3.0
 */
public Type getGenericParameterType() {
  Type paramType = this.genericParameterType;
  if (paramType == null) {
    if (this.parameterIndex < 0) {
      Method method = getMethod();
      paramType = (method != null ? method.getGenericReturnType() : void.class);
    }
    else {
      Type[] genericParameterTypes = this.executable.getGenericParameterTypes();
      int index = this.parameterIndex;
      if (this.executable instanceof Constructor &&
          ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
          genericParameterTypes.length == this.executable.getParameterCount() - 1) {
        // Bug in javac: type array excludes enclosing instance parameter
        // for inner classes with at least one generic constructor parameter,
        // so access it with the actual parameter index lowered by 1
        index = this.parameterIndex - 1;
      }
      paramType = (index >= 0 && index < genericParameterTypes.length ?
          genericParameterTypes[index] : getParameterType());
    }
    this.genericParameterType = paramType;
  }
  return paramType;
}
origin: com.gitee.ainilili/noaoc

for(Type type: hitEntity.getMethod().getGenericParameterTypes()){
  types.add(type.getTypeName());
java.lang.reflectExecutablegetGenericParameterTypes

Popular methods of Executable

  • getParameters
  • getDeclaringClass
  • getParameterTypes
  • getName
  • getParameterCount
  • toGenericString
  • getModifiers
  • getParameterAnnotations
  • getAnnotation
  • getAnnotations
  • isAnnotationPresent
  • isVarArgs
  • isAnnotationPresent,
  • isVarArgs,
  • getAnnotatedParameterTypes,
  • getAnnotatedReturnType,
  • getAnnotatedReceiverType,
  • getGenericExceptionTypes,
  • isSynthetic,
  • <init>,
  • getAnnotatedExceptionTypes

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Option (scala)
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