public synchronized void setInitializationMethod(String newMethodName)
    {
        Method newMethod = null;
        if (newMethodName != null)
        {
            initializationMethodName = newMethodName;
            try
            {
                // see if we have a publicly accessible method by the name
                newMethod = getClassOfObject().getMethod(newMethodName, NO_PARAMS);
            }
            catch (NoSuchMethodException e)
            {
                try
                {
                    // no publicly accessible method, see if there is a private/protected one
                    newMethod = getClassOfObject().getDeclaredMethod(newMethodName, NO_PARAMS);
                }
                catch (NoSuchMethodException e2)
                {
                    // there is no such method available
                    throw new MetadataException(
                        "Invalid initialization method, there is not"
                            + " a zero argument method named "
                            + newMethodName
                            + " on class "
                            + getClassOfObject().getName()
                            + ".");
                }
            }
        }
        setInitializationMethod(newMethod);
    }
public synchronized void setInitializationMethod ( String newMethodName ) { Method newMethod = null ; if ( newMethodName != null ) { initializationMethodName = newMethodName ; try { newMethod = getClassOfObject ( ) . getMethod ( newMethodName , NO_PARAMS ) ; } catch ( NoSuchMethodException e ) { try { newMethod = getClassOfObject ( ) . getDeclaredMethod ( newMethodName , NO_PARAMS ) ; } catch ( NoSuchMethodException e2 ) { throw new MetadataException ( "Invalid initialization method, there is not" + " a zero argument method named " + newMethodName + " on class " + getClassOfObject ( ) . getName ( ) + "." ) ; } } } setInitializationMethod ( newMethod ) ; }
sets the initialization method for this descriptor by name