/** * Resolve the type of this property to a class. * @return Class, <code>null</code> if cannot be determined */ public Class<?> getTypeClass() { Type targetType = type instanceof DynaType ? ((DynaType) type).getRawType() : type; if (targetType == null) { return null; } Type assigningType = getParentMetaBean() == null ? null : getParentMetaBean().getBeanClass(); return TypeUtils.getRawType(targetType, assigningType); }
/** * Create a new PropertyDescriptorImpl instance. * * @param property */ PropertyDescriptorImpl(MetaProperty property) { super(property.getParentMetaBean(), property.getTypeClass(), property.getValidations()); setCascaded(property.getMetaBean() != null || property.getFeature(Features.Property.REF_CASCADE) != null); setPropertyPath(property.getName()); }
/** * If we currently have a property, navigate the context such that the property becomes the bean, in preparation for * another property. * * @param validationContext */ public void moveDownIfNecessary() { MetaProperty mp = validationContext.getMetaProperty(); if (mp != null) { if (mp.getMetaBean() == null) { throw new UnknownPropertyException(String.format("Property %s.%s is not cascaded", mp .getParentMetaBean().getId(), mp.getName())); } validationContext.moveDown(mp, new NullSafePropertyAccess(validationContext.getMetaBean().getBeanClass(), mp.getName())); } }
if (prop != null && prop.getParentMetaBean() != null) { MetaBean parentMetaBean = prop.getParentMetaBean();
context.moveUp(bean, prop.getParentMetaBean()); context.setMetaProperty(prop); if (fixed) { context.moveUp(bean, prop.getParentMetaBean()); context.setMetaProperty(prop); if (fixed) {