congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Executable
Code IndexAdd Tabnine to your IDE (free)

How to use
Executable
in
java.lang.reflect

Best Java code snippets using java.lang.reflect.Executable (Showing top 20 results out of 918)

origin: prestodb/presto

  public Parameter[] getParameters(Executable executable) {
    return executable.getParameters();
  }
}
origin: spring-projects/spring-framework

if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) &&
    executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
  return (index == 0 ? EMPTY_ANNOTATED_ELEMENT : executable.getParameters()[index - 1]);
origin: spring-projects/spring-framework

/**
 * Return the type of the method/constructor parameter.
 * @return the parameter type (never {@code null})
 */
public Class<?> getParameterType() {
  Class<?> paramType = this.parameterType;
  if (paramType == null) {
    if (this.parameterIndex < 0) {
      Method method = getMethod();
      paramType = (method != null ? method.getReturnType() : void.class);
    }
    else {
      paramType = this.executable.getParameterTypes()[this.parameterIndex];
    }
    this.parameterType = paramType;
  }
  return paramType;
}
origin: spring-projects/spring-framework

/**
 * Return the annotations associated with the specific method/constructor parameter.
 */
public Annotation[] getParameterAnnotations() {
  Annotation[] paramAnns = this.parameterAnnotations;
  if (paramAnns == null) {
    Annotation[][] annotationArray = this.executable.getParameterAnnotations();
    int index = this.parameterIndex;
    if (this.executable instanceof Constructor &&
        ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
        annotationArray.length == this.executable.getParameterCount() - 1) {
      // Bug in javac in JDK <9: annotation array excludes enclosing instance parameter
      // for inner classes, so access it with the actual parameter index lowered by 1
      index = this.parameterIndex - 1;
    }
    paramAnns = (index >= 0 && index < annotationArray.length ?
        adaptAnnotationArray(annotationArray[index]) : EMPTY_ANNOTATION_ARRAY);
    this.parameterAnnotations = paramAnns;
  }
  return paramAnns;
}
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: pholser/junit-quickcheck

  private static String declarerName(Parameter p) {
    Executable exec = p.getDeclaringExecutable();
    return exec.getDeclaringClass().getName() + '.' + exec.getName();
  }
}
origin: spring-projects/spring-framework

BeanDefinitionValueResolver valueResolver =
    new BeanDefinitionValueResolver(this.beanFactory, beanName, mbd, converter);
Class<?>[] paramTypes = executable.getParameterTypes();
  Object argValue = argsToResolve[argIndex];
  MethodParameter methodParam = MethodParameter.forExecutable(executable, argIndex);
  GenericTypeResolver.resolveParameterType(methodParam, executable.getDeclaringClass());
  if (argValue instanceof AutowiredArgumentMarker) {
    argValue = resolveAutowiredArgument(methodParam, beanName, null, converter, fallback);
origin: oblac/jodd

/**
 * Takes given parameters references and returns reference set for given method or constructor.
 */
public BeanReferences[] resolveReferenceFromValues(final Executable methodOrCtor, final String... parameterReferences) {
  BeanReferences[] references = convertRefToReferences(parameterReferences);
  if (references == null || references.length == 0) {
    references = buildDefaultReferences(methodOrCtor);
  }
  if (methodOrCtor.getParameterTypes().length != references.length) {
    throw new PetiteException("Different number of method parameters and references for: " +
      methodOrCtor.getDeclaringClass().getName() + '#' + methodOrCtor.getName());
  }
  removeAllDuplicateNames(references);
  return references;
}
origin: AxonFramework/AxonFramework

this.messageType = messageType;
ReflectionUtils.ensureAccessible(this.executable);
Parameter[] parameters = executable.getParameters();
this.parameterCount = executable.getParameterCount();
parameterResolvers = new ParameterResolver[parameterCount];
Class<?> supportedPayloadType = explicitPayloadType;
    throw new UnsupportedHandlerException(
        "Unable to resolve parameter " + i + " (" + parameters[i].getType().getSimpleName() +
            ") in handler " + executable.toGenericString() + ".", executable);
    throw new UnsupportedHandlerException(String.format(
        "The method %s seems to have parameters that put conflicting requirements on the payload type" +
            " applicable on that method: %s vs %s", executable.toGenericString(),
        supportedPayloadType, parameterResolvers[i].supportedPayloadType()), executable);
origin: leangen/graphql-spqr

PropertyDescriptor fromConstructorParameter(AnnotatedParameter ctorParam) {
  Executable constructor = (Executable) ctorParam.getOwner().getMember();
  Parameter parameter = constructor.getParameters()[ctorParam.getIndex()];
  AnnotatedType fieldType = transform(ClassUtils.getParameterTypes(constructor, type)[ctorParam.getIndex()], parameter);
  return new PropertyDescriptor(type, constructor.getDeclaringClass(), parameter, fieldType, ctorParam);
}
origin: jooby-project/jooby

boolean hasBody = Arrays.asList(p.getDeclaringExecutable().getParameters()).stream()
  .filter(it -> Stream.of(it.getAnnotations())
    .filter(e -> e.annotationType() == Body.class)
 return RouteParameter.Kind.PATH;
boolean formLike = !hasBody && p.getDeclaringExecutable().getAnnotation(POST.class) != null;
if (formLike) {
 return RouteParameter.Kind.FORM;
origin: line/armeria

                      boolean implicitRequestObjectAnnotation,
                      boolean isServiceMethod) {
final Parameter[] parameters = constructorOrMethod.getParameters();
if (parameters.length == 0) {
  throw new NoParameterException(constructorOrMethod.toGenericString());
                      constructorOrMethod.toGenericString());
                      constructorOrMethod.toGenericString());
         implicitRequestObjectAnnotation);
} else if (!isServiceMethod &&
      constructorOrMethod.getAnnotationsByType(RequestConverter.class).length > 0 &&
      parameters.length == 1) {
                      constructorOrMethod.toGenericString());
  if (constructorOrMethod.isAnnotationPresent(Default.class)) {
    throw new IllegalArgumentException(
        '@' + Default.class.getSimpleName() + " is not supported for: " +
        constructorOrMethod.toGenericString());
              .collect(Collectors.toList()));
