1. /*
  2. * @(#)TypeVisitor.java 1.4 04/06/07
  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.type.*;
  9. /**
  10. * A visitor for types, in the style of the standard visitor design pattern.
  11. * This is used to operate on a type when the kind
  12. * of type is unknown at compile time.
  13. * When a visitor is passed to a type's
  14. * {@link TypeMirror#accept accept} method,
  15. * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
  16. * that type is invoked.
  17. *
  18. * @author Joseph D. Darcy
  19. * @author Scott Seligman
  20. * @version 1.4 04/06/07
  21. * @since 1.5
  22. */
  23. public interface TypeVisitor {
  24. /**
  25. * Visits a type mirror.
  26. *
  27. * @param t the type to visit
  28. */
  29. public void visitTypeMirror(TypeMirror t);
  30. /**
  31. * Visits a primitive type.
  32. * @param t the type to visit
  33. */
  34. public void visitPrimitiveType(PrimitiveType t);
  35. /**
  36. * Visits a void type.
  37. *
  38. * @param t the type to visit
  39. */
  40. public void visitVoidType(VoidType t);
  41. /**
  42. * Visits a reference type.
  43. *
  44. * @param t the type to visit
  45. */
  46. public void visitReferenceType(ReferenceType t);
  47. /**
  48. * Visits a declared type.
  49. *
  50. * @param t the type to visit
  51. */
  52. public void visitDeclaredType(DeclaredType t);
  53. /**
  54. * Visits a class type.
  55. *
  56. * @param t the type to visit
  57. */
  58. public void visitClassType(ClassType t);
  59. /**
  60. * Visits an enum type.
  61. *
  62. * @param t the type to visit
  63. */
  64. public void visitEnumType(EnumType t);
  65. /**
  66. * Visits an interface type.
  67. *
  68. * @param t the type to visit
  69. */
  70. public void visitInterfaceType(InterfaceType t);
  71. /**
  72. * Visits an annotation type.
  73. *
  74. * @param t the type to visit
  75. */
  76. public void visitAnnotationType(AnnotationType t);
  77. /**
  78. * Visits an array type.
  79. *
  80. * @param t the type to visit
  81. */
  82. public void visitArrayType(ArrayType t);
  83. /**
  84. * Visits a type variable.
  85. *
  86. * @param t the type to visit
  87. */
  88. public void visitTypeVariable(TypeVariable t);
  89. /**
  90. * Visits a wildcard.
  91. *
  92. * @param t the type to visit
  93. */
  94. public void visitWildcardType(WildcardType t);
  95. }