Exemplo n.º 1
0
 public void setWriteMethod(java.lang.reflect.Method setter)
 {
     //throws IntrospectionException {
     if (setter != null)
     {
         int modifiers = setter.getModifiers();
         if (!java.lang.reflect.Modifier.isPublic(modifiers))
         {
             throw new IntrospectionException("Modifier for setter method should be public.");//Messages.getString("beans.05")); //$NON-NLS-1$
         }
         java.lang.Class[] parameterTypes = setter.getParameterTypes();
         if (parameterTypes.Length != 1)
         {
             throw new IntrospectionException("Number of parameters in setter method is not equal to 1.");//Messages.getString("beans.06")); //$NON-NLS-1$
         }
         java.lang.Class parameterType = parameterTypes[0];
         java.lang.Class propertyType = getPropertyType();
         if (propertyType != null && !propertyType.equals(parameterType))
         {
             throw new IntrospectionException("Parameter type in setter method does not corresponds to predefined.");//Messages.getString("beans.07")); //$NON-NLS-1$
         }
     }
     this.setter = setter;
 }
Exemplo n.º 2
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;
 }