예제 #1
0
 public void setReadMethod(java.lang.reflect.Method getter)
 {
     //throws IntrospectionException {
     if (getter != null)
     {
         int modifiers = getter.getModifiers();
         if (!java.lang.reflect.Modifier.isPublic(modifiers))
         {
             throw new IntrospectionException("Modifier for getter method should be public.");//Messages.getString("beans.0A")); //$NON-NLS-1$
         }
         java.lang.Class[] parameterTypes = getter.getParameterTypes();
         if (parameterTypes.Length != 0)
         {
             throw new IntrospectionException("Number of parameters in getter method is not equal to 0.");//Messages.getString("beans.08")); //$NON-NLS-1$
         }
         java.lang.Class returnType = getter.getReturnType();
         if (returnType.equals(java.lang.Void.TYPE))
         {
             throw new IntrospectionException("{0} does not return <void>");//Messages.getString("beans.33")); //$NON-NLS-1$
         }
         java.lang.Class propertyType = getPropertyType();
         if ((propertyType != null) && !returnType.equals(propertyType))
         {
             throw new IntrospectionException("Parameter type in getter method does not corresponds to predefined.");//Messages.getString("beans.09")); //$NON-NLS-1$
         }
     }
     this.getter = getter;
 }