All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.taymindis.test.Testing Maven / Gradle / Ivy

Go to download

Page as a service for JSP to standardize the function by jsp page, guarantee zero downtime

The newest version!
package com.github.taymindis.test;

import com.github.taymindis.paas.Event;
import com.github.taymindis.paas.EventTransaction;
import com.github.taymindis.paas.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Testing {
//
//    @TestSetter
//    private void setValue(String value) {}
//
//    @TestSetter
//    public void setString(String value) {}

    @hook
    public void asdasdasd(String xx, @param("loginName") int a) {


    }

    public static void main(String... args) throws Exception {
        Testing t = new Testing();


        try {

            if(true) throw new Exception("Error!!!!!!!!!!!!!!!");
            Method[] ms = Testing.class.getDeclaredMethods();

            for (Method m : ms) {
                Annotation[][] paramAnnotation = m.getParameterAnnotations();
                Class[] parameterTypes = m.getParameterTypes();
                if (m.isAnnotationPresent(hook.class)) {
                    for (int i = 0, sz = paramAnnotation.length; i < sz; i++) {
                        Annotation[] as = paramAnnotation[i];
                        Annotation a;
                        Class c;
                        if (as.length > 0 && (a = as[0]) != null) {
                            Class atype = a.annotationType();
                        } else if ((c = parameterTypes[i]).isAssignableFrom(HttpServletRequest.class)) {
                            System.out.println("asdasd");
                        } else if (c.isAssignableFrom(HttpServletResponse.class)) {
                            System.out.println("asdasd");
                        } else if (c.isAssignableFrom(EventTransaction.class) || c.isAssignableFrom(Event.class)) {
                            System.out.println("asdasd");
                        }
                    }

                }
            }
        } finally {
            System.out.println("Still Reaching");
        }


    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy