aspect Declaration { interface Declaration { String name(); } PackageDecl implements Declaration; TypeDecl implements Declaration; public String PackageDecl.name() { return getName(); } interface TypedDeclaration extends Declaration { TypeDecl type(); Access getTypeAccess(); void setTypeAccess(Access acc); boolean isSubstituted(); } Variable extends TypedDeclaration; MethodDecl implements TypedDeclaration; public boolean MethodDecl.isSubstituted() { return false; } public boolean MethodDeclSubstituted.isSubstituted() { return true; } }