1 4 package com.tc.aspectwerkz.joinpoint.management; 5 6 11 public final class JoinPointType { 12 13 public static final int METHOD_EXECUTION_INT = 1; 14 public static final int METHOD_CALL_INT = 2; 15 public static final int CONSTRUCTOR_EXECUTION_INT = 3; 16 public static final int CONSTRUCTOR_CALL_INT = 4; 17 public static final int FIELD_SET_INT = 5; 18 public static final int FIELD_GET_INT = 6; 19 public static final int HANDLER_INT = 7; 20 public static final int STATIC_INITIALIZATION_INT = 8; 21 22 23 public static final JoinPointType METHOD_EXECUTION = new JoinPointType(METHOD_EXECUTION_INT); 24 25 public static final JoinPointType METHOD_CALL = new JoinPointType(METHOD_CALL_INT); 26 27 public static final JoinPointType CONSTRUCTOR_EXECUTION = new JoinPointType(CONSTRUCTOR_EXECUTION_INT); 28 29 public static final JoinPointType CONSTRUCTOR_CALL = new JoinPointType(CONSTRUCTOR_CALL_INT); 30 31 public static final JoinPointType FIELD_SET = new JoinPointType(FIELD_SET_INT); 32 33 public static final JoinPointType FIELD_GET = new JoinPointType(FIELD_GET_INT); 34 35 public static final JoinPointType HANDLER = new JoinPointType(HANDLER_INT); 36 37 public static final JoinPointType STATIC_INITIALIZATION = new JoinPointType(STATIC_INITIALIZATION_INT); 38 39 private int m_int; 40 41 private JoinPointType(int asInt) { 42 m_int = asInt; 43 } 44 45 public String toString() { 46 switch (m_int) { 47 case METHOD_EXECUTION_INT: 48 return "MethodExecution"; 49 case METHOD_CALL_INT: 50 return "MethodCall"; 51 case CONSTRUCTOR_EXECUTION_INT: 52 return "ConstructorExecution"; 53 case CONSTRUCTOR_CALL_INT: 54 return "ConstructorCall"; 55 case FIELD_GET_INT: 56 return "FieldGet"; 57 case FIELD_SET_INT: 58 return "FieldSet"; 59 case HANDLER_INT: 60 return "Handler"; 61 case STATIC_INITIALIZATION_INT: 62 return "StaticInitialization"; 63 default: 64 throw new Error ("not supported join point type"); 65 } 66 } 67 68 public static JoinPointType fromInt(int asInt) { 69 return new JoinPointType(asInt); 70 } 71 72 public boolean equals(Object o) { 73 if (this == o) return true; 74 if (!(o instanceof JoinPointType)) return false; 75 76 final JoinPointType joinPointType = (JoinPointType) o; 77 78 if (m_int != joinPointType.m_int) return false; 79 80 return true; 81 } 82 83 public int hashCode() { 84 return m_int; 85 } 86 } | Popular Tags |