Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

IRelationship.java 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-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. public static final Kind DECLARE_WARNING = new Kind("declare warning");
  30. public static final Kind DECLARE_ERROR = new Kind("declare error");
  31. public static final Kind ADVICE_AROUND = new Kind("around advice");
  32. public static final Kind ADVICE_AFTERRETURNING = new Kind("after returning advice");
  33. public static final Kind ADVICE_AFTERTHROWING = new Kind("after throwing advice");
  34. public static final Kind ADVICE_AFTER = new Kind("after advice");
  35. public static final Kind ADVICE_BEFORE = new Kind("before advice");
  36. public static final Kind ADVICE = new Kind("advice");
  37. public static final Kind DECLARE = new Kind("declare");
  38. public static final Kind DECLARE_INTER_TYPE = new Kind("inter-type declaration");
  39. public static final Kind[] ALL = {
  40. DECLARE_WARNING, DECLARE_ERROR,
  41. ADVICE_AROUND,ADVICE_AFTERRETURNING,ADVICE_AFTERTHROWING,ADVICE_AFTER,ADVICE_BEFORE,
  42. ADVICE, DECLARE, DECLARE_INTER_TYPE };
  43. private final String name;
  44. private Kind(String name) {
  45. this.name = name;
  46. }
  47. public String toString() {
  48. return name;
  49. }
  50. // The 4 declarations below are necessary for serialization
  51. private static int nextOrdinal = 0;
  52. private final int ordinal = nextOrdinal++;
  53. private Object readResolve() throws ObjectStreamException {
  54. return ALL[ordinal];
  55. }
  56. }
  57. }