Code example for Method

Methods: getExceptionTypesgetModifiersgetNamegetReturnType

0
     *  - cannot be static 
     * @see org.mortbay.jetty.plus.annotation.LifeCycleCallback#validate(java.lang.Class, java.lang.reflect.Method) 
     */ 
    public void validate(Class clazz, Method method)
    { 
        if (method.getExceptionTypes().length > 0)
            throw new IllegalArgumentException(clazz.getName()+"."+method.getName()+ " cannot not throw a checked exception");
         
        if (!method.getReturnType().equals(Void.TYPE))
            throw new IllegalArgumentException(clazz.getName()+"."+method.getName()+ " cannot not have a return type");
         
        if (Modifier.isStatic(method.getModifiers()))
            throw new IllegalArgumentException(clazz.getName()+"."+method.getName()+ " cannot be static");
    } 
     
     
    public void callback (Object instance)
    throws Exception 
    { 
        super.callback(instance);
Stop searching for code, let great code find you!  Add Codota to your java IDE