Package org.apache.webbeans.exception.helper

Examples of org.apache.webbeans.exception.helper.ViolationMessageBuilder.addLine()


                if(!beanClass.isInterface() && beanClass != Object.class)
                {
                    if(ClassUtil.isPrimitive(beanClass))
                    {
                        violationMessage.addLine("It isn't possible to use a primitive type (" + beanClass.getName(), ")");
                    }

                    if(ClassUtil.isArray(beanClass))
                    {
                        violationMessage.addLine("It isn't possible to use an array type (", beanClass.getName(), ")");
View Full Code Here


                        violationMessage.addLine("It isn't possible to use a primitive type (" + beanClass.getName(), ")");
                    }

                    if(ClassUtil.isArray(beanClass))
                    {
                        violationMessage.addLine("It isn't possible to use an array type (", beanClass.getName(), ")");
                    }

                    if(!violationMessage.containsViolation())
                    {
                        Constructor<?> cons = ClassUtil.isContaintNoArgConstructor(beanClass);
View Full Code Here

                    {
                        Constructor<?> cons = ClassUtil.isContaintNoArgConstructor(beanClass);

                        if (ClassUtil.isFinal(beanClass.getModifiers()))
                        {
                            violationMessage.addLine(beanClass.getName(), " is a final class! CDI doesn't allow that.");
                        }
                        if (ClassUtil.hasFinalMethod(beanClass))
                        {
                            violationMessage.addLine(beanClass.getName(), " has final methods! CDI doesn't allow that.");
                        }
View Full Code Here

                        {
                            violationMessage.addLine(beanClass.getName(), " is a final class! CDI doesn't allow that.");
                        }
                        if (ClassUtil.hasFinalMethod(beanClass))
                        {
                            violationMessage.addLine(beanClass.getName(), " has final methods! CDI doesn't allow that.");
                        }
                        if (cons == null)
                        {
                            violationMessage.addLine(beanClass.getName(), " has no explicit no-arg constructor!",
                                    "A public or protected constructor without args is required!");
View Full Code Here

                        {
                            violationMessage.addLine(beanClass.getName(), " has final methods! CDI doesn't allow that.");
                        }
                        if (cons == null)
                        {
                            violationMessage.addLine(beanClass.getName(), " has no explicit no-arg constructor!",
                                    "A public or protected constructor without args is required!");
                        }
                        else if (ClassUtil.isPrivate(cons.getModifiers()))
                        {
                            violationMessage.addLine(beanClass.getName(), " has a >private< no-arg constructor! CDI doesn't allow that.");
View Full Code Here

                            violationMessage.addLine(beanClass.getName(), " has no explicit no-arg constructor!",
                                    "A public or protected constructor without args is required!");
                        }
                        else if (ClassUtil.isPrivate(cons.getModifiers()))
                        {
                            violationMessage.addLine(beanClass.getName(), " has a >private< no-arg constructor! CDI doesn't allow that.");
                        }
                    }

                    //Throw Exception
                    if(violationMessage.containsViolation())
View Full Code Here

    public static void throwBeanNotFoundException(Class type, Annotation... qualifiers)
    {
        ViolationMessageBuilder violationMessage =
                newViolation("Cannot find beans for class ", type.getCanonicalName());

        violationMessage.addLine(createQualifierMessage(qualifiers));

        throw new ResolutionException(violationMessage.toString());
    }

    public static void throwUnsatisfiedResolutionException(String message, Method producerMethod)
View Full Code Here

    public static void throwUnsatisfiedResolutionException(String message, Method producerMethod)
    {
        ViolationMessageBuilder violationMessage = newViolation(message);

        violationMessage.addLine(createProducerMethodMessage(producerMethod));

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }

    public static void throwUnsatisfiedResolutionException(Type type, Method producerMethod, Annotation... qualifiers)
View Full Code Here

    public static void throwUnsatisfiedResolutionException(Type type, Method producerMethod, Annotation... qualifiers)
    {
        ViolationMessageBuilder violationMessage = newViolation(createProducerMethodMessage(producerMethod));

        violationMessage.append(" in class: ", ClassUtil.getClass(type).getName());
        violationMessage.addLine(createQualifierMessage(qualifiers));

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }

    private static String createProducerMethodMessage(Method producerMethod)
View Full Code Here

            Class type, InjectionPoint injectionPoint, Annotation... qualifiers)
    {
        ViolationMessageBuilder violationMessage =
                newViolation("Api type [", type.getName(), "] is not found with the qualifiers ");

        violationMessage.addLine(createQualifierMessage(qualifiers));

        if (injectionPoint != null)
        {
            violationMessage.addLine("for injection into ", injectionPoint.toString());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.