You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CatchClauseSignatureImpl.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v 2.0
  7. * which accompanies this distribution and is available at
  8. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.runtime.reflect;
  14. import org.aspectj.lang.reflect.CatchClauseSignature;
  15. class CatchClauseSignatureImpl extends SignatureImpl implements CatchClauseSignature {
  16. Class<?> parameterType;
  17. String parameterName;
  18. CatchClauseSignatureImpl(Class<?> declaringType,
  19. Class<?> parameterType, String parameterName)
  20. {
  21. super(0, "catch", declaringType);
  22. this.parameterType = parameterType;
  23. this.parameterName = parameterName;
  24. }
  25. CatchClauseSignatureImpl(String stringRep) {
  26. super(stringRep);
  27. }
  28. public Class getParameterType() {
  29. if (parameterType == null) parameterType = extractType(3);
  30. return parameterType;
  31. }
  32. public String getParameterName() {
  33. if (parameterName == null) parameterName = extractString(4);
  34. return parameterName;
  35. }
  36. protected String createToString(StringMaker sm) {
  37. return "catch(" + sm.makeTypeName(getParameterType()) + ")";
  38. }
  39. }