1 /*******************************************************************************
2 * Copyright (c) 2006, 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.corext.template.java;
13 import org.eclipse.jdt.internal.corext.template.java.CompilationUnitCompletion.Variable;
16 * Resolves a template variable to a field that is assignment-compatible
17 * with the variable instance' class parameter.
21 public class FieldResolver extends AbstractVariableResolver {
24 * Default constructor for instantiation by the extension point.
26 public FieldResolver() {
27 this("java.lang.Object"); //$NON-NLS-1$
30 FieldResolver(String defaultType) {
35 * @see org.eclipse.jdt.internal.corext.template.java.AbstractVariableResolver#getVisibleVariables(java.lang.String, org.eclipse.jdt.internal.corext.template.java.JavaContext)
38 protected Variable[] getVisibleVariables(String type, JavaContext context) {
39 return context.getFields(type);