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