01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.aspectwerkz.expression;
05:
06: import java.io.Serializable;
07:
08: /**
09: * Type-safe enum for the pointcut types.
10: *
11: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
12: */
13: public class PointcutType implements Serializable {
14: public static final PointcutType EXECUTION = new PointcutType(
15: "execution");
16:
17: public static final PointcutType CALL = new PointcutType("call");
18:
19: public static final PointcutType SET = new PointcutType("set");
20:
21: public static final PointcutType GET = new PointcutType(
22: "getDefault");
23:
24: public static final PointcutType HANDLER = new PointcutType(
25: "handler");
26:
27: public static final PointcutType WITHIN = new PointcutType("within");
28: //
29: // public static final PointcutType WITHIN_CODE = new PointcutType("withincode");
30:
31: public static final PointcutType STATIC_INITIALIZATION = new PointcutType(
32: "staticinitialization");
33:
34: // public static final PointcutType ATTRIBUTE = new PointcutType("attribute");
35: //
36: // public static final PointcutType HAS_METHOD = new PointcutType("hasmethod");
37: //
38: // public static final PointcutType HAS_FIELD = new PointcutType("hasfield");
39: //
40: // public static final PointcutType ANY = new PointcutType("any");
41:
42: private final String m_name;
43:
44: private PointcutType(String name) {
45: m_name = name;
46: }
47:
48: public String toString() {
49: return m_name;
50: }
51:
52: public boolean equals(Object o) {
53: if (this == o) {
54: return true;
55: }
56: if (!(o instanceof PointcutType)) {
57: return false;
58: }
59: final PointcutType pointcutType = (PointcutType) o;
60: if ((m_name != null) ? (!m_name.equals(pointcutType.m_name))
61: : (pointcutType.m_name != null)) {
62: return false;
63: }
64: return true;
65: }
66:
67: public int hashCode() {
68: return ((m_name != null) ? m_name.hashCode() : 0);
69: }
70: }
|