public static SpringPropertyProxy proxyFor ( Class < ? > beanType , boolean useDirectFieldAccess , ConversionService conversionService ) { if ( PropertyProxyUtils . hasAmfCreator ( beanType ) ) { SpringPropertyProxy proxy = new DelayedWriteSpringPropertyProxy ( beanType , useDirectFieldAccess , conversionService ) ; return proxy ; } else { Assert . isTrue ( beanType . isEnum ( ) || ClassUtils . hasConstructor ( beanType ) , "Failed to create SpringPropertyProxy for " + beanType . getName ( ) + " - Classes mapped " + "for deserialization from AMF must have either a no-arg default constructor, " + "or a constructor annotated with " + AmfCreator . class . getName ( ) ) ; SpringPropertyProxy proxy = new SpringPropertyProxy ( beanType , useDirectFieldAccess , conversionService ) ; try { //If possible, create an instance to introspect and cache the property names Object instance = BeanUtils . instantiate ( beanType ) ; proxy . setPropertyNames ( PropertyProxyUtils . findPropertyNames ( conversionService , useDirectFieldAccess , instance ) ) ; } catch ( BeanInstantiationException ex ) { //Property names can't be cached, but this is ok } return proxy ; } }
Factory method for creating correctly configured Spring property proxy instances .