1 8 package org.codehaus.aspectwerkz.definition; 9 10 import org.codehaus.aspectwerkz.expression.ExpressionInfo; 11 12 import java.util.ArrayList ; 13 import java.util.List ; 14 15 21 public class InterfaceIntroductionDefinition { 22 25 protected final String m_name; 26 27 30 protected ExpressionInfo[] m_expressionInfos = new ExpressionInfo[]{}; 31 32 35 protected String m_attribute = ""; 36 37 40 protected List m_interfaceClassNames = new ArrayList (); 41 42 48 public InterfaceIntroductionDefinition(final String name, final String interfaceClassName) { 49 if (name == null) { 50 throw new IllegalArgumentException ("name can not be null"); 51 } 52 if (interfaceClassName == null) { 53 throw new IllegalArgumentException ("interface class name can not be null"); 54 } 55 m_name = name; 56 m_interfaceClassNames.add(interfaceClassName); 57 } 58 59 64 public String getName() { 65 return m_name; 66 } 67 68 73 public ExpressionInfo[] getExpressionInfos() { 74 return m_expressionInfos; 75 } 76 77 82 public String getInterfaceClassName() { 83 return (String ) m_interfaceClassNames.get(0); 84 } 85 86 91 public List getInterfaceClassNames() { 92 return m_interfaceClassNames; 93 } 94 95 100 public String getAttribute() { 101 return m_attribute; 102 } 103 104 109 public void setAttribute(final String attribute) { 110 m_attribute = attribute; 111 } 112 113 118 public void addExpressionInfo(final ExpressionInfo expression) { 119 final ExpressionInfo[] tmpExpressions = new ExpressionInfo[m_expressionInfos.length + 1]; 120 java.lang.System.arraycopy(m_expressionInfos, 0, tmpExpressions, 0, m_expressionInfos.length); 121 tmpExpressions[m_expressionInfos.length] = expression; 122 m_expressionInfos = new ExpressionInfo[m_expressionInfos.length + 1]; 123 java.lang.System.arraycopy(tmpExpressions, 0, m_expressionInfos, 0, tmpExpressions.length); 124 } 125 126 131 public void addExpressionInfos(final ExpressionInfo[] expressions) { 132 final ExpressionInfo[] tmpExpressions = new ExpressionInfo[m_expressionInfos.length + expressions.length]; 133 java.lang.System.arraycopy(m_expressionInfos, 0, tmpExpressions, 0, m_expressionInfos.length); 134 java.lang.System.arraycopy(expressions, 0, tmpExpressions, m_expressionInfos.length, expressions.length); 135 m_expressionInfos = new ExpressionInfo[m_expressionInfos.length + expressions.length]; 136 java.lang.System.arraycopy(tmpExpressions, 0, m_expressionInfos, 0, tmpExpressions.length); 137 } 138 } | Popular Tags |