]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2007, 2011 IBM Corporation and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * IBM Corporation - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.corext.refactoring.structure; | |
12 | ||
13 | import java.util.List; | |
14 | ||
15 | import org.eclipse.jdt.core.dom.Expression; | |
16 | import org.eclipse.jdt.core.dom.MethodDeclaration; | |
17 | import org.eclipse.jdt.core.dom.Type; | |
18 | ||
19 | import org.eclipse.jdt.internal.corext.refactoring.ParameterInfo; | |
20 | ||
21 | public interface IDefaultValueAdvisor { | |
22 | ||
23 | /** | |
24 | * Creates a default expression for an added parameter for a given method invocation. | |
25 | * | |
26 | * @param invocationArguments arguments of the method invocation | |
27 | * @param addedInfo the added ParamterInfo object | |
28 | * @param parameterInfos all ParameterInfo objects, including the added ParameterInfo | |
29 | * @param enclosingMethod the Method that encloses the invocation. Can be null if there is no enclosing method | |
30 | * @param isRecursive true if called from a recursive invocation | |
31 | * @param cuRewrite the CompilationUnitRewrite to use for rewrite, imports etc.. | |
32 | * @return a new Expression to be used as argument for the new parameter | |
33 | */ | |
34 | Expression createDefaultExpression(List<Expression> invocationArguments, ParameterInfo addedInfo, List<ParameterInfo> parameterInfos, MethodDeclaration enclosingMethod, boolean isRecursive, CompilationUnitRewrite cuRewrite); | |
35 | ||
36 | /** | |
37 | * Create a type for the added parameter. | |
38 | * | |
39 | * @param newTypeName the fully qualified name of the type | |
40 | * @param startPosition the position where the type is defined in a compilation unit | |
41 | * @param cuRewrite the CompilationUnitRewrite to use for rewrite, imports etc.. | |
42 | * @return the new type to be used in default expressions | |
43 | */ | |
44 | Type createType(String newTypeName, int startPosition, CompilationUnitRewrite cuRewrite); | |
45 | ||
46 | } |