/** * Create a new type descriptor from a {@link ResolvableType}. * <p>This constructor is used internally and may also be used by subclasses * that support non-Java languages with extended type systems. It is public * as of 5.1.4 whereas it was protected before. * @param resolvableType the resolvable type * @param type the backing type (or {@code null} if it should get resolved) * @param annotations the type annotations * @since 4.0 */ public TypeDescriptor(ResolvableType resolvableType, @Nullable Class<?> type, @Nullable Annotation[] annotations) { this.resolvableType = resolvableType; this.type = (type != null ? type : resolvableType.toClass()); this.annotatedElement = new AnnotatedElementAdapter(annotations); }
/** * Create a new type descriptor from a {@link Field}. * <p>Use this constructor when a source or target conversion point is a field. * @param field the field */ public TypeDescriptor(Field field) { this.resolvableType = ResolvableType.forField(field); this.type = this.resolvableType.resolve(field.getType()); this.annotatedElement = new AnnotatedElementAdapter(field.getAnnotations()); }
/** * Create a new type descriptor from a {@link ResolvableType}. * <p>This constructor is used internally and may also be used by subclasses * that support non-Java languages with extended type systems. It is public * as of 5.1.4 whereas it was protected before. * @param resolvableType the resolvable type * @param type the backing type (or {@code null} if it should get resolved) * @param annotations the type annotations * @since 4.0 */ public TypeDescriptor(ResolvableType resolvableType, @Nullable Class<?> type, @Nullable Annotation[] annotations) { this.resolvableType = resolvableType; this.type = (type != null ? type : resolvableType.toClass()); this.annotatedElement = new AnnotatedElementAdapter(annotations); }
/** * Create a new type descriptor from a {@link ResolvableType}. * <p>This constructor is used internally and may also be used by subclasses * that support non-Java languages with extended type systems. It is public * as of 5.1.4 whereas it was protected before. * @param resolvableType the resolvable type * @param type the backing type (or {@code null} if it should get resolved) * @param annotations the type annotations * @since 4.0 */ public TypeDescriptor(ResolvableType resolvableType, @Nullable Class<?> type, @Nullable Annotation[] annotations) { this.resolvableType = resolvableType; this.type = (type != null ? type : resolvableType.toClass()); this.annotatedElement = new AnnotatedElementAdapter(annotations); }
/** * Create a new type descriptor from a {@link ResolvableType}. This protected * constructor is used internally and may also be used by subclasses that support * non-Java languages with extended type systems. * @param resolvableType the resolvable type * @param type the backing type (or {@code null} if it should get resolved) * @param annotations the type annotations * @since 4.0 */ protected TypeDescriptor(ResolvableType resolvableType, @Nullable Class<?> type, @Nullable Annotation[] annotations) { this.resolvableType = resolvableType; this.type = (type != null ? type : resolvableType.toClass()); this.annotatedElement = new AnnotatedElementAdapter(annotations); }
/** * Create a new type descriptor from a {@link Property}. * <p>Use this constructor when a source or target conversion point is a * property on a Java class. * @param property the property */ public TypeDescriptor(Property property) { Assert.notNull(property, "Property must not be null"); this.resolvableType = ResolvableType.forMethodParameter(property.getMethodParameter()); this.type = this.resolvableType.resolve(property.getType()); this.annotatedElement = new AnnotatedElementAdapter(property.getAnnotations()); }
/** * Create a new type descriptor from a {@link MethodParameter}. * <p>Use this constructor when a source or target conversion point is a * constructor parameter, method parameter, or method return value. * @param methodParameter the method parameter */ public TypeDescriptor(MethodParameter methodParameter) { this.resolvableType = ResolvableType.forMethodParameter(methodParameter); this.type = this.resolvableType.resolve(methodParameter.getNestedParameterType()); this.annotatedElement = new AnnotatedElementAdapter(methodParameter.getParameterIndex() == -1 ? methodParameter.getMethodAnnotations() : methodParameter.getParameterAnnotations()); }
/** * Create a new type descriptor from a {@link Field}. * <p>Use this constructor when a source or target conversion point is a field. * @param field the field */ public TypeDescriptor(Field field) { this.resolvableType = ResolvableType.forField(field); this.type = this.resolvableType.resolve(field.getType()); this.annotatedElement = new AnnotatedElementAdapter(field.getAnnotations()); }
/** * Create a new type descriptor from a {@link Property}. * <p>Use this constructor when a source or target conversion point is a * property on a Java class. * @param property the property */ public TypeDescriptor(Property property) { Assert.notNull(property, "Property must not be null"); this.resolvableType = ResolvableType.forMethodParameter(property.getMethodParameter()); this.type = this.resolvableType.resolve(property.getType()); this.annotatedElement = new AnnotatedElementAdapter(property.getAnnotations()); }
/** * Create a new type descriptor from a {@link Field}. * <p>Use this constructor when a source or target conversion point is a field. * @param field the field */ public TypeDescriptor(Field field) { this.resolvableType = ResolvableType.forField(field); this.type = this.resolvableType.resolve(field.getType()); this.annotatedElement = new AnnotatedElementAdapter(field.getAnnotations()); }
/** * Create a new type descriptor from a {@link MethodParameter}. * <p>Use this constructor when a source or target conversion point is a * constructor parameter, method parameter, or method return value. * @param methodParameter the method parameter */ public TypeDescriptor(MethodParameter methodParameter) { this.resolvableType = ResolvableType.forMethodParameter(methodParameter); this.type = this.resolvableType.resolve(methodParameter.getParameterType()); this.annotatedElement = new AnnotatedElementAdapter(methodParameter.getParameterIndex() == -1 ? methodParameter.getMethodAnnotations() : methodParameter.getParameterAnnotations()); }
/** * Create a new type descriptor from a {@link Property}. * <p>Use this constructor when a source or target conversion point is a * property on a Java class. * @param property the property */ public TypeDescriptor(Property property) { Assert.notNull(property, "Property must not be null"); this.resolvableType = ResolvableType.forMethodParameter(property.getMethodParameter()); this.type = this.resolvableType.resolve(property.getType()); this.annotatedElement = new AnnotatedElementAdapter(property.getAnnotations()); }
/** * Create a new type descriptor from a {@link MethodParameter}. * <p>Use this constructor when a source or target conversion point is a * constructor parameter, method parameter, or method return value. * @param methodParameter the method parameter */ public TypeDescriptor(MethodParameter methodParameter) { this.resolvableType = ResolvableType.forMethodParameter(methodParameter); this.type = this.resolvableType.resolve(methodParameter.getNestedParameterType()); this.annotatedElement = new AnnotatedElementAdapter(methodParameter.getParameterIndex() == -1 ? methodParameter.getMethodAnnotations() : methodParameter.getParameterAnnotations()); }
/** * Create a new type descriptor from a {@link Field}. * <p>Use this constructor when a source or target conversion point is a field. * @param field the field */ public TypeDescriptor(Field field) { this.resolvableType = ResolvableType.forField(field); this.type = this.resolvableType.resolve(field.getType()); this.annotatedElement = new AnnotatedElementAdapter(field.getAnnotations()); }
/** * Create a new type descriptor from a {@link MethodParameter}. * <p>Use this constructor when a source or target conversion point is a * constructor parameter, method parameter, or method return value. * @param methodParameter the method parameter */ public TypeDescriptor(MethodParameter methodParameter) { this.resolvableType = ResolvableType.forMethodParameter(methodParameter); this.type = this.resolvableType.resolve(methodParameter.getNestedParameterType()); this.annotatedElement = new AnnotatedElementAdapter(methodParameter.getParameterIndex() == -1 ? methodParameter.getMethodAnnotations() : methodParameter.getParameterAnnotations()); }
/** * Create a new type descriptor from a {@link Property}. * <p>Use this constructor when a source or target conversion point is a * property on a Java class. * @param property the property */ public TypeDescriptor(Property property) { Assert.notNull(property, "Property must not be null"); this.resolvableType = ResolvableType.forMethodParameter(property.getMethodParameter()); this.type = this.resolvableType.resolve(property.getType()); this.annotatedElement = new AnnotatedElementAdapter(property.getAnnotations()); }