int elementCount = 0; for(Constructor<?> ctor : daClass.getDeclaredConstructors()) {
elementCount++; if (ctor.isAccessible()) thrownew RuntimeException("Unexpected accessibility for constructor " +
ctor);
}
for(Method method : daClass.getDeclaredMethods()) {
elementCount++; if (method.isAccessible()) thrownew RuntimeException("Unexpected accessibility for method " +
method);
}
for(Field field : daClass.getDeclaredFields()) {
elementCount++; if (field.isAccessible()) thrownew RuntimeException("Unexpected accessibility for field " +
field);
}
if (elementCount < 3) thrownew RuntimeException("Expected at least three members; only found " +
elementCount);
}
}
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.