Examples of AnnotationData


Examples of org.crank.core.AnnotationData

        boolean found = map.get( "domainValidation" ) != null;
        boolean sameLevel = false;
        boolean noArgs = false;

        if (found) {
            AnnotationData ad = (AnnotationData) map.get( "domainValidation" );
            Object parentReference = ad.getValues().get("parentProperty");
            Object validator = null;

            if ((parentReference != null) && (!"".equals(parentReference))) {
                // If the parentProperty is specified, then find the parent class
             
                BeanWrapper wrapper = new BeanWrapperImpl(child);
                validator = wrapper.getPropertyValue( (String)parentReference );

            } else {
              // Otherwise, the validation method is assumed to be in the child
              validator = child;
              sameLevel = true;
            }
           
            noArgs = (Boolean) ad.getValues().get("global");
           
            // Make sure the method exists
          Method m = null;

          if (validator != null) {
              try {
               
                String methodName = (String)ad.getValues().get("method");

                if (noArgs) {
                    m = validator.getClass().getDeclaredMethod(methodName);
                } else if (sameLevel) {
                    Class[] parameters=new Class[1];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.