test(Parent.class, new PropertyDescriptor("parentIndex", Parent.class));
test(Parent.class, new IndexedPropertyDescriptor("parentName", Parent.class));
test(Child.class, new PropertyDescriptor("childIndex", Child.class));
test(Child.class, new IndexedPropertyDescriptor("childName", Child.class));
}
privatestaticvoid test(Class type, PropertyDescriptor property) { for (PropertyDescriptor pd : BeanUtils.getPropertyDescriptors(type)) { boolean forward = pd.equals(property); boolean backward = property.equals(pd); if (forward || backward) { if (forward && backward) return;
thrownew Error("illegal comparison of properties");
}
} thrownew Error("could not find property: " + property.getName());
}
publicstaticclass Grand { publicint getIndex() { return0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.