1 /***************************************************************************************
2 * Copyright (c) Jonas Bonér, Alexandre Vasseur. All rights reserved. *
3 * http://aspectwerkz.codehaus.org *
4 * ---------------------------------------------------------------------------------- *
5 * The software in this package is published under the terms of the LGPL license *
6 * a copy of which has been included with this distribution in the license.txt file. *
7 **************************************************************************************/
8 package org.codehaus.aspectwerkz.annotation;
9
10 import org.codehaus.aspectwerkz.util.Strings;
11
12 /***
13 * The 'Introduce' annotation proxy.
14 *
15 * @author <a href="mailto:jboner@codehaus.org">Jonas Bonér </a>
16 */
17 public class IntroduceAnnotationProxy extends UntypedAnnotationProxy {
18 private String m_expression;
19
20 private String m_innerClassName;
21
22 private String[] m_introducedInterfaces;
23
24 private String m_deploymentModel;
25
26 public String expression() {
27 return m_expression;
28 }
29
30 public String deploymentModel() {
31 return m_deploymentModel;
32 }
33
34 public void setValue(final String value) {
35 String[] parts = Strings.splitString(value, " ");
36 StringBuffer expression = new StringBuffer();
37 for (int i = 0; i < parts.length; i++) {
38 String part = parts[i];
39 int equals = part.indexOf('=');
40 if (equals > 0) {
41 String name = part.substring(0, equals);
42 String param = part.substring(equals + 1, part.length());
43 if (name.equalsIgnoreCase("deploymentModel")) {
44 m_deploymentModel = param.trim();
45 }
46 } else {
47 expression.append(' ');
48 expression.append(part);
49 }
50 }
51 m_expression = expression.toString().trim();
52 }
53
54 public void setdeploymentModel(final String deploymentModel) {
55 m_deploymentModel = deploymentModel;
56 }
57
58 public String[] introducedInterfaces() {
59 return m_introducedInterfaces;
60 }
61
62 public void setIntroducedInterfaces(String[] introducedInterfaceNames) {
63 m_introducedInterfaces = introducedInterfaceNames;
64 }
65
66 public String innerClassName() {
67 return m_innerClassName;
68 }
69
70 public void setInnerClassName(String innerClassName) {
71 m_innerClassName = innerClassName;
72 }
73 }