net.jrouter.ParameterConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jrouter Show documentation
Show all versions of jrouter Show documentation
jrouter是一个围绕对象方法基于责任链(拦截器)模式设计的开源轻量级Java容器。它专注于方法的映射、调用、拦截和结果处理,采用基于配置和注解的方式来抽取和收集程序中对象的方法(method)以用于路由映射,HTTP控制器,RPC,各种应用等。
The newest version!
/*
* Copyright (C) 2010-2111 [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package net.jrouter;
import java.lang.reflect.Method;
import net.jrouter.annotation.Dynamic;
/**
* 提供方法参数转换器。
*/
@Dynamic
public interface ParameterConverter {
/**
* 传递底层方法、调用对象及原有的参数,返回转换处理后的调用参数。
* 原调用参数由ActionFactory的invokeAction方法指定传递。
*
* @param method {@code Method}对象。
* @param obj 调用方法的对象。
* @param originalParams 传递于方法调用的原参数。
* @param convertParams 提供给转换器的参数。
*
* @return 转换处理后的调用参数。
*
* @throws JRouterException 如果发生转换异常。
* @see ActionFactory#invokeAction(java.lang.Object, java.lang.Object...)
*/
Object[] convert(Method method, Object obj, Object[] originalParams, Object[] convertParams) throws JRouterException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy