8004814: javadoc should be able to detect default methods

Reviewed-by: jjg
This commit is contained in:
Maurizio Cimadamore 2012-12-17 14:54:42 +00:00 committed by Vicente Romero
parent c38e124ed5
commit c5acce4569
4 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,6 +65,12 @@ public interface ClassDoc extends ProgramElementDoc, Type {
*/
boolean isExternalizable();
/**
* Return true if this class can be used as a target type of a lambda expression
* or method reference.
*/
boolean isFunctionalInterface();
/**
* Return the serialization methods for this class or
* interface.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,6 +38,11 @@ public interface MethodDoc extends ExecutableMemberDoc {
*/
boolean isAbstract();
/**
* Return true if this method is default
*/
boolean isDefault();
/**
* Get return type.
*

View File

@ -276,6 +276,10 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
return false;
}
public boolean isFunctionalInterface() {
return env.types.isFunctionalInterface(tsym);
}
/**
* Return the package that this class is contained in.
*/

View File

@ -75,6 +75,13 @@ public class MethodDocImpl
return true;
}
/**
* Return true if this method is default
*/
public boolean isDefault() {
return (sym.flags() & Flags.DEFAULT) != 0;
}
/**
* Return true if this method is abstract
*/