Package org.apache.deltaspike.core.api.literal

Examples of org.apache.deltaspike.core.api.literal.AnyLiteral


        return new HashSet<Type>(Arrays.asList(Object.class, CamelContext.class, CdiCamelContext.class));
    }

    @Override
    public Set<Annotation> getQualifiers() {
        return new HashSet<Annotation>(Arrays.asList(new DefaultLiteral(), new AnyLiteral()));
    }
View Full Code Here


        }
        if (qualifiers.isEmpty())
        {
            qualifiers.add(new DefaultLiteral());
        }
        qualifiers.add(new AnyLiteral());
        this.id = ImmutableBeanWrapper.class.getName() + ":" + Annotateds.createTypeId(type);
        return this;
    }
View Full Code Here

    private static <T> Set<Bean<T>> getBeanDefinitions(Class<T> type,
                                                       boolean optional,
                                                       boolean includeDefaultScopedBeans,
                                                       BeanManager beanManager)
    {
        Set<Bean<?>> beans = beanManager.getBeans(type, new AnyLiteral());

        if (beans == null || beans.isEmpty())
        {
            if (optional)
            {
View Full Code Here

            {
                for (HandlerMethod<?> handler : allHandlers.get(hierarchyType))
                {
                    if (handler.isBeforeHandler() && isBefore)
                    {
                        if (handler.getQualifiers().contains(new AnyLiteral()))
                        {
                            returningHandlers.add(handler);
                        }
                        else
                        {
                            if (!handlerQualifiers.isEmpty() && handlerQualifiers.equals(handler.getQualifiers()))
                            {
                                returningHandlers.add(handler);
                            }
                        }
                    }
                    else if (!handler.isBeforeHandler() && !isBefore)
                    {
                        if (handler.getQualifiers().contains(new AnyLiteral()))
                        {
                            returningHandlers.add(handler);
                        }
                        else
                        {
View Full Code Here

        {
            // Different qualifiers
            if (lhs.getExceptionType().equals(rhs.getExceptionType())
                    && !lhs.getQualifiers().equals(rhs.getQualifiers()))
            {
                if (lhs.getQualifiers().contains(new AnyLiteral()))
                {
                    return -1; // Make sure @Any is first, as it's less specific
                }
                return 1;
            }
View Full Code Here

        }
        if (qualifiers.isEmpty())
        {
            qualifiers.add(new DefaultLiteral());
        }
        qualifiers.add(new AnyLiteral());
        this.name = "".equals(name) ? null : name;
        this.scope = scope;
        alternative = type.isAnnotationPresent(Alternative.class);
        return this;
    }
View Full Code Here

    public void modifyAnnotationsOnConstructorParameter() throws NoSuchMethodException
    {
        final AnnotatedTypeBuilder<Cat> builder = new AnnotatedTypeBuilder<Cat>();
        builder.readFromType(Cat.class, true);
        builder.removeFromConstructorParameter(Cat.class.getConstructor(String.class, String.class), 1, Default.class);
        builder.addToConstructorParameter(Cat.class.getConstructor(String.class, String.class), 1, new AnyLiteral());

        final AnnotatedType<Cat> catAnnotatedType = builder.create();
        Set<AnnotatedConstructor<Cat>> catCtors = catAnnotatedType.getConstructors();

        assertThat(catCtors.size(), is(2));

        for (AnnotatedConstructor<Cat> ctor : catCtors)
        {
            if (ctor.getParameters().size() == 2)
            {
                List<AnnotatedParameter<Cat>> ctorParams = ctor.getParameters();

                assertThat(ctorParams.get(1).getAnnotations().size(), is(1));
                assertThat((AnyLiteral) ctorParams.get(1).getAnnotations().toArray()[0], is(new AnyLiteral()));
            }
        }
    }
View Full Code Here

                final ImmutableBeanWrapper<T> result = super.create();

                String beanName = createBeanName(result.getTypes());

                Set<Annotation> qualifiers = new HashSet<Annotation>();
                qualifiers.add(new AnyLiteral());
                qualifiers.add(namedTypedMessageBundle);

                if (isPassivationCapable())
                {
                    return new ImmutablePassivationCapableBeanWrapper<T>(result,
View Full Code Here

        tmpQualifiers.addAll(BeanUtils.getQualifiers(bm, handlerParameter.getAnnotations()));

        if (tmpQualifiers.isEmpty())
        {
            tmpQualifiers.add(new AnyLiteral());
        }

        qualifiers = tmpQualifiers;
        declaringBeanClass = method.getJavaMember().getDeclaringClass();
        exceptionType = ((ParameterizedType) handlerParameter.getBaseType()).getActualTypeArguments()[0];
View Full Code Here

        {
            Class<? extends MessageResolver> messageResolverClass =
                    ClassUtils.tryToLoadClassForName(messageContextConfig.messageResolver().getName());

            messageContext.messageResolver(
                    BeanProvider.getContextualReference(messageResolverClass, new AnyLiteral()));
        }

        if (!MessageInterpolator.class.equals(messageContextConfig.messageInterpolator()))
        {
            Class<? extends MessageInterpolator> messageInterpolatorClass =
                    ClassUtils.tryToLoadClassForName(messageContextConfig.messageInterpolator().getName());

            messageContext.messageInterpolator(
                    BeanProvider.getContextualReference(messageInterpolatorClass, new AnyLiteral()));
        }

        if (!LocaleResolver.class.equals(messageContextConfig.localeResolver()))
        {
            Class<? extends LocaleResolver> localeResolverClass =
                    ClassUtils.tryToLoadClassForName(messageContextConfig.localeResolver().getName());

            messageContext.localeResolver(
                    BeanProvider.getContextualReference(localeResolverClass, new AnyLiteral()));
        }
       
        String[] messageSources = messageContextConfig.messageSource();
        messageContext.messageSource(messageSources);
View Full Code Here

TOP

Related Classes of org.apache.deltaspike.core.api.literal.AnyLiteral

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.