KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > runtime > reflect > CatchClauseSignatureImpl


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 v1.0
7  * which accompanies this distribution and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * Xerox/PARC initial implementation
12  * ******************************************************************/

13
14
15 package org.aspectj.runtime.reflect;
16
17 import org.aspectj.lang.reflect.CatchClauseSignature;
18
19 class CatchClauseSignatureImpl extends SignatureImpl implements CatchClauseSignature {
20     Class JavaDoc parameterType;
21     String JavaDoc parameterName;
22     
23     CatchClauseSignatureImpl(Class JavaDoc declaringType,
24         Class JavaDoc parameterType, String JavaDoc parameterName)
25     {
26         super(0, "catch", declaringType);
27         this.parameterType = parameterType;
28         this.parameterName = parameterName;
29     }
30     
31     CatchClauseSignatureImpl(String JavaDoc stringRep) {
32         super(stringRep);
33     }
34     
35     public Class JavaDoc getParameterType() {
36         if (parameterType == null) parameterType = extractType(3);
37         return parameterType;
38     }
39     public String JavaDoc getParameterName() {
40         if (parameterName == null) parameterName = extractString(4);
41         return parameterName;
42     }
43     
44     protected String JavaDoc createToString(StringMaker sm) {
45         return "catch(" + sm.makeTypeName(getParameterType()) + ")";
46     }
47 }
48
Popular Tags