private Class<? extends Annotation> initScope() { if (scope != null) { return scope; } if (!stereotypes.isEmpty()) { MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); Set<Annotation> possibleScopeTypes = new HashSet<>(); for (Class<? extends Annotation> stereotype : stereotypes) { StereotypeModel<? extends Annotation> model = metaAnnotationStore.getStereotype(stereotype); if (model.isValid()) { possibleScopeTypes.add(model.getDefaultScopeType()); } else { throw BeanManagerLogger.LOG.notStereotype(stereotype); } } if (possibleScopeTypes.size() == 1) { return possibleScopeTypes.iterator().next().annotationType(); } else { throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(BeanAttributesConfigurator.class.getSimpleName(), Formats.formatTypes(stereotypes, false), possibleScopeTypes, ""); } } return Dependent.class; }
private Class<? extends Annotation> initScope() { if (scope != null) { return scope; } if (!stereotypes.isEmpty()) { MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); Set<Annotation> possibleScopeTypes = new HashSet<>(); for (Class<? extends Annotation> stereotype : stereotypes) { StereotypeModel<? extends Annotation> model = metaAnnotationStore.getStereotype(stereotype); if (model.isValid()) { possibleScopeTypes.add(model.getDefaultScopeType()); } else { throw BeanManagerLogger.LOG.notStereotype(stereotype); } } if (possibleScopeTypes.size() == 1) { return possibleScopeTypes.iterator().next().annotationType(); } else { throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(BeanAttributesConfigurator.class.getSimpleName(), Formats.formatTypes(stereotypes, false), possibleScopeTypes, ""); } } return Dependent.class; }
private Class<? extends Annotation> initScope() { if (scope != null) { return scope; } if (!stereotypes.isEmpty()) { MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); Set<Annotation> possibleScopeTypes = new HashSet<>(); for (Class<? extends Annotation> stereotype : stereotypes) { StereotypeModel<? extends Annotation> model = metaAnnotationStore.getStereotype(stereotype); if (model.isValid()) { possibleScopeTypes.add(model.getDefaultScopeType()); } else { throw BeanManagerLogger.LOG.notStereotype(stereotype); } } if (possibleScopeTypes.size() == 1) { return possibleScopeTypes.iterator().next().annotationType(); } else { throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(BeanAttributesConfigurator.class.getSimpleName(), Formats.formatTypes(stereotypes, false), possibleScopeTypes, ""); } } return Dependent.class; }
private Class<? extends Annotation> initScope() { if (scope != null) { return scope; } if (!stereotypes.isEmpty()) { MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); Set<Annotation> possibleScopeTypes = new HashSet<>(); for (Class<? extends Annotation> stereotype : stereotypes) { StereotypeModel<? extends Annotation> model = metaAnnotationStore.getStereotype(stereotype); if (model.isValid()) { possibleScopeTypes.add(model.getDefaultScopeType()); } else { throw BeanManagerLogger.LOG.notStereotype(stereotype); } } if (possibleScopeTypes.size() == 1) { return possibleScopeTypes.iterator().next().annotationType(); } else { throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(BeanAttributesConfigurator.class.getSimpleName(), Formats.formatTypes(stereotypes, false), possibleScopeTypes, ""); } } return Dependent.class; }
private Class<? extends Annotation> initScope() { if (scope != null) { return scope; } if (!stereotypes.isEmpty()) { MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); Set<Annotation> possibleScopeTypes = new HashSet<>(); for (Class<? extends Annotation> stereotype : stereotypes) { StereotypeModel<? extends Annotation> model = metaAnnotationStore.getStereotype(stereotype); if (model.isValid()) { possibleScopeTypes.add(model.getDefaultScopeType()); } else { throw BeanManagerLogger.LOG.notStereotype(stereotype); } } if (possibleScopeTypes.size() == 1) { return possibleScopeTypes.iterator().next().annotationType(); } else { throw BeanLogger.LOG.multipleScopesFoundFromStereotypes(BeanAttributesConfigurator.class.getSimpleName(), Formats.formatTypes(stereotypes, false), possibleScopeTypes, ""); } } return Dependent.class; }
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; } }
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; } }
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; } }
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; } }
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; } }
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; } }