Tabnine Logo
Executable.getDeclaringClass
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: spring-projects/spring-framework

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

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

Class<?> getDeclaringClass() {
  return executable.getDeclaringClass();
}
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: AxonFramework/AxonFramework

private MethodCommandMessageHandlingMember(MessageHandlingMember<T> delegate,
                      Map<String, Object> annotationAttributes) {
  super(delegate);
  this.routingKey = "".equals(annotationAttributes.get("routingKey")) ? null :
      (String) annotationAttributes.get("routingKey");
  Executable executable = delegate.unwrap(Executable.class).orElseThrow(() -> new AxonConfigurationException(
      "The @CommandHandler annotation must be put on an Executable (either directly or as Meta " +
          "Annotation)"));
  if ("".equals(annotationAttributes.get("commandName"))) {
    commandName = delegate.payloadType().getName();
  } else {
    commandName = (String) annotationAttributes.get("commandName");
  }
  final boolean factoryMethod = executable instanceof Method && Modifier.isStatic(executable.getModifiers());
  if (factoryMethod && !executable.getDeclaringClass().isAssignableFrom(((Method)executable).getReturnType())) {
    throw new AxonConfigurationException("static @CommandHandler methods must declare a return value " +
                           "which is equal to or a subclass of the declaring time");
  }
  isFactoryHandler = executable instanceof Constructor || factoryMethod;
}
origin: jooby-project/jooby

private Map<String, Object> md(final Executable exec) {
 return Try.apply(() -> cache.getUnchecked(exec.getDeclaringClass()))
   .unwrap(UncheckedExecutionException.class)
   .get();
}
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: 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: spring-projects/spring-framework

if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) &&
    executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
origin: org.springframework/spring-core

/**
 * 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: 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: spring-projects/spring-framework

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: org.junit.jupiter/junit-jupiter-engine

Executable executable = getDeclaringExecutable();
if (executable instanceof Constructor && isInnerClass(executable.getDeclaringClass())
    && executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
origin: org.springframework/spring-beans

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: pholser/junit-quickcheck

  private static String declarerName(Parameter p) {
    Executable exec = p.getDeclaringExecutable();
    return exec.getDeclaringClass().getName() + '.' + exec.getName();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

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

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

public ExecutableFormatter(Executable executable) {
  String name = ExecutableHelper.getSimpleName( executable );
  if ( executable instanceof Method ) {
    name = executable.getDeclaringClass().getSimpleName() + "#" + name;
  }
  Class<?>[] parameterTypes = executable.getParameterTypes();
  this.stringRepresentation = ExecutableHelper.getExecutableAsString( name, parameterTypes );
}
origin: org.jooby/jooby

private Map<String, Object> md(final Executable exec) {
 return Try.apply(() -> cache.getUnchecked(exec.getDeclaringClass()))
   .unwrap(UncheckedExecutionException.class)
   .get();
}
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);
}
java.lang.reflectExecutablegetDeclaringClass

Popular methods of Executable

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

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JLabel (javax.swing)
  • JTextField (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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