@ Override public void postProcessInstance ( ManagedClassSPI managedClass , Object instance ) { Config config = managedClass . getConfig ( ) ; if ( config == null ) { return ; } List < Config > fields = config . findChildren ( "instance-field" ) ; if ( ! fields . isEmpty ( ) && ! InstanceType . POJO . equals ( managedClass . getInstanceType ( ) ) ) { throw new BugError ( "Cannot assign instance field on non %s type." , InstanceType . POJO ) ; } for ( Config field : fields ) { Classes . setFieldValue ( instance , field . getAttribute ( "name" ) , field . getAttribute ( "value" ) ) ; } }
Initialize instance fields from managed class configuration object .