コード例 #1
0
 private void checkAbstractDeclaration(MethodNode methodNode) {
   if (!methodNode.isAbstract()) return;
   if (isAbstract(currentClass.getModifiers())) return;
   addError(
       "Can't have an abstract method in a non-abstract class."
           + " The "
           + getDescription(currentClass)
           + " must be declared abstract or the method '"
           + methodNode.getTypeDescriptor()
           + "' must not be abstract.",
       methodNode);
 }
コード例 #2
0
ファイル: GrailsASTUtils.java プロジェクト: erdi/grails-core
 /**
  * Tests whether the ClasNode implements the specified method name.
  *
  * @param classNode The ClassNode
  * @param methodName The method name
  * @return True if it does implement the method
  */
 public static boolean implementsZeroArgMethod(ClassNode classNode, String methodName) {
   MethodNode method = classNode.getDeclaredMethod(methodName, Parameter.EMPTY_ARRAY);
   return method != null && (method.isPublic() || method.isProtected()) && !method.isAbstract();
 }