BeanWrapperImpl beanWrapper = new BeanWrapperImpl(person); Clazz requiredType = beanWrapper.getPropertyType("name");
private Object getPropertyValue(Object bean, String nestedName) { BeanWrapperImpl wrapper = new BeanWrapperImpl(bean); wrapper.setAutoGrowNestedPaths(true); Object nestedValue = wrapper.getPropertyValue(nestedName); if (nestedValue == null) { try { nestedValue = wrapper.getPropertyType(nestedName).newInstance(); wrapper.setPropertyValue(nestedName, nestedValue); } catch (InstantiationException | IllegalAccessException e) { ReflectionUtils.handleReflectionException(e); } } return nestedValue; }
Class<?> requiredType = wrapper.getPropertyType(terminalProp); try {
Class<?> type = bw.getPropertyType(base); if (type != null && Map.class.isAssignableFrom(type)) { String suffix = name.substring(base.length());
target = bwrap.getPropertyValue(propPath); Class<?> type = bwrap.getPropertyType(propPath); if(bwrap.isWritableProperty(propPath) && (bwrap.getDefaultEditor(type)!=null|| type == String.class)
public Class<?> getValueType(Object context) { try { BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context); return beanWrapper.getPropertyType(expression); } catch (NotReadablePropertyException e) { throw new PropertyNotFoundException(context.getClass(), expression, e); } catch (BeansException e) { throw new EvaluationException(context.getClass(), getExpressionString(), "An BeansException occurred getting the value type for expression '" + getExpressionString() + "' on context [" + context.getClass() + "]", e); } }
public Class getValueType(Object context) { try { BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context); return beanWrapper.getPropertyType(expression); } catch (NotReadablePropertyException e) { throw new PropertyNotFoundException(context.getClass(), expression, e); } catch (BeansException e) { throw new EvaluationException(context.getClass(), getExpressionString(), "An BeansException occurred getting the value type for expression '" + getExpressionString() + "' on context [" + context.getClass() + "]", e); } }
public Class<?> getValueType(Object context) { try { BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context); return beanWrapper.getPropertyType(expression); } catch (NotReadablePropertyException e) { throw new PropertyNotFoundException(context.getClass(), expression, e); } catch (BeansException e) { throw new EvaluationException(context.getClass(), getExpressionString(), "An BeansException occurred getting the value type for expression '" + getExpressionString() + "' on context [" + context.getClass() + "]", e); } }
String fieldName = fieldNames.next(); Object valueToBeUpdated = node.get(fieldName); Class<?> propertyType = bw.getPropertyType(fieldName); if (propertyType == null) { if (!ignoreUnkown) {
public Class getValueType(Object context) { try { // OGNL has no native way to get this information return new BeanWrapperImpl(context).getPropertyType(expressionString); } catch (InvalidPropertyException e) { throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e); } catch (BeansException e) { throw new EvaluationException(context.getClass(), getExpressionString(), "An BeansException occurred getting the value type for expression '" + getExpressionString() + "' on context [" + context.getClass() + "]", e); } }
private Object getPropertyValue(Object bean, String nestedName) { BeanWrapperImpl wrapper = new BeanWrapperImpl(bean); wrapper.setAutoGrowNestedPaths(true); Object nestedValue = wrapper.getPropertyValue(nestedName); if (nestedValue == null) { try { nestedValue = wrapper.getPropertyType(nestedName).newInstance(); wrapper.setPropertyValue(nestedName, nestedValue); } catch (InstantiationException | IllegalAccessException e) { ReflectionUtils.handleReflectionException(e); } } return nestedValue; }
private Object getPropertyValue(Object bean, String nestedName) { BeanWrapperImpl wrapper = new BeanWrapperImpl(bean); wrapper.setAutoGrowNestedPaths(true); Object nestedValue = wrapper.getPropertyValue(nestedName); if (nestedValue == null) { try { nestedValue = wrapper.getPropertyType(nestedName).newInstance(); wrapper.setPropertyValue(nestedName, nestedValue); } catch (InstantiationException e) { ReflectionUtils.handleReflectionException(e); } catch (IllegalAccessException e) { ReflectionUtils.handleReflectionException(e); } } return nestedValue; }
Class<?> requiredType = wrapper.getPropertyType(terminalProp); try {
target = bwrap.getPropertyValue(propPath); Class<?> type = bwrap.getPropertyType(propPath); if(bwrap.isWritableProperty(propPath) && (bwrap.getDefaultEditor(type)!=null|| type == String.class)