1. /*
  2. * @(#)DeclarationVisitor.java 1.3 04/04/20
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.mirror.util;
  8. import com.sun.mirror.declaration.*;
  9. /**
  10. * A visitor for declarations, in the style of the standard visitor
  11. * design pattern. Classes implementing this interface are used to
  12. * operate on a declaration when the kind of declaration is unknown at
  13. * compile time. When a visitor is passed to a declaration's {@link
  14. * Declaration#accept accept} method, the most specific
  15. * <tt>visit<i>Xxx</i></tt> method applicable to that declaration is
  16. * invoked.
  17. *
  18. * @author Joseph D. Darcy
  19. * @author Scott Seligman
  20. * @version 1.3 04/04/20
  21. * @since 1.5
  22. */
  23. public interface DeclarationVisitor {
  24. /**
  25. * Visits a declaration.
  26. * @param d the declaration to visit
  27. */
  28. public void visitDeclaration(Declaration d);
  29. /**
  30. * Visits a package declaration.
  31. * @param d the declaration to visit
  32. */
  33. public void visitPackageDeclaration(PackageDeclaration d);
  34. /**
  35. * Visits a member or constructor declaration.
  36. * @param d the declaration to visit
  37. */
  38. public void visitMemberDeclaration(MemberDeclaration d);
  39. /**
  40. * Visits a type declaration.
  41. * @param d the declaration to visit
  42. */
  43. public void visitTypeDeclaration(TypeDeclaration d);
  44. /**
  45. * Visits a class declaration.
  46. * @param d the declaration to visit
  47. */
  48. public void visitClassDeclaration(ClassDeclaration d);
  49. /**
  50. * Visits an enum declaration.
  51. * @param d the declaration to visit
  52. */
  53. public void visitEnumDeclaration(EnumDeclaration d);
  54. /**
  55. * Visits an interface declaration.
  56. * @param d the declaration to visit
  57. */
  58. public void visitInterfaceDeclaration(InterfaceDeclaration d);
  59. /**
  60. * Visits an annotation type declaration.
  61. * @param d the declaration to visit
  62. */
  63. public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d);
  64. /**
  65. * Visits a field declaration.
  66. * @param d the declaration to visit
  67. */
  68. public void visitFieldDeclaration(FieldDeclaration d);
  69. /**
  70. * Visits an enum constant declaration.
  71. * @param d the declaration to visit
  72. */
  73. public void visitEnumConstantDeclaration(EnumConstantDeclaration d);
  74. /**
  75. * Visits a method or constructor declaration.
  76. * @param d the declaration to visit
  77. */
  78. public void visitExecutableDeclaration(ExecutableDeclaration d);
  79. /**
  80. * Visits a constructor declaration.
  81. * @param d the declaration to visit
  82. */
  83. public void visitConstructorDeclaration(ConstructorDeclaration d);
  84. /**
  85. * Visits a method declaration.
  86. * @param d the declaration to visit
  87. */
  88. public void visitMethodDeclaration(MethodDeclaration d);
  89. /**
  90. * Visits an annotation type element declaration.
  91. * @param d the declaration to visit
  92. */
  93. public void visitAnnotationTypeElementDeclaration(
  94. AnnotationTypeElementDeclaration d);
  95. /**
  96. * Visits a parameter declaration.
  97. * @param d the declaration to visit
  98. */
  99. public void visitParameterDeclaration(ParameterDeclaration d);
  100. /**
  101. * Visits a type parameter declaration.
  102. * @param d the declaration to visit
  103. */
  104. public void visitTypeParameterDeclaration(TypeParameterDeclaration d);
  105. }