congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MethodInfo.declaringClass
Code IndexAdd Tabnine to your IDE (free)

How to use
declaringClass
method
in
org.jboss.jandex.MethodInfo

Best Java code snippets using org.jboss.jandex.MethodInfo.declaringClass (Showing top 20 results out of 315)

origin: wildfly/wildfly

private ClassInfo getAnnotationClass(final AnnotationTarget annotationTarget) {
  if (annotationTarget instanceof ClassInfo) {
    return (ClassInfo) annotationTarget;
  } else if (annotationTarget instanceof MethodInfo) {
    return ((MethodInfo) annotationTarget).declaringClass();
  } else if (annotationTarget instanceof FieldInfo) {
    return ((FieldInfo) annotationTarget).declaringClass();
  } else if (annotationTarget instanceof MethodParameterInfo) {
    return ((MethodParameterInfo) annotationTarget).method().declaringClass();
  } else {
    throw EeLogger.ROOT_LOGGER.unknownAnnotationTargetType(annotationTarget);
  }
}
origin: wildfly/wildfly

private void processMethod(final DeploymentUnit deploymentUnit, final EJBResourceWrapper annotation, final MethodInfo methodInfo, final EEModuleDescription eeModuleDescription) {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw EjbLogger.ROOT_LOGGER.onlySetterMethodsAllowedToHaveEJBAnnotation(methodInfo);
  }
  final String methodParamType = methodInfo.args()[0].name().toString();
  final InjectionTarget targetDescription = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, methodParamType);
  final String localContextName = isEmpty(annotation.name()) ? methodInfo.declaringClass().name().toString() + "/" + methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4) : annotation.name();
  final String beanInterfaceType = isEmpty(annotation.beanInterface()) || annotation.beanInterface().equals(Object.class.getName()) ? methodParamType : annotation.beanInterface();
  process(deploymentUnit, beanInterfaceType, annotation.beanName(), annotation.lookup(), methodInfo.declaringClass(), targetDescription, localContextName, eeModuleDescription);
}
origin: wildfly/wildfly

  classes.add(((FieldInfo) annotationTarget).declaringClass());
} else if (annotationTarget instanceof MethodInfo) {
  classes.add(((MethodInfo) annotationTarget).declaringClass());
} else if (annotationTarget instanceof MethodParameterInfo) {
  classes.add(((MethodParameterInfo) annotationTarget).method().declaringClass());
origin: wildfly/wildfly

protected void processMethodResource(final DeploymentPhaseContext phaseContext, final MethodInfo methodInfo, final String name, final String type, final EEModuleClassDescription classDescription, final AnnotationInstance annotation, final EEModuleDescription eeModuleDescription, final Module module, final EEApplicationClasses applicationClasses, final PropertyReplacer replacer) throws DeploymentUnitProcessingException {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw EeLogger.ROOT_LOGGER.setterMethodOnly("@Resource", methodInfo);
  }
  final String contextNameSuffix = methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4);
  final String localContextName = isEmpty(name) ? methodInfo.declaringClass().name().toString() + "/" + contextNameSuffix : name;
  final String injectionType = isEmpty(type) || type.equals(Object.class.getName()) ? methodInfo.args()[0].name().toString() : type;
  final InjectionTarget targetDescription = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, methodInfo.args()[0].name().toString());
  process(phaseContext, classDescription, annotation, injectionType, localContextName, targetDescription, eeModuleDescription, module, applicationClasses, replacer);
}
origin: wildfly/wildfly

private void processAroundInvoke(final EEModuleDescription eeModuleDescription, final AnnotationTarget target) throws DeploymentUnitProcessingException {
  if (!(target instanceof MethodInfo)) {
    throw EeLogger.ROOT_LOGGER.methodOnlyAnnotation(AROUND_INVOKE_ANNOTATION_NAME);
  }
  final MethodInfo methodInfo = MethodInfo.class.cast(target);
  final ClassInfo classInfo = methodInfo.declaringClass();
  final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
  final List<AnnotationInstance> classAroundInvokes = classInfo.annotations().get(AROUND_INVOKE_ANNOTATION_NAME);
  if(classAroundInvokes.size() > 1) {
    throw EeLogger.ROOT_LOGGER.aroundInvokeAnnotationUsedTooManyTimes(classInfo.name(), classAroundInvokes.size());
  }
  validateArgumentType(classInfo, methodInfo);
  InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
  builder.setAroundInvoke(MethodIdentifier.getIdentifier(Object.class, methodInfo.name(), InvocationContext.class));
  classDescription.setInterceptorClassDescription(builder.build());
}
origin: wildfly/wildfly

  parameterTypes.add(type.toString());
String declaringClass = m.declaringClass().name().toString();
annotation = new AnnotationImpl(declaringClass, cl, parameterTypes, m.name(), true, false, annotationClass);
origin: wildfly/wildfly

