Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

IRelationship.java 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* *******************************************************************
  2. * Copyright (c) 2003 Contributors.
  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. * Contributors:
  10. * Mik Kersten initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.asm;
  13. import java.io.*;
  14. import java.util.List;
  15. /**
  16. * @author Mik Kersten
  17. */
  18. public interface IRelationship extends Serializable {
  19. public String getName();
  20. public List/*String*/ getTargets();
  21. public String getSourceHandle();
  22. public boolean addTarget(String handle);
  23. public Kind getKind();
  24. public boolean hasRuntimeTest();
  25. /**
  26. * Uses "typesafe enum" pattern.
  27. */
  28. public static class Kind implements Serializable {
  29. private static final long serialVersionUID = -2691351740214705220L;
  30. public static final Kind DECLARE_WARNING = new Kind("declare warning");
  31. public static final Kind DECLARE_ERROR = new Kind("declare error");
  32. public static final Kind ADVICE_AROUND = new Kind("around advice");
  33. public static final Kind ADVICE_AFTERRETURNING = new Kind("after returning advice");
  34. public static final Kind ADVICE_AFTERTHROWING = new Kind("after throwing advice");
  35. public static final Kind ADVICE_AFTER = new Kind("after advice");
  36. public static final Kind ADVICE_BEFORE = new Kind("before advice");
  37. public static final Kind ADVICE = new Kind("advice");
  38. public static final Kind DECLARE = new Kind("declare");
  39. public static final Kind DECLARE_INTER_TYPE = new Kind("inter-type declaration");
  40. public static final Kind USES_POINTCUT = new Kind("uses pointcut");
  41. public static final Kind DECLARE_SOFT = new Kind("declare soft");
  42. public static final Kind[] ALL = {
  43. DECLARE_WARNING, DECLARE_ERROR,
  44. ADVICE_AROUND,ADVICE_AFTERRETURNING,ADVICE_AFTERTHROWING,ADVICE_AFTER,ADVICE_BEFORE,
  45. ADVICE, DECLARE, DECLARE_INTER_TYPE, USES_POINTCUT, DECLARE_SOFT };
  46. private final String name;
  47. public boolean isDeclareKind() {
  48. return this == DECLARE_WARNING
  49. || this == DECLARE_ERROR
  50. || this == DECLARE
  51. || this == DECLARE_INTER_TYPE
  52. || this == DECLARE_SOFT;
  53. }
  54. private Kind(String name) {
  55. this.name = name;
  56. }
  57. public String toString() {
  58. return name;
  59. }
  60. // The 4 declarations below are necessary for serialization
  61. private static int nextOrdinal = 0;
  62. private final int ordinal = nextOrdinal++;
  63. private Object readResolve() throws ObjectStreamException {
  64. return ALL[ordinal];
  65. }
  66. }
  67. public boolean isAffects();
  68. }