Mistři v programování na #hovnokod

Java #835

Duck typing v Jave (+ Springu)

public static boolean hasIdProperty(Object object) {
	try {
		BeanWrapper beanWrapper = PropertyAccessorFactory.forBeanPropertyAccess(object)
		beanWrapper.getPropertyValue("id");
		return true;
	} catch (BeansException e) {
		return false;
	}
}

Anonymous,