if (list.isEmpty()) {
  throw new NoAnnotatedParameterException(constructorOrMethod.toGenericString());
                      constructorOrMethod.toGenericString());
  } else {
origin: spring-projects/spring-framework

/**
 * Return the class that declares the underlying Method or Constructor.
 */
public Class<?> getDeclaringClass() {
  return this.executable.getDeclaringClass();
}
origin: org.junit.jupiter/junit-jupiter-params

private static boolean isNotPrivateAndAcceptsSingleStringArgument(Executable executable) {
  return isNotPrivate(executable) //
      && (executable.getParameterCount() == 1) //
      && (executable.getParameterTypes()[0] == String.class);
}
origin: oblac/jodd

private BeanReferences[] updateReferencesWithDefaultsIfNeeded(final Executable methodOrCtor, BeanReferences[] references) {
  BeanReferences[] defaultReferences = buildDefaultReferences(methodOrCtor);
  if (references == null || references.length == 0) {
    references = defaultReferences;
  }
  if (methodOrCtor.getParameterTypes().length != references.length) {
    throw new PetiteException(
      "Different number of parameters and references for: " + methodOrCtor.getName());
  }
  // apply default parameters
  for (int i = 0; i < references.length; i++) {
    BeanReferences parameterReferences = references[i];
    if (parameterReferenceIsNotSet(parameterReferences)) {
      references[i] = defaultReferences[i];
    }
  }
  return references;
}
origin: org.graalvm.truffle/truffle-api

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

  @Override
  public String toString() {
    return getClass().getSimpleName() + " " + executable.toGenericString();
  }
}
origin: com.oracle.substratevm/library-support

executable.getGenericParameterTypes();
executable.getGenericExceptionTypes();
executable.getParameters();
origin: com.gitee.ainilili/noaoc

      hitEntity.getParameters(),
      paramSource,
      hitEntity.getMethod().getParameterTypes());
  target = (T) ((Constructor<T>)hitEntity.getMethod()).newInstance(objects);
}else{
if(hitEntity.getMethod().getParameterCount() > 0){
  for(Type type: hitEntity.getMethod().getGenericParameterTypes()){
    types.add(type.getTypeName());
origin: io.airlift/parameternames

ParameterNameClassVisitor(Executable executable)
{
  super(Opcodes.ASM5);
  methodName = executable instanceof Constructor ? "<init>" : executable.getName();
  parameterTypes = Arrays.stream(executable.getParameterTypes())
      .map(Type::getType)
      .collect(toList());
  this.methodVisitor = new ParameterNameMethodVisitor(isStatic(executable.getModifiers()), parameterTypes);
}
java.lang.reflectExecutable

Javadoc

A shared superclass for the common functionality of Methodand Constructor.

Most used methods

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • 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
  • Option (scala)
  • 14 Best Plugins for Eclipse
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