001/* 002 * Copyright 2002-2019 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.messaging.handler.annotation.support; 018 019import org.springframework.lang.Nullable; 020import org.springframework.messaging.converter.MessageConverter; 021import org.springframework.validation.Validator; 022 023/** 024 * A resolver to extract and convert the payload of a message using a 025 * {@link MessageConverter}. It also validates the payload using a 026 * {@link Validator} if the argument is annotated with a Validation annotation. 027 * 028 * @author Rossen Stoyanchev 029 * @author Juergen Hoeller 030 * @author Brian Clozel 031 * @author Stephane Nicoll 032 * @since 4.0 033 * @deprecated as of 5.2, in favor of {@link PayloadMethodArgumentResolver} 034 */ 035@Deprecated 036public class PayloadArgumentResolver extends PayloadMethodArgumentResolver { 037 038 /** 039 * Create a new {@code PayloadArgumentResolver} with the given 040 * {@link MessageConverter}. 041 * @param messageConverter the MessageConverter to use (required) 042 * @since 4.0.9 043 */ 044 public PayloadArgumentResolver(MessageConverter messageConverter) { 045 this(messageConverter, null); 046 } 047 048 /** 049 * Create a new {@code PayloadArgumentResolver} with the given 050 * {@link MessageConverter} and {@link Validator}. 051 * @param messageConverter the MessageConverter to use (required) 052 * @param validator the Validator to use (optional) 053 */ 054 public PayloadArgumentResolver(MessageConverter messageConverter, @Nullable Validator validator) { 055 this(messageConverter, validator, true); 056 } 057 058 /** 059 * Create a new {@code PayloadArgumentResolver} with the given 060 * {@link MessageConverter} and {@link Validator}. 061 * @param messageConverter the MessageConverter to use (required) 062 * @param validator the Validator to use (optional) 063 * @param useDefaultResolution if "true" (the default) this resolver supports 064 * all parameters; if "false" then only arguments with the {@code @Payload} 065 * annotation are supported. 066 */ 067 public PayloadArgumentResolver(MessageConverter messageConverter, @Nullable Validator validator, 068 boolean useDefaultResolution) { 069 070 071 super(messageConverter, validator, useDefaultResolution); 072 } 073 074}