private void processAroundInvoke(final AnnotationTarget target, final EEModuleDescription eeModuleDescription) {
  if (!(target instanceof MethodInfo)) {
    throw EjbLogger.ROOT_LOGGER.annotationApplicableOnlyForMethods(AROUND_TIMEOUT_ANNOTATION_NAME.toString());
  }
  final MethodInfo methodInfo = MethodInfo.class.cast(target);
  final ClassInfo classInfo = methodInfo.declaringClass();
  final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
  validateArgumentType(classInfo, methodInfo);
  final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
  builder.setAroundTimeout(MethodIdentifier.getIdentifier(Object.class, methodInfo.name(), InvocationContext.class));
  classDescription.setInterceptorClassDescription(builder.build());
}
origin: wildfly/wildfly

private void processLifeCycle(final EEModuleDescription eeModuleDescription, final AnnotationTarget target, final DotName annotationType, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException {
  if (!(target instanceof MethodInfo)) {
    throw EeLogger.ROOT_LOGGER.methodOnlyAnnotation(annotationType);
  }
  final MethodInfo methodInfo = MethodInfo.class.cast(target);
  final ClassInfo classInfo = methodInfo.declaringClass();
  final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
  final Type[] args = methodInfo.args();
  if (args.length > 1) {
    ROOT_LOGGER.warn(EeLogger.ROOT_LOGGER.invalidNumberOfArguments(methodInfo.name(), annotationType, classInfo.name()));
    return;
  } else if (args.length == 1 && !args[0].name().toString().equals(InvocationContext.class.getName())) {
    ROOT_LOGGER.warn(EeLogger.ROOT_LOGGER.invalidSignature(methodInfo.name(), annotationType, classInfo.name(), "void methodName(InvocationContext ctx)"));
    return;
  }
  final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
  if (annotationType == POST_CONSTRUCT_ANNOTATION) {
    builder.setPostConstruct(getMethodIdentifier(args, methodInfo));
  } else if (annotationType == PRE_DESTROY_ANNOTATION) {
    builder.setPreDestroy(getMethodIdentifier(args, methodInfo));
  } else if(annotationType == AROUND_CONSTRUCT_ANNOTATION){
    builder.setAroundConstruct(getMethodIdentifier(args, methodInfo));
  }
  classDescription.setInterceptorClassDescription(builder.build());
}
origin: wildfly/wildfly

final ClassInfo classInfo = methodInfo.declaringClass();
final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
origin: camunda/camunda-bpm-platform

protected Class<?> getPaClass(AnnotationInstance annotation) throws ClassNotFoundException {
 String paClassName = ((MethodInfo)annotation.target()).declaringClass().name().toString();
 Class<?> paClass = paModule.getClassLoader().loadClass(paClassName);
 return paClass;
}
origin: camunda/camunda-bpm-platform

protected Class<?> getPaClass(AnnotationInstance annotation) throws ClassNotFoundException {
 String paClassName = ((MethodInfo)annotation.target()).declaringClass().name().toString();
 Class<?> paClass = paModule.getClassLoader().loadClass(paClassName);
 return paClass;
}
origin: camunda/camunda-bpm-platform

protected Class<?> getPaClass(AnnotationInstance annotation) throws ClassNotFoundException {
 String paClassName = ((MethodInfo)annotation.target()).declaringClass().name().toString();
 Class<?> paClass = paModule.getClassLoader().loadClass(paClassName);
 return paClass;
}
origin: wildfly/wildfly

} else if (annotationTarget instanceof MethodInfo) {
  final MethodInfo methodInfo = (MethodInfo) annotationTarget;
  ClassInfo classInfo = methodInfo.declaringClass();
  EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
  processMethodResource(phaseContext, methodInfo, name, type, classDescription, annotation, eeModuleDescription, module, applicationClasses, replacer);
origin: org.jboss.as/jboss-as-ejb3

private void processMethod(final DeploymentUnit deploymentUnit, final EJBResourceWrapper annotation, final MethodInfo methodInfo, final EEModuleDescription eeModuleDescription) {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw MESSAGES.onlySetterMethodsAllowedToHaveEJBAnnotation(methodInfo);
  }
  final String methodParamType = methodInfo.args()[0].name().toString();
  final InjectionTarget targetDescription = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, methodParamType);
  final String localContextName = isEmpty(annotation.name()) ? methodInfo.declaringClass().name().toString() + "/" + methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4) : annotation.name();
  final String beanInterfaceType = isEmpty(annotation.beanInterface()) || annotation.beanInterface().equals(Object.class.getName()) ? methodParamType : annotation.beanInterface();
  process(deploymentUnit, beanInterfaceType, annotation.beanName(), annotation.lookup(), methodInfo.declaringClass(), targetDescription, localContextName, eeModuleDescription);
}
origin: org.wildfly/wildfly-webservices-server-integration

