Code example for Method

Methods: getName, getParameterTypes, getReturnType

0
            return properties;
        } 
 
        @SuppressWarnings("unchecked") 
        private static void introspectGet(Method method, Map<String, Map<String, Object>> propertyMap) {
            String methodName = method.getName();
             
            if (!(method.getName().startsWith("get") || method.getName().startsWith("is")))
            	return; 
             
            if (method.getParameterTypes().length > 0 || method.getReturnType() == void.class)
            	return; 
             
            if (method.getName().startsWith("is") && method.getReturnType() != boolean.class)
            	return; 
 
            String propertyName = method.getName().startsWith("get") ? methodName.substring(3) : methodName.substring(2);
            propertyName = decapitalize(propertyName);
 
            Map<String, Object> table = propertyMap.get(propertyName);
            if (table == null) {
                table = new HashMap<String, Object>();
                propertyMap.put(propertyName, table);
            } 
 
            List<Method> getters = (List<Method>)table.get("getters");
            if (getters == null) {
                getters = new ArrayList<Method>();
                table.put("getters", getters);
            } 
            getters.add(method);
        } 
 
        @SuppressWarnings("unchecked") 
        private static void introspectSet(Method method, Map<String, Map<String, Object>> propertyMap) {
            String methodName = method.getName();