public BaseImmutableBean()

in deltaspike/core/api/obsolete/src/main/java/org/apache/deltaspike/core/util/bean/BaseImmutableBean.java [83:182]


    public BaseImmutableBean(Class<?> beanClass,
                             String name,
                             Set<Annotation> qualifiers,
                             Class<? extends Annotation> scope,
                             Set<Class<? extends Annotation>> stereotypes,
                             Set<Type> types,
                             boolean alternative,
                             boolean nullable,
                             Set<InjectionPoint> injectionPoints,
                             String toString)
    {
        if (beanClass == null)
        {
            throw new IllegalArgumentException("beanClass cannot be null");
        }

        this.beanClass = beanClass;
        this.name = name;

        if (qualifiers == null)
        {
            this.qualifiers = Collections.<Annotation>singleton(new DefaultLiteral());

            LOG.finest("No qualifers provided for bean class " + beanClass + ", using singleton set of @Default");
        }
        else
        {
            this.qualifiers = new HashSet<Annotation>(qualifiers);
        }

        if (scope == null)
        {
            this.scope = Dependent.class;

            LOG.finest("No scope provided for bean class " + beanClass + ", using @Dependent");
        }
        else
        {
            this.scope = scope;
        }

        if (stereotypes == null)
        {
            this.stereotypes = Collections.emptySet();
        }
        else
        {
            this.stereotypes = new HashSet<Class<? extends Annotation>>(stereotypes);
        }

        if (types == null)
        {
            //noinspection unchecked
            this.types = ArraysUtils.<Type>asSet(Object.class, beanClass);

            LOG.finest("No types provided for bean class " + beanClass
                    + ", using [java.lang.Object.class, " + beanClass.getName()
                    + ".class]");
        }
        else
        {
            this.types = new HashSet<Type>(types);
        }

        if (injectionPoints == null)
        {
            this.injectionPoints = Collections.emptySet();
        }
        else
        {
            // Check for null Beans, wrap if there isn't one -- DELTASPIKE-400
            final HashSet<InjectionPoint> ips = new HashSet<InjectionPoint>(injectionPoints.size());

            for (InjectionPoint ip : injectionPoints)
            {
                if (ip.getBean() == null)
                {
                    ips.add(new InjectionPointWrapper(ip, this));
                }
                else
                {
                    ips.add(ip);
                }
            }

            this.injectionPoints = ips;
        }

        this.alternative = alternative;
        this.nullable = nullable;

        if (toString != null)
        {
            this.toString = toString;
        }
        else
        {
            this.toString = "Custom Bean with bean class " + beanClass + " and qualifiers " + qualifiers;
        }
    }