Code example for TypeDescriptor

0
			PropertyDescriptor pd = new PropertyDescriptor(actualPropertyName,
					getTargetClass()); 
			if (pd != null) {
				Class type = getPropertyType(propertyName);
				if (pd.getReadMethod() != null) {
					return new TypeDescriptor(new MethodParameter(
							pd.getReadMethod(), -1));
				} else if (pd.getWriteMethod() != null) {
					return new TypeDescriptor(
							BeanUtils.getWriteMethodParameter(pd));
				} 
			} 
		} catch (InvalidPropertyException ex) {
			// Consider as not determinable. 
		} catch (IntrospectionException e) {
			throw new RuntimeException("Error creating property descriptor", e);
		} 
		return null; 
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java