⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 annotationvalidationinterceptor.java

📁 struts 2 核心包 的源码 有错误是难免的
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   AnnotationValidationInterceptor.java

package org.apache.struts2.interceptor.validation;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
import java.lang.reflect.Method;

// Referenced classes of package org.apache.struts2.interceptor.validation:
//			SkipValidation

public class AnnotationValidationInterceptor extends ValidationInterceptor
{

	private static final long serialVersionUID = 0x192a0a0087f6f010L;

	public AnnotationValidationInterceptor()
	{
	}

	protected String doIntercept(ActionInvocation invocation)
		throws Exception
	{
		Object action = invocation.getAction();
		if (action != null)
		{
			Method method = getActionMethod(action.getClass(), invocation.getProxy().getMethod());
			SkipValidation skip = (SkipValidation)method.getAnnotation(org/apache/struts2/interceptor/validation/SkipValidation);
			if (skip != null)
				return invocation.invoke();
		}
		return super.doIntercept(invocation);
	}

	protected Method getActionMethod(Class actionClass, String methodName)
		throws NoSuchMethodException
	{
		Method method;
		try
		{
			method = actionClass.getMethod(methodName, new Class[0]);
		}
		catch (NoSuchMethodException e)
		{
			try
			{
				String altMethodName = (new StringBuilder()).append("do").append(methodName.substring(0, 1).toUpperCase()).append(methodName.substring(1)).toString();
				method = actionClass.getMethod(altMethodName, new Class[0]);
			}
			catch (NoSuchMethodException e1)
			{
				throw e;
			}
		}
		return method;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -