private synchronized void setInitializationMethod ( Method newMethod ) { if ( newMethod != null ) { // make sure it's a no argument method if ( newMethod . getParameterTypes ( ) . length > 0 ) { throw new MetadataException ( "Initialization methods must be zero argument methods: " + newMethod . getClass ( ) . getName ( ) + "." + newMethod . getName ( ) ) ; } // make it accessible if it's not already if ( ! newMethod . isAccessible ( ) ) { newMethod . setAccessible ( true ) ; } } this . initializationMethod = newMethod ; }
sets the initialization method for this descriptor