1 4 package com.tc.aspectwerkz.definition; 5 6 import com.tc.aspectwerkz.transform.TransformationConstants; 7 import com.tc.aspectwerkz.expression.ExpressionInfo; 8 9 18 public final class DeploymentScope { 19 20 private final String m_name; 21 private final String m_expression; 22 25 public static final DeploymentScope MATCH_ALL = new DeploymentScope( 26 TransformationConstants.ASPECTWERKZ_PREFIX + "DeploymentScopes", 27 "within(*..*)" 28 ); 29 30 36 DeploymentScope(final String name, final String expression) { 37 m_name = name; 38 m_expression = expression; 39 } 40 41 46 public String getName() { 47 return m_name; 48 } 49 50 55 public String getExpression() { 56 return m_expression; 57 } 58 59 65 public ExpressionInfo newExpressionInfo(final ExpressionInfo expression) { 66 return new ExpressionInfo( 67 new StringBuffer (). 68 append('('). 69 append(expression.toString()). 70 append(')'). 71 append(" && "). 72 append(m_expression). 73 toString(), 74 expression.getNamespace() 75 ); 76 } 77 78 public boolean equals(Object o) { 79 if (this == o) { 80 return true; 81 } 82 if (!(o instanceof DeploymentScope)) { 83 return false; 84 } 85 86 final DeploymentScope deploymentScope = (DeploymentScope) o; 87 88 if (!m_expression.equals(deploymentScope.m_expression)) { 89 return false; 90 } 91 if (!m_name.equals(deploymentScope.m_name)) { 92 return false; 93 } 94 95 return true; 96 } 97 98 public int hashCode() { 99 int result; 100 result = m_name.hashCode(); 101 result = 29 * result + m_expression.hashCode(); 102 return result; 103 } 104 } | Popular Tags |