/** *Thebaseclass"color"property *createsbothanIndexedPropertyDescriptorwhichhasaconflicting *typeforgetColor.
*/ publicclass Test4168833 { publicstaticvoid main(String[] args) throws Exception { // When the Sub class is introspected, // the property type should be color. // The complete "classic" set of properties // has been completed accross the hierarchy.
test(Sub.class);
test(Sub2.class);
}
privatestaticvoid test(Class type) {
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(type, "prop"); if (pd instanceof IndexedPropertyDescriptor) {
error(pd, type.getSimpleName() + ".prop should not be an indexed property");
} if (!pd.getPropertyType().equals(Color.class)) {
error(pd, type.getSimpleName() + ".prop type should be a Color");
} if (null == pd.getReadMethod()) {
error(pd, type.getSimpleName() + ".prop should have classic read method");
} if (null == pd.getWriteMethod()) {
error(pd, type.getSimpleName() + ".prop should have classic write method");
}
}
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.