private static void processMethodRef(final DeploymentUnit unit, final WSRefAnnotationWrapper annotation, final MethodInfo methodInfo) throws DeploymentUnitProcessingException {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw WSLogger.ROOT_LOGGER.invalidServiceRefSetterMethodName(methodInfo);
  }
  final String injectionType = isEmpty(annotation.type()) || annotation.type().equals(Object.class.getName()) ? methodInfo.args()[0].name().toString() : annotation.type();
  final InjectionTarget injectionTarget = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, injectionType);
  final String bindingName = isEmpty(annotation.name()) ? methodInfo.declaringClass().name().toString() + "/" + methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4) : annotation.name();
  processRef(unit, injectionType, annotation, methodInfo.declaringClass(), injectionTarget, bindingName);
}
origin: org.jboss.as/jboss-as-webservices-server-integration

private static void processMethodRef(final DeploymentUnit unit, final WSRefAnnotationWrapper annotation, final MethodInfo methodInfo) throws DeploymentUnitProcessingException {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw MESSAGES.invalidServiceRefSetterMethodName(methodInfo);
  }
  final String injectionType = isEmpty(annotation.type()) || annotation.type().equals(Object.class.getName()) ? methodInfo.args()[0].name().toString() : annotation.type();
  final InjectionTarget injectionTarget = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, injectionType);
  final String bindingName = isEmpty(annotation.name()) ? methodInfo.declaringClass().name().toString() + "/" + methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4) : annotation.name();
  processRef(unit, injectionType, annotation, methodInfo.declaringClass(), injectionTarget, bindingName);
}
origin: org.wildfly/wildfly-ee

protected void processMethodResource(final DeploymentPhaseContext phaseContext, final MethodInfo methodInfo, final String name, final String type, final EEModuleClassDescription classDescription, final AnnotationInstance annotation, final EEModuleDescription eeModuleDescription, final Module module, final EEApplicationClasses applicationClasses, final PropertyReplacer replacer) throws DeploymentUnitProcessingException {
  final String methodName = methodInfo.name();
  if (!methodName.startsWith("set") || methodInfo.args().length != 1) {
    throw EeLogger.ROOT_LOGGER.setterMethodOnly("@Resource", methodInfo);
  }
  final String contextNameSuffix = methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4);
  final String localContextName = isEmpty(name) ? methodInfo.declaringClass().name().toString() + "/" + contextNameSuffix : name;
  final String injectionType = isEmpty(type) || type.equals(Object.class.getName()) ? methodInfo.args()[0].name().toString() : type;
  final InjectionTarget targetDescription = new MethodInjectionTarget(methodInfo.declaringClass().name().toString(), methodName, methodInfo.args()[0].name().toString());
  process(phaseContext, classDescription, annotation, injectionType, localContextName, targetDescription, eeModuleDescription, module, applicationClasses, replacer);
}
origin: org.camunda.bpm.wildfly/camunda-wildfly-subsystem

protected Class<?> getPaClass(AnnotationInstance annotation) throws ClassNotFoundException {
 String paClassName = ((MethodInfo)annotation.target()).declaringClass().name().toString();
 Class<?> paClass = paModule.getClassLoader().loadClass(paClassName);
 return paClass;
}
origin: org.jboss.as/jboss-as-ee

private void processAroundInvoke(final EEModuleDescription eeModuleDescription, final AnnotationTarget target) throws DeploymentUnitProcessingException {
  if (!(target instanceof MethodInfo)) {
    throw MESSAGES.methodOnlyAnnotation(AROUND_INVOKE_ANNOTATION_NAME);
  }
  final MethodInfo methodInfo = MethodInfo.class.cast(target);
  final ClassInfo classInfo = methodInfo.declaringClass();
  final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
  validateArgumentType(classInfo, methodInfo);
  InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
  builder.setAroundInvoke(MethodIdentifier.getIdentifier(Object.class, methodInfo.name(), InvocationContext.class));
  classDescription.setInterceptorClassDescription(builder.build());
}
origin: org.jboss.as/jboss-as-ejb3

public static EJBMethodIdentifier fromMethodInfo(final MethodInfo methodInfo) {
  final String returnType = methodInfo.returnType().name().toString();
  final String[] argTypes = new String[methodInfo.args().length];
  int i = 0;
  for (Type argType : methodInfo.args()) {
    argTypes[i++] = argType.name().toString();
  }
  final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(returnType, methodInfo.name(), argTypes);
  return new EJBMethodIdentifier(methodIdentifier, methodInfo.declaringClass().name().toString());
}
org.jboss.jandexMethodInfodeclaringClass

Javadoc

Returns the class that declared this method

Popular methods of MethodInfo

  • name
  • args
  • flags
  • returnType
  • hasAnnotation
  • annotation
  • annotations
  • create
    Construct a new mock Method instance.
  • parameters
  • <init>
  • copyExceptions
  • copyParameters
  • copyExceptions,
  • copyParameters,
  • defaultValue,
  • exceptions,
  • methodInternal,
  • parameterName,
  • receiverType,
  • setAnnotations,
  • setClassInfo

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • getContentResolver (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
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