/*
 * Copyright (C) 2008 feilong
 *
 * 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 com.feilong.spring.web.method;

import java.lang.reflect.Method;

import org.springframework.web.method.HandlerMethod;

/**
 * The Class HandlerMethodUtil.
 *
 * @author <a href="http://feitianbenyue.iteye.com/">feilong</a>
 * @since 1.4.0
 */
public class HandlerMethodUtil{

    /** Don't let anyone instantiate this class. */
    private HandlerMethodUtil(){
        //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.
        //see 《Effective Java》 2nd
        throw new AssertionError("No " + getClass().getName() + " instances for you!");
    }

    /**
     * 获得 handler method name.
     *
     * @param handlerMethod
     *            the handler method
     * @return the handler method name
     */
    public static String getHandlerMethodName(HandlerMethod handlerMethod){
        Method method = handlerMethod.getMethod();
        return method.getName();
    }

    /**
     * 获得 declaring class simple name.
     *
     * @param handlerMethod
     *            the handler method
     * @return the declaring class simple name
     */
    public static String getDeclaringClassSimpleName(HandlerMethod handlerMethod){
        Method method = handlerMethod.getMethod();
        return method.getDeclaringClass().getSimpleName();
    }
}

@@ -662,24 +662,66 @@
 ct.Method;%0A%0A
+import org.apache.commons.lang3.Validate;%0A
 import org.s
@@ -773,17 +773,14 @@
 %0A * 
-The Class
+%7B@link
  Han
@@ -789,20 +789,22 @@
 erMethod
-Util
+%7D %E7%9A%84%E5%B7%A5%E5%85%B7%E7%B1%BB
 .%0A *%0A * 
@@ -892,16 +892,22 @@
 %0Apublic 
+final 
 class Ha
@@ -1219,40 +1219,95 @@
    /
-**%0A     * %E8%8E%B7%E5%BE%97 handler method name
+/---------------------------------------------------------------%0A%0A    /**%0A     * %E8%8E%B7%E5%BE%97%E6%96%B9%E6%B3%95%E5%90%8D%E7%A7%B0
 .%0A  
@@ -1395,31 +1395,79 @@
 urn 
-the 
+%E5%A6%82%E6%9E%9C %3Ccode%3E
 handler
- m
+M
 ethod
- name
+%3C/code%3E %E6%98%AFnull,%E6%8A%9B%E5%87%BA %7B@link NullPointerException%7D%3Cbr%3E
 %0A   
@@ -1539,32 +1539,106 @@
 handlerMethod)%7B%0A
+        Validate.notNull(handlerMethod, %22handlerMethod can't be null!%22);%0A%0A
         Method m
@@ -1733,36 +1733,13 @@
 * %E8%8E%B7%E5%BE%97
- declaring class simple name
+%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%90%8D%E7%A7%B0
 .%0A  
@@ -1827,39 +1827,79 @@
 urn 
-the declaring class simple name
+%E5%A6%82%E6%9E%9C %3Ccode%3EhandlerMethod%3C/code%3E %E6%98%AFnull,%E6%8A%9B%E5%87%BA %7B@link NullPointerException%7D%3Cbr%3E
 %0A   
@@ -1978,32 +1978,106 @@
 handlerMethod)%7B%0A
+        Validate.notNull(handlerMethod, %22handlerMethod can't be null!%22);%0A%0A
         Method m

update javadoc