1 4 package com.tc.aspectwerkz.definition; 5 6 7 import com.tc.aspectwerkz.expression.ExpressionInfo; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 12 18 public class InterfaceIntroductionDefinition { 19 22 protected final String m_name; 23 24 27 protected ExpressionInfo[] m_expressionInfos = new ExpressionInfo[]{}; 28 29 32 protected String m_attribute = ""; 33 34 37 protected List m_interfaceClassNames = new ArrayList (); 38 39 45 public InterfaceIntroductionDefinition(final String name, final String interfaceClassName) { 46 if (name == null) { 47 throw new IllegalArgumentException ("name can not be null"); 48 } 49 if (interfaceClassName == null) { 50 throw new IllegalArgumentException ("interface class name can not be null"); 51 } 52 m_name = name; 53 m_interfaceClassNames.add(interfaceClassName); 54 } 55 56 61 public String getName() { 62 return m_name; 63 } 64 65 70 public ExpressionInfo[] getExpressionInfos() { 71 return m_expressionInfos; 72 } 73 74 79 public String getInterfaceClassName() { 80 return (String ) m_interfaceClassNames.get(0); 81 } 82 83 88 public List getInterfaceClassNames() { 89 return m_interfaceClassNames; 90 } 91 92 97 public String getAttribute() { 98 return m_attribute; 99 } 100 101 106 public void setAttribute(final String attribute) { 107 m_attribute = attribute; 108 } 109 110 115 public void addExpressionInfo(final ExpressionInfo expression) { 116 final ExpressionInfo[] tmpExpressions = new ExpressionInfo[m_expressionInfos.length + 1]; 117 java.lang.System.arraycopy(m_expressionInfos, 0, tmpExpressions, 0, m_expressionInfos.length); 118 tmpExpressions[m_expressionInfos.length] = expression; 119 m_expressionInfos = new ExpressionInfo[m_expressionInfos.length + 1]; 120 java.lang.System.arraycopy(tmpExpressions, 0, m_expressionInfos, 0, tmpExpressions.length); 121 } 122 123 128 public void addExpressionInfos(final ExpressionInfo[] expressions) { 129 final ExpressionInfo[] tmpExpressions = new ExpressionInfo[m_expressionInfos.length + expressions.length]; 130 java.lang.System.arraycopy(m_expressionInfos, 0, tmpExpressions, 0, m_expressionInfos.length); 131 java.lang.System.arraycopy(expressions, 0, tmpExpressions, m_expressionInfos.length, expressions.length); 132 m_expressionInfos = new ExpressionInfo[m_expressionInfos.length + expressions.length]; 133 java.lang.System.arraycopy(tmpExpressions, 0, m_expressionInfos, 0, tmpExpressions.length); 134 } 135 } | Popular Tags |