if (isAspect()) {
for (Field f : clazz.getDeclaredFields()) {
if (!f.getType().isInterface()) continue;
- if (!Modifier.isPublic(f.getModifiers()) || !Modifier.isStatic(f.getModifiers())) continue;
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
+ if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
+ Class<org.aspectj.lang.annotation.DeclareParents> decPAnnClass = org.aspectj.lang.annotation.DeclareParents.class;
+ org.aspectj.lang.annotation.DeclareParents decPAnn = f.getAnnotation(decPAnnClass);
+ if (decPAnn.defaultImpl() == decPAnnClass) continue; // doesn't contribute members...
for (Method itdM : f.getType().getDeclaredMethods()) {
if (!Modifier.isPublic(itdM.getModifiers()) && publicOnly) continue;
InterTypeMethodDeclaration itdm = new InterTypeMethodDeclarationImpl(
private void addAnnotationStyleDeclareParents(List<DeclareParents> toList) {
for (Field f : clazz.getDeclaredFields()) {
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareImplements.class)) {
- if (!f.getType().isInterface()) continue;
- org.aspectj.lang.annotation.DeclareImplements ann = f.getAnnotation(org.aspectj.lang.annotation.DeclareImplements.class);
- String parentType = f.getType().getName();
- DeclareParentsImpl decp = new DeclareParentsImpl(
- ann.value(),
- parentType,
- false,
- this
- );
- toList.add(decp);
- }
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)
- && Modifier.isStatic(f.getModifiers())
- && Modifier.isPublic(f.getModifiers())) {
+ if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
if (!f.getType().isInterface()) continue;
org.aspectj.lang.annotation.DeclareParents ann = f.getAnnotation(org.aspectj.lang.annotation.DeclareParents.class);
String parentType = f.getType().getName();
*/
String value();
+ /**
+ * Optional class defining default implementation
+ * of interface members (equivalent to defining
+ * a set of interface member ITDs for the
+ * public methods of the interface).
+ */
+ Class defaultImpl() default DeclareParents.class;
+
+ // note - a default of "null" is not allowed,
+ // hence the strange default given above.
}