Copyright (c) 2000, 2008 IBM Corporation and others. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/ SPDX-License-Identifier: EPL-2.0 Contributors: IBM Corporation - initial API and implementation
/******************************************************************************* * Copyright (c) 2000, 2008 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/
package org.eclipse.jdt.internal.corext.refactoring.tagging; import org.eclipse.core.runtime.CoreException; import org.eclipse.ltk.core.refactoring.RefactoringStatus;
Represents processors in the JDT space that rename elements.
/** * Represents processors in the JDT space that rename elements. */
public interface INameUpdating {
Sets new name for the entity that this refactoring is working on.
Params:
  • newName – the new name
/** * Sets new name for the entity that this refactoring is working on. * @param newName the new name */
public void setNewElementName(String newName);
Get the name for the entity that this refactoring is working on.
Returns:returns the new name
/** * Get the name for the entity that this refactoring is working on. * @return returns the new name */
public String getNewElementName();
Gets the current name of the entity that this refactoring is working on.
Returns:returns the current name
/** * Gets the current name of the entity that this refactoring is working on. * @return returns the current name */
public String getCurrentElementName();
Gets the original elements. Since an INameUpdating only renames one element, this method must return an array containing exactly one element.
See Also:
Returns:an array containing exactly one element
/** * Gets the original elements. Since an <code>INameUpdating</code> only renames one element, * this method must return an array containing exactly one element. * @return an array containing exactly one element * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements() */
public Object[] getElements();
Gets the element after renaming, or null if not available.
Throws:
  • CoreException – thrown when the new element could not be evaluated
Returns:returns the new element or null
/** * Gets the element after renaming, or <code>null</code> if not available. * @return returns the new element or <code>null</code> * * @throws CoreException thrown when the new element could not be evaluated */
public Object getNewElement() throws CoreException;
Checks if the new name is valid for the entity that this refactoring renames.
Params:
  • newName – the new name
Throws:
  • CoreException – Core exception is thrown when the validation could not be performed
Returns:returns the resulting status
/** * Checks if the new name is valid for the entity that this refactoring renames. * @param newName the new name * @return returns the resulting status * @throws CoreException Core exception is thrown when the validation could not be performed */
public RefactoringStatus checkNewElementName(String newName) throws CoreException; }