beforeadvicemethodname.java

来自「这是一个学校老师和学生的管理系统,程序比较简单,但是几乎所有功能都可以实现,如果」· Java 代码 · 共 49 行

JAVA
49
字号
/**
 *******************************************************************************
 * BeforeAdviceMethodName.java
 *
 * (c) Copyright 2008 Hewlett-Packard Development Company, L.P.
 *
 *<Program Content>
 *  System Name : Students Management System
 *<Summarize>
 *  The file includes a class and the class main function is to prompt a message 
 *  before call a method. 
 *<Update Record>
 *  2009-5-6    1.00    zhangliy
 *******************************************************************************
 */
package com.hp.eds.zhangliyuan.stuMan.spring.advice;

import java.lang.reflect.Method;

import org.springframework.aop.MethodBeforeAdvice;

/**
 * The class main function is to prompt a message before call the getCourseList
 * method.
 * 
 * @author zhangliy
 * @version 1.0
 */
public class BeforeAdviceMethodName implements MethodBeforeAdvice {

	/**
	 * before invoke the method of getCourseList,prompt a message
	 * 
	 * @param method
	 * @param arg1
	 * @param arg2
	 * @throws Throwable
	 * @see org.springframework.aop.MethodBeforeAdvice#before(java.lang.reflect.Method,
	 *      java.lang.Object[], java.lang.Object)
	 */
	public void before(Method method, Object[] arg1, Object arg2)
			throws Throwable {
		System.out.println("-------------------------------------------");
		System.out.println("The current method name:"+method.getName());
		System.out.println("-------------------------------------------");
	}

}

⌨️ 快捷键说明

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