01: /*
02: * Spoon - http://spoon.gforge.inria.fr/
03: * Copyright (C) 2006 INRIA Futurs <renaud.pawlak@inria.fr>
04: *
05: * This software is governed by the CeCILL-C License under French law and
06: * abiding by the rules of distribution of free software. You can use, modify
07: * and/or redistribute the software under the terms of the CeCILL-C license as
08: * circulated by CEA, CNRS and INRIA at http://www.cecill.info.
09: *
10: * This program is distributed in the hope that it will be useful, but WITHOUT
11: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
13: *
14: * The fact that you are presently reading this means that you have had
15: * knowledge of the CeCILL-C license and that you accept its terms.
16: */
17:
18: package spoon.reflect.declaration;
19:
20: import java.util.List;
21: import java.util.Set;
22:
23: import spoon.reflect.code.CtBlock;
24: import spoon.reflect.reference.CtExecutableReference;
25: import spoon.reflect.reference.CtTypeReference;
26:
27: /**
28: * This element represents an executable element such as a method, a
29: * constructor, or an anonymous block.
30: */
31: public interface CtExecutable<R> extends CtNamedElement,
32: CtGenericElement, CtTypedElement<R> {
33:
34: /**
35: * The separator for a string representation of an executable.
36: */
37: public static final String EXECUTABLE_SEPARATOR = "#";
38:
39: /**
40: * Gets the body expression.
41: */
42: <B extends R> CtBlock<B> getBody();
43:
44: /**
45: * Gets the declaring type
46: */
47: CtType<?> getDeclaringType();
48:
49: /**
50: * Gets the parameters list.
51: */
52: List<CtParameter<?>> getParameters();
53:
54: /*
55: * (non-Javadoc)
56: *
57: * @see spoon.reflect.declaration.CtNamedElement#getReference()
58: */
59: CtExecutableReference<R> getReference();
60:
61: /**
62: * Returns the exceptions and other throwables listed in this method or
63: * constructor's <tt>throws</tt> clause.
64: */
65: Set<CtTypeReference<? extends Throwable>> getThrownTypes();
66:
67: /**
68: * Sets the body expression.
69: */
70: <B extends R> void setBody(CtBlock<B> body);
71:
72: /**
73: * Sets the parameters.
74: */
75: void setParameters(List<CtParameter<?>> parameters);
76:
77: /**
78: * Sets the thrown types.
79: */
80: void setThrownTypes(
81: Set<CtTypeReference<? extends Throwable>> thrownTypes);
82:
83: }
|