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.

MemberKind.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  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. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver;
  13. import java.io.DataInputStream;
  14. import java.io.IOException;
  15. import org.aspectj.util.TypeSafeEnum;
  16. public class MemberKind extends TypeSafeEnum {
  17. public MemberKind(String name, int key) {
  18. super(name, key);
  19. }
  20. public static MemberKind read(DataInputStream s) throws IOException {
  21. int key = s.readByte();
  22. switch (key) {
  23. case 1:
  24. return Member.METHOD;
  25. case 2:
  26. return Member.FIELD;
  27. case 3:
  28. return Member.CONSTRUCTOR;
  29. case 4:
  30. return Member.STATIC_INITIALIZATION;
  31. case 5:
  32. return Member.POINTCUT;
  33. case 6:
  34. return Member.ADVICE;
  35. case 7:
  36. return Member.HANDLER;
  37. case 8:
  38. return Member.MONITORENTER;
  39. case 9:
  40. return Member.MONITOREXIT;
  41. }
  42. throw new BCException("Unexpected memberkind, should be (1-9) but was " + key);
  43. }
  44. }