Package com.et.ar.annotations

Examples of com.et.ar.annotations.ValidatorClass


        }
        try{
            for(Field f: clasz.getDeclaredFields()){
                f.setAccessible(true);
                for(Annotation aa: f.getDeclaredAnnotations()){
                    ValidatorClass validatorClass = aa.annotationType().getAnnotation(ValidatorClass.class);
                    if (validatorClass != null){
                        Class<?> vc = validatorClass.value();
                        Object instance = vc.newInstance(); //创建验证类实例
                        vc.getMethod("init", Object.class).invoke(instance, aa);
                        boolean result = (Boolean)vc.getMethod("validate", Object.class).invoke(instance, f.get(this));
                        if (result == false){
                            String err = (String)vc.getMethod("getMessage").invoke(instance);
View Full Code Here

TOP

Related Classes of com.et.ar.annotations.ValidatorClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.