1 8 package org.codehaus.aspectwerkz.definition; 9 10 import org.codehaus.aspectwerkz.expression.ExpressionInfo; 11 import org.codehaus.aspectwerkz.transform.TransformationConstants; 12 13 22 public final class DeploymentScope { 23 24 private final String m_name; 25 private final String m_expression; 26 29 public static final DeploymentScope MATCH_ALL = new DeploymentScope( 30 TransformationConstants.ASPECTWERKZ_PREFIX + "DeploymentScopes", 31 "within(*..*)" 32 ); 33 34 40 DeploymentScope(final String name, final String expression) { 41 m_name = name; 42 m_expression = expression; 43 } 44 45 50 public String getName() { 51 return m_name; 52 } 53 54 59 public String getExpression() { 60 return m_expression; 61 } 62 63 69 public ExpressionInfo newExpressionInfo(final ExpressionInfo expression) { 70 return new ExpressionInfo( 71 new StringBuffer (). 72 append('('). 73 append(expression.toString()). 74 append(')'). 75 append(" && "). 76 append(m_expression). 77 toString(), 78 expression.getNamespace() 79 ); 80 } 81 82 public boolean equals(Object o) { 83 if (this == o) { 84 return true; 85 } 86 if (!(o instanceof DeploymentScope)) { 87 return false; 88 } 89 90 final DeploymentScope deploymentScope = (DeploymentScope) o; 91 92 if (!m_expression.equals(deploymentScope.m_expression)) { 93 return false; 94 } 95 if (!m_name.equals(deploymentScope.m_name)) { 96 return false; 97 } 98 99 return true; 100 } 101 102 public int hashCode() { 103 int result; 104 result = m_name.hashCode(); 105 result = 29 * result + m_expression.hashCode(); 106 return result; 107 } 108 } | Popular Tags |