KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > aspectwerkz > expression > PointcutType


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.aspectwerkz.expression;
5
6 import java.io.Serializable JavaDoc;
7
8 /**
9  * 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 JavaDoc {
14   public static final PointcutType EXECUTION = new PointcutType("execution");
15
16   public static final PointcutType CALL = new PointcutType("call");
17
18   public static final PointcutType SET = new PointcutType("set");
19
20   public static final PointcutType GET = new PointcutType("getDefault");
21
22   public static final PointcutType HANDLER = new PointcutType("handler");
23
24   public static final PointcutType WITHIN = new PointcutType("within");
25 //
26
// public static final PointcutType WITHIN_CODE = new PointcutType("withincode");
27

28   public static final PointcutType STATIC_INITIALIZATION = new PointcutType("staticinitialization");
29
30 // public static final PointcutType ATTRIBUTE = new PointcutType("attribute");
31
//
32
// public static final PointcutType HAS_METHOD = new PointcutType("hasmethod");
33
//
34
// public static final PointcutType HAS_FIELD = new PointcutType("hasfield");
35
//
36
// public static final PointcutType ANY = new PointcutType("any");
37

38   private final String JavaDoc m_name;
39
40   private PointcutType(String JavaDoc name) {
41     m_name = name;
42   }
43
44   public String JavaDoc toString() {
45     return m_name;
46   }
47
48   public boolean equals(Object JavaDoc o) {
49     if (this == o) {
50       return true;
51     }
52     if (!(o instanceof PointcutType)) {
53       return false;
54     }
55     final PointcutType pointcutType = (PointcutType) o;
56     if ((m_name != null) ? (!m_name.equals(pointcutType.m_name)) : (pointcutType.m_name != null)) {
57       return false;
58     }
59     return true;
60   }
61
62   public int hashCode() {
63     return ((m_name != null) ? m_name.hashCode() : 0);
64   }
65 }
Popular Tags