public Class<T> getJavaClass() { return delegate().getJavaClass(); }
public Class<T> getJavaClass() { return delegate().getJavaClass(); }
/** * Illegal bean types are ignored except for array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
/** * Illegal bean types are ignored except for array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
/** * Illegal bean types are ignored except for array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
/** * Illegal bean types are ignored except fo array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
/** * Illegal bean types are ignored except for array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
/** * Illegal bean types are ignored except for array and primitive types and unless {@link Typed} is used. * * @return the set of bean types from an annotated element */ public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) { // array and primitive types require special treatment if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) { return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build(); } else { if (annotated.isAnnotationPresent(Typed.class)) { return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()), annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build(); } else { if (annotated.getJavaClass().isInterface()) { return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class); } return getLegalBeanTypes(annotated.getTypeClosure(), annotated); } } }
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; } }
types.addAll(getTypedTypes(typeMap, annotated.getJavaClass(), annotated.getAnnotation(Typed.class))); } else { typeMap.put(Object.class, Object.class);
types.addAll(Beans.getTypedTypes(typeMap, annotated.getJavaClass(), annotated.getAnnotation(Typed.class))); } else { typeMap.put(Object.class, Object.class);