result = new MappedPropertyDescriptor(name, bean.getClass()); } catch (final IntrospectionException ie) {
if (((MappedPropertyDescriptor) descriptor).getMappedWriteMethod() == null) { if (log.isDebugEnabled()) { log.debug("Skipping read-only property"); getMappedPropertyType(); } else if (index >= 0 && descriptor instanceof IndexedPropertyDescriptor) { if (((IndexedPropertyDescriptor) descriptor).getIndexedWriteMethod() == null) {
final Method mappedReadMethod = getMappedReadMethod(); final Method mappedWriteMethod = getMappedWriteMethod(); Class<?> mappedPropertyType = null; if (mappedReadMethod != null) {
propertyName); setName(propertyName); Method mappedWriteMethod = null; mappedReadMethod = getMethod(beanClass, mappedGetterName, STRING_CLASS_PARAMETER); getMethod(beanClass, mappedSetterName, params); } else { mappedWriteMethod = getMethod(beanClass, mappedSetterName, 2); findMappedPropertyType();
setName(propertyName); final String base = capitalizePropertyName(propertyName); try { try { mappedReadMethod = getMethod(beanClass, "get" + base, STRING_CLASS_PARAMETER); } catch (final IntrospectionException e) { mappedReadMethod = getMethod(beanClass, "is" + base, STRING_CLASS_PARAMETER); mappedWriteMethod = getMethod(beanClass, "set" + base, params); } catch (final IntrospectionException e) { mappedWriteMethod = getMethod(beanClass, "set" + base, 2); mappedWriteMethodRef = new MappedMethodReference(mappedWriteMethod); findMappedPropertyType();
/** * This constructor takes the name of a mapped property, and Method * objects for reading and writing the property. * * @param propertyName The programmatic name of the property. * @param mappedGetter The method used for reading one of * the property values. May be be null if the property * is write-only. * @param mappedSetter The method used for writing one the * property values. May be null if the property is read-only. * * @throws IntrospectionException if an exception occurs during * introspection. */ public MappedPropertyDescriptor(final String propertyName, final Method mappedGetter, final Method mappedSetter) throws IntrospectionException { super(propertyName, mappedGetter, mappedSetter); if (propertyName == null || propertyName.length() == 0) { throw new IntrospectionException("bad property name: " + propertyName); } setName(propertyName); mappedReadMethodRef = new MappedMethodReference(mappedGetter); mappedWriteMethodRef = new MappedMethodReference(mappedSetter); findMappedPropertyType(); }
getMappedReadMethod(); readMethod = MethodUtils.getAccessibleMethod(bean.getClass(), readMethod); if (readMethod != null) {
} else if (descriptor instanceof MappedPropertyDescriptor) { return (((MappedPropertyDescriptor) descriptor). getMappedPropertyType()); } else { return (descriptor.getPropertyType());
getMappedWriteMethod(); mappedWriteMethod = MethodUtils.getAccessibleMethod(bean.getClass(), mappedWriteMethod); if (mappedWriteMethod != null) {
new MappedPropertyDescriptor(property, dsClass); Class<?> propertyType = mappedPD.getMappedPropertyType(); Configuration subProps = c.subset(property);
/** * Sets the method that should be used to write the property value. * * @param mappedSetter The mapped setter method. * @throws IntrospectionException If an error occurs finding the * mapped property */ public void setMappedWriteMethod(final Method mappedSetter) throws IntrospectionException { mappedWriteMethodRef = new MappedMethodReference(mappedSetter); findMappedPropertyType(); }
/** * Find a method on a class with a specified number of parameters. */ private static Method getMethod(final Class<?> clazz, final String methodName, final int parameterCount) throws IntrospectionException { if (methodName == null) { return null; } final Method method = internalGetMethod(clazz, methodName, parameterCount); if (method != null) { return method; } // No Method found throw new IntrospectionException("No method \"" + methodName + "\" with " + parameterCount + " parameter(s)"); }
setName(propertyName); final String base = capitalizePropertyName(propertyName); try { try { mappedReadMethod = getMethod(beanClass, "get" + base, STRING_CLASS_PARAMETER); } catch (final IntrospectionException e) { mappedReadMethod = getMethod(beanClass, "is" + base, STRING_CLASS_PARAMETER); mappedWriteMethod = getMethod(beanClass, "set" + base, params); } catch (final IntrospectionException e) { mappedWriteMethod = getMethod(beanClass, "set" + base, 2); mappedWriteMethodRef = new MappedMethodReference(mappedWriteMethod); findMappedPropertyType();
propertyName); setName(propertyName); Method mappedWriteMethod = null; mappedReadMethod = getMethod(beanClass, mappedGetterName, STRING_CLASS_PARAMETER); getMethod(beanClass, mappedSetterName, params); } else { mappedWriteMethod = getMethod(beanClass, mappedSetterName, 2); findMappedPropertyType();
getMappedReadMethod(); readMethod = MethodUtils.getAccessibleMethod(bean.getClass(), readMethod); if (readMethod != null) {
/** * This constructor takes the name of a mapped property, and Method * objects for reading and writing the property. * * @param propertyName The programmatic name of the property. * @param mappedGetter The method used for reading one of * the property values. May be be null if the property * is write-only. * @param mappedSetter The method used for writing one the * property values. May be null if the property is read-only. * * @throws IntrospectionException if an exception occurs during * introspection. */ public MappedPropertyDescriptor(final String propertyName, final Method mappedGetter, final Method mappedSetter) throws IntrospectionException { super(propertyName, mappedGetter, mappedSetter); if (propertyName == null || propertyName.length() == 0) { throw new IntrospectionException("bad property name: " + propertyName); } setName(propertyName); mappedReadMethodRef = new MappedMethodReference(mappedGetter); mappedWriteMethodRef = new MappedMethodReference(mappedSetter); findMappedPropertyType(); }
} else if (descriptor instanceof MappedPropertyDescriptor) { return (((MappedPropertyDescriptor) descriptor). getMappedPropertyType()); } else { return (descriptor.getPropertyType());
getMappedWriteMethod(); mappedWriteMethod = MethodUtils.getAccessibleMethod(bean.getClass(), mappedWriteMethod); if (mappedWriteMethod != null) {
/** * Sets the method that should be used to read one of the property value. * * @param mappedGetter The mapped getter method. * @throws IntrospectionException If an error occurs finding the * mapped property */ public void setMappedReadMethod(final Method mappedGetter) throws IntrospectionException { mappedReadMethodRef = new MappedMethodReference(mappedGetter); findMappedPropertyType(); }
/** * Find a method on a class with a specified number of parameters. */ private static Method getMethod(final Class<?> clazz, final String methodName, final int parameterCount) throws IntrospectionException { if (methodName == null) { return null; } final Method method = internalGetMethod(clazz, methodName, parameterCount); if (method != null) { return method; } // No Method found throw new IntrospectionException("No method \"" + methodName + "\" with " + parameterCount + " parameter(s)"); }