You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Member.java 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* *******************************************************************
  2. * Copyright (c) 2002-2010
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. * ******************************************************************/
  9. package org.aspectj.weaver;
  10. import java.util.Collection;
  11. /**
  12. * Abstract representation of a member (field/constructor/method) within a type.
  13. *
  14. * @author PARC
  15. * @author Adrian Colyer
  16. * @author Andy Clement
  17. */
  18. public interface Member extends Comparable<Member> {
  19. public static final Member[] NONE = new Member[0];
  20. public static final MemberKind METHOD = new MemberKind("METHOD", 1);
  21. public static final MemberKind FIELD = new MemberKind("FIELD", 2);
  22. public static final MemberKind CONSTRUCTOR = new MemberKind("CONSTRUCTOR", 3);
  23. public static final MemberKind STATIC_INITIALIZATION = new MemberKind("STATIC_INITIALIZATION", 4);
  24. public static final MemberKind POINTCUT = new MemberKind("POINTCUT", 5);
  25. public static final MemberKind ADVICE = new MemberKind("ADVICE", 6);
  26. public static final MemberKind HANDLER = new MemberKind("HANDLER", 7);
  27. public static final MemberKind MONITORENTER = new MemberKind("MONITORENTER", 8);
  28. public static final MemberKind MONITOREXIT = new MemberKind("MONITOREXIT", 9);
  29. public static final AnnotationAJ[][] NO_PARAMETER_ANNOTATIONXS = new AnnotationAJ[][] {};
  30. public static final ResolvedType[][] NO_PARAMETER_ANNOTATION_TYPES = new ResolvedType[][] {};
  31. /**
  32. * @return the kind of member from those listed as MemberKind instances
  33. */
  34. public MemberKind getKind();
  35. public String getName();
  36. public UnresolvedType getDeclaringType();
  37. public UnresolvedType[] getParameterTypes();
  38. public UnresolvedType[] getGenericParameterTypes();
  39. public UnresolvedType getType();
  40. public UnresolvedType getReturnType();
  41. public UnresolvedType getGenericReturnType();
  42. /**
  43. * Return full signature, including return type, e.g. "()LFastCar;". For a signature without the return type, use
  44. * getParameterSignature() - it is important to choose the right one in the face of covariance.
  45. */
  46. public String getSignature();
  47. public JoinPointSignatureIterator getJoinPointSignatures(World world);
  48. public int getArity();
  49. /**
  50. * Return signature without return type, e.g. "()" for a signature *with* the return type, use getSignature() - it is important
  51. * to choose the right one in the face of covariance.
  52. */
  53. public String getParameterSignature();
  54. public int getModifiers(World world);
  55. public int getModifiers();
  56. /**
  57. * Returns true iff the member is generic (NOT parameterized)
  58. */
  59. public boolean canBeParameterized();
  60. public AnnotationAJ[] getAnnotations();
  61. public Collection<ResolvedType> getDeclaringTypes(World world);
  62. public String[] getParameterNames(World world);
  63. public UnresolvedType[] getExceptions(World world);
  64. public ResolvedMember resolve(World world);
  65. public int compareTo(Member other);
  66. }