/** * We need to hold the returning name at this level for argument binding calculations, * this method allows the afterReturning advice subclass to set the name. */ protected void setReturningNameNoCheck(String name) { // name could be a variable or a type... if (isVariableName(name)) { this.returningName = name; } else { // assume a type try { this.discoveredReturningType = ClassUtils.forName(name, getAspectClassLoader()); } catch (Throwable ex) { throw new IllegalArgumentException("Returning name '" + name + "' is neither a valid argument name nor the fully-qualified " + "name of a Java type on the classpath. Root cause: " + ex); } } }
/** * We need to hold the throwing name at this level for argument binding calculations, * this method allows the afterThrowing advice subclass to set the name. */ protected void setThrowingNameNoCheck(String name) { // name could be a variable or a type... if (isVariableName(name)) { this.throwingName = name; } else { // assume a type try { this.discoveredThrowingType = ClassUtils.forName(name, getAspectClassLoader()); } catch (Throwable ex) { throw new IllegalArgumentException("Throwing name '" + name + "' is neither a valid argument name nor the fully-qualified " + "name of a Java type on the classpath. Root cause: " + ex); } } }
public void setArgumentNamesFromStringArray(String... args) { this.argumentNames = new String[args.length]; for (int i = 0; i < args.length; i++) { this.argumentNames[i] = StringUtils.trimWhitespace(args[i]); if (!isVariableName(this.argumentNames[i])) { throw new IllegalArgumentException( "'argumentNames' property of AbstractAspectJAdvice contains an argument name '" + this.argumentNames[i] + "' that is not a valid Java identifier"); } } if (this.argumentNames != null) { if (this.aspectJAdviceMethod.getParameterCount() == this.argumentNames.length + 1) { // May need to add implicit join point arg name... Class<?> firstArgType = this.aspectJAdviceMethod.getParameterTypes()[0]; if (firstArgType == JoinPoint.class || firstArgType == ProceedingJoinPoint.class || firstArgType == JoinPoint.StaticPart.class) { String[] oldNames = this.argumentNames; this.argumentNames = new String[oldNames.length + 1]; this.argumentNames[0] = "THIS_JOIN_POINT"; System.arraycopy(oldNames, 0, this.argumentNames, 1, oldNames.length); } } } }
/** * We need to hold the returning name at this level for argument binding calculations, * this method allows the afterReturning advice subclass to set the name. */ protected void setReturningNameNoCheck(String name) { // name could be a variable or a type... if (isVariableName(name)) { this.returningName = name; } else { // assume a type try { this.discoveredReturningType = ClassUtils.forName(name, getAspectClassLoader()); } catch (Throwable ex) { throw new IllegalArgumentException("Returning name '" + name + "' is neither a valid argument name nor the fully-qualified " + "name of a Java type on the classpath. Root cause: " + ex); } } }
/** * We need to hold the throwing name at this level for argument binding calculations, * this method allows the afterThrowing advice subclass to set the name. */ protected void setThrowingNameNoCheck(String name) { // name could be a variable or a type... if (isVariableName(name)) { this.throwingName = name; } else { // assume a type try { this.discoveredThrowingType = ClassUtils.forName(name, getAspectClassLoader()); } catch (Throwable ex) { throw new IllegalArgumentException("Throwing name '" + name + "' is neither a valid argument name nor the fully-qualified " + "name of a Java type on the classpath. Root cause: " + ex); } } }
public void setArgumentNamesFromStringArray(String... args) { this.argumentNames = new String[args.length]; for (int i = 0; i < args.length; i++) { this.argumentNames[i] = StringUtils.trimWhitespace(args[i]); if (!isVariableName(this.argumentNames[i])) { throw new IllegalArgumentException( "'argumentNames' property of AbstractAspectJAdvice contains an argument name '" + this.argumentNames[i] + "' that is not a valid Java identifier"); } } if (this.argumentNames != null) { if (this.aspectJAdviceMethod.getParameterCount() == this.argumentNames.length + 1) { // May need to add implicit join point arg name... Class<?> firstArgType = this.aspectJAdviceMethod.getParameterTypes()[0]; if (firstArgType == JoinPoint.class || firstArgType == ProceedingJoinPoint.class || firstArgType == JoinPoint.StaticPart.class) { String[] oldNames = this.argumentNames; this.argumentNames = new String[oldNames.length + 1]; this.argumentNames[0] = "THIS_JOIN_POINT"; System.arraycopy(oldNames, 0, this.argumentNames, 1, oldNames.length); } } } }