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.transform.inlining;
05:
06: import com.tc.aspectwerkz.DeploymentModel;
07: import com.tc.aspectwerkz.aspect.container.AspectFactoryManager;
08: import com.tc.aspectwerkz.definition.AspectDefinition;
09: import com.tc.aspectwerkz.transform.inlining.spi.AspectModel;
10:
11: /**
12: * TODO docuemnt
13: *
14: * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur</a>
15: */
16: public class AspectInfo {
17: private final AspectDefinition m_aspectDefinition;//TODO - remove this dependancie
18: private final String m_aspectQualifiedName;
19: private final String m_aspectFieldName;
20: private final String m_aspectClassName;
21: private final String m_aspectClassSignature;
22: private final String m_aspectFactoryClassName;
23: private final DeploymentModel m_deploymentModel;
24:
25: private AspectModel m_aspectModel;
26:
27: public AspectInfo(final AspectDefinition aspectDefinition,
28: final String aspectFieldName, final String aspectClassName,
29: final String aspectClassSignature) {
30: m_aspectDefinition = aspectDefinition;
31: m_aspectQualifiedName = aspectDefinition.getQualifiedName();
32: m_aspectFieldName = aspectFieldName;
33: m_aspectClassName = aspectClassName;
34: m_aspectClassSignature = aspectClassSignature;
35: m_deploymentModel = aspectDefinition.getDeploymentModel();
36: m_aspectFactoryClassName = AspectFactoryManager
37: .getAspectFactoryClassName(m_aspectClassName,
38: m_aspectQualifiedName);
39: }
40:
41: public AspectDefinition getAspectDefinition() {
42: return m_aspectDefinition;
43: }
44:
45: public String getAspectClassName() {
46: return m_aspectClassName;
47: }
48:
49: public String getAspectQualifiedName() {
50: return m_aspectQualifiedName;
51: }
52:
53: public DeploymentModel getDeploymentModel() {
54: return m_deploymentModel;
55: }
56:
57: public String getAspectFieldName() {
58: return m_aspectFieldName;
59: }
60:
61: public String getAspectClassSignature() {
62: return m_aspectClassSignature;
63: }
64:
65: public String getAspectFactoryClassName() {
66: return m_aspectFactoryClassName;
67: }
68:
69: public AspectModel getAspectModel() {
70: return m_aspectModel;
71: }
72:
73: public void setAspectModel(AspectModel aspectModel) {
74: m_aspectModel = aspectModel;
75: }
76:
77: public boolean equals(Object o) {
78: //TODO should we use AspectDef instead ??
79: if (this == o) {
80: return true;
81: }
82: if (!(o instanceof AspectInfo)) {
83: return false;
84: }
85:
86: final AspectInfo aspectInfo = (AspectInfo) o;
87:
88: if (!m_aspectQualifiedName
89: .equals(aspectInfo.m_aspectQualifiedName)) {
90: return false;
91: }
92:
93: return true;
94: }
95:
96: public int hashCode() {
97: return m_aspectQualifiedName.hashCode();
98: }
99: }
|