/** * Invokes 'prepareForAccess' of a super descriptor and then invokes * 'prepareForAccess' of each declared property. */ public void injectValueHolders(Object object) throws PropertyException { // do super first if (getSuperclassDescriptor() != null) { getSuperclassDescriptor().injectValueHolders(object); } for (PropertyDescriptor property : declaredProperties.values()) { property.injectValueHolder(object); } }
/** * Adds superclass properties to the descriptor, applying proper overrides. */ protected void indexSuperclassProperties(final PersistentDescriptor descriptor) { ClassDescriptor superDescriptor = descriptor.getSuperclassDescriptor(); if (superDescriptor != null) { superDescriptor.visitProperties(new PropertyVisitor() { public boolean visitAttribute(AttributeProperty property) { // decorate super property to return an overridden attribute descriptor.addSuperProperty(new AttributePropertyDecorator(descriptor, property)); return true; } public boolean visitToMany(ToManyProperty property) { descriptor.addSuperProperty(property); return true; } public boolean visitToOne(ToOneProperty property) { descriptor.addSuperProperty(property); return true; } }); } }