Tabnine Logo
EnhancedAnnotatedType
Code IndexAdd Tabnine to your IDE (free)

How to use
EnhancedAnnotatedType
in
org.jboss.weld.annotated.enhanced

Best Java code snippets using org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType (Showing top 20 results out of 315)

Refine searchRefine arrow

  • BeanManagerImpl
  • BeanIdentifiers
  • SlimAnnotatedType
  • BeanLogger
  • ServiceRegistry
  • AnnotatedTypeIdentifier
  • EnhancedAnnotatedMethod
  • ClassTransformer
  • Formats
origin: jersey/jersey

        .getDeclaredEnhancedConstructor(new ConstructorSignatureImpl(analyzer.getConstructor()));
InjectionTargetService injectionTargetService = it.getBeanManager().getServices().get(InjectionTargetService.class);
injectionTargetService.addInjectionTargetToBeInitialized(jit.getEnhancedAnnotatedType(), jit);
return jit;
origin: wildfly/wildfly

final ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class);
@SuppressWarnings("unchecked")
final Class<T> clazz = (Class<T>) componentClass;
EnhancedAnnotatedType<T> type = transformer.getEnhancedAnnotatedType(clazz, beanManager.getId());
if (!type.getJavaClass().equals(componentClass)) {
  final String bdaId = beanManager.getId() + classLoader.hashCode();
  type = transformer.getEnhancedAnnotatedType(clazz, bdaId);
origin: jersey/jersey

private void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) {
  if (type.isFinal()) {
    throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this);
  }
  checkNoArgsConstructor(type);
  for (Decorator<?> decorator : decorators) {
    EnhancedAnnotatedType<?> decoratorClass;
    if (decorator instanceof DecoratorImpl<?>) {
      DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator;
      decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class)
          .getEnhancedAnnotatedType(decoratorBean.getAnnotated());
    } else if (decorator instanceof CustomDecoratorWrapper<?>) {
      decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated();
    } else {
      throw BeanLogger.LOG.nonContainerDecorator(decorator);
    }
    for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) {
      EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature());
      if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) {
        throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this);
      }
    }
  }
}
origin: HotswapProjects/HotswapAgent

Set<Bean<?>> beans = beanManager.getBeans(beanClass, new AnnotationLiteral<Any>() {});
      if (!eat.isAbstract() || !eat.getJavaClass().isInterface()) { // injectionTargetCannotBeCreatedForInterface
        ((AbstractClassBean)bean).setProducer(beanManager.getLocalInjectionTargetFactory(eat).createInjectionTarget(eat, bean, false));
        if (isReinjectingContext(bean)) {
          doReloadAbstractClassBean(beanManager, (AbstractClassBean) bean, oldSignatures, reloadStrategy);
origin: jersey/jersey

private void checkNoArgsConstructor(EnhancedAnnotatedType<T> type) {
  if (!beanManager.getServices().get(ProxyInstantiator.class).isUsingConstructor()) {
    return;
  }
  EnhancedAnnotatedConstructor<T> constructor = type.getNoArgsEnhancedConstructor();
  if (constructor == null) {
    throw BeanLogger.LOG.decoratedHasNoNoargsConstructor(this);
  } else if (constructor.isPrivate()) {
    throw BeanLogger.LOG
        .decoratedNoargsConstructorIsPrivate(this, Formats.formatAsStackTraceElement(constructor.getJavaMember()));
  }
}
origin: org.jboss.weld.se/weld-se

protected EnhancedAnnotatedConstructor<T> initEnhancedSubclass(BeanManagerImpl manager, EnhancedAnnotatedType<T> type, Bean<?> bean, ConstructorInjectionPoint<T> originalConstructorInjectionPoint) {
  ClassTransformer transformer = manager.getServices().get(ClassTransformer.class);
  EnhancedAnnotatedType<T> enhancedSubclass = transformer.getEnhancedAnnotatedType(createEnhancedSubclass(type, bean, manager), type.slim().getIdentifier().getBdaId());
  return findMatchingConstructor(originalConstructorInjectionPoint.getSignature(), enhancedSubclass);
}
origin: weld/core

public static String forProducerMethod(EnhancedAnnotatedMethod<?, ?> method, AbstractClassBean<?> declaringBean) {
  if (declaringBean.getEnhancedAnnotated().isDiscovered()) {
    return forProducerMethod(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember()));
  }
  return getPrefix(ProducerMethod.class).append(method.getDeclaringType().slim().getIdentifier()).append(AnnotatedTypes.createCallableId(method)).toString();
}
origin: weld/core

public ExtensionBean(BeanManagerImpl manager, EnhancedAnnotatedType<E> enhancedAnnotatedType, Metadata<E> instance) {
  super(new StringBeanIdentifier(BeanIdentifiers.forExtension(enhancedAnnotatedType)), manager, enhancedAnnotatedType.getJavaClass());
  this.annotatedType = enhancedAnnotatedType.slim();
  this.instance = instance;
  this.passivationCapable = enhancedAnnotatedType.isSerializable();
  this.proxiable = Proxies.isTypeProxyable(enhancedAnnotatedType.getBaseType(), manager.getServices());
  checkPublicFields(enhancedAnnotatedType);
}
origin: org.jboss.weld.se/weld-se

public static String forSessionBean(EnhancedAnnotatedType<?> type, EjbDescriptor<?> descriptor) {
  StringBuilder builder = getPrefix(SessionBean.class);
  appendEjbNameAndClass(builder, descriptor);
  if (!type.isDiscovered()) {
    builder.append(BEAN_ID_SEPARATOR).append(type.slim().getIdentifier().asString());
  }
  return builder.toString();
}
origin: org.jboss.weld.se/weld-se

public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl manager, EnhancedAnnotatedType<T> componentType) {
  if (ejbDescriptor.getBeanClass().equals(ejbDescriptor.getImplementationClass())) {
    // no special implementation class is used
    return componentType;
  }
  ClassTransformer transformer = manager.getServices().get(ClassTransformer.class);
  EnhancedAnnotatedType<T> implementationClass = cast(transformer.getEnhancedAnnotatedType(ejbDescriptor.getImplementationClass(), manager.getId()));
  manager.getServices().get(SlimAnnotatedTypeStore.class).put(implementationClass.slim());
  return implementationClass;
}
origin: weld/core

public static List<EnhancedAnnotatedMethod<?, ?>> getInterceptableMethods(EnhancedAnnotatedType<?> type) {
  List<EnhancedAnnotatedMethod<?, ?>> annotatedMethods = new ArrayList<EnhancedAnnotatedMethod<?, ?>>();
  for (EnhancedAnnotatedMethod<?, ?> annotatedMethod : type.getEnhancedMethods()) {
    boolean businessMethod = !annotatedMethod.isStatic() && !annotatedMethod.isAnnotationPresent(Inject.class)
        && !annotatedMethod.getJavaMember().isBridge();
    if (businessMethod && !isInterceptorMethod(annotatedMethod)) {
      annotatedMethods.add(annotatedMethod);
    }
  }
  return annotatedMethods;
}
origin: weld/core

public void init() {
  initTargetClassInterceptors();
  businessMethods = Beans.getInterceptableMethods(annotatedType);
  initEjbInterceptors();
  initCdiInterceptors();
  InterceptionModel interceptionModel = builder.build();
  if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) {
    if (annotatedType.isFinal()) {
      throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass());
    }
    if (Reflections.isPrivate(constructor.getJavaMember())) {
      throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass()));
    }
    manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel);
  }
}
origin: org.jboss.weld.se/weld-se

@Override
public <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T> type) {
  EnhancedAnnotatedType<T> clazz = services.get(ClassTransformer.class).getEnhancedAnnotatedType(type, getId());
  if (services.get(EjbDescriptors.class).contains(type.getJavaClass())) {
    return BeanAttributesFactory.forSessionBean(clazz, services.get(EjbDescriptors.class).getUnique(clazz.getJavaClass()), this);
  }
  return BeanAttributesFactory.forBean(clazz, this);
}
origin: weld/core

protected boolean initScopeFromStereotype() {
  Set<Annotation> possibleScopes = mergedStereotypes.getPossibleScopes();
  if (possibleScopes.size() == 1) {
    this.scope = possibleScopes.iterator().next().annotationType();
    return true;
  } else if (possibleScopes.size() > 1) {
    String stack;
    Class<?> declaringClass;
    if (annotated instanceof EnhancedAnnotatedMember) {
      EnhancedAnnotatedMember<?, ?, ?> member = (EnhancedAnnotatedMember<?, ?, ?>) annotated;
      declaringClass = member.getDeclaringType().getJavaClass();
      stack = "\n  at " + Formats.formatAsStackTraceElement(member.getJavaMember());
    } else {
      declaringClass = annotated.getJavaClass();
      stack = "";
    }
    throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(Formats.formatType(declaringClass, false),
        Formats.formatTypes(mergedStereotypes.getStereotypes(), false), possibleScopes, stack);
  } else {
    return false;
  }
}
origin: org.jboss.weld.se/weld-se

@Override
public <M> EnhancedAnnotatedMethod<M, ?> getEnhancedMethod(MethodSignature signature) {
  EnhancedAnnotatedMethod<M, ?> method = cast(getDeclaredEnhancedMethod(signature));
  if ((method == null) && (superclass != null) && (superclass.getJavaClass() != Object.class)) {
    method = superclass.getEnhancedMethod(signature);
  }
  return method;
}
origin: weld/core

protected void checkType(EnhancedAnnotatedType<T> type) {
  if (!Reflections.isTopLevelOrStaticNestedClass(type.getJavaClass())) {
    throw BeanLogger.LOG.simpleBeanAsNonStaticInnerClassNotAllowed(type);
  }
}
origin: org.jboss.weld.se/weld-se

  @Override
  protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) {
    return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass();
  }
};
origin: jersey/jersey

private void buildInterceptionModel(EnhancedAnnotatedType<T> annotatedType, AbstractInstantiator<T> instantiator) {
  new InterceptionModelInitializer<>(beanManager, annotatedType, annotatedType.getDeclaredEnhancedConstructor(
      instantiator.getConstructorInjectionPoint().getSignature()), getBean()).init();
}
origin: org.jboss.weld.se/weld-se

public boolean isAbstract() {
  return delegate().isAbstract();
}
origin: weld/core

  @Override
  public Collection<EnhancedAnnotatedConstructor<?>> getMembersOfDeclaringType(MemberKey<?, AnnotatedConstructor<?>> source) {
    return cast(source.type.getConstructors());
  }
}
org.jboss.weld.annotated.enhancedEnhancedAnnotatedType

Javadoc

Represents a Class

Most used methods

  • getDeclaredEnhancedConstructor
    Get the constructor which matches the argument list provided
  • getJavaClass
  • getEnhancedMethod
    Get a method by name
  • getEnhancedMethods
    Gets all methods annotated with annotationType including those declared on a superclass of #getJavaC
  • getNoArgsEnhancedConstructor
    Gets the no-args constructor
  • isAbstract
  • isDiscovered
  • slim
    Returns a lightweight implementation of AnnotatedType with minimal memory footprint.
  • getConstructors
  • getDeclaredEnhancedFields
    Gets all fields which are annotated with the given annotation type on this class only.
  • getDeclaredEnhancedMethods
    Gets all methods annotated with annotationType
  • getDeclaredEnhancedMethodsWithAnnotatedParameters
    Gets declared with parameters annotated with annotationType
  • getDeclaredEnhancedMethods,
  • getDeclaredEnhancedMethodsWithAnnotatedParameters,
  • getDeclaredMetaAnnotations,
  • getEnhancedConstructors,
  • getEnhancedFields,
  • getEnhancedMethodsWithAnnotatedParameters,
  • getEnhancedSuperclass,
  • getFields,
  • getMethods,
  • getSimpleName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
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