AppCode 2016.2 Help

Extract Property

In Maven projects, while editing pom.xml, one needs to define a property and replace the occurrences of some value - artifact version, for example, - with this property.

For these purposes, AppCode provides the Extract Property refactoring.

Extract Property refactoring creates a new property definition in the specified pom.xml file, finds all the occurrences of the selected string in the hierarchy of pom.xml files, and replaces them with the above property in the format: ${<property_name>}

The Extract Property refactoring lets you move expressions and local declarations to properties.

To extract a property

  1. Place the cursor within the expression or declaration of a variable to be replaced with a property.
  2. Choose Refactor | Extract | Property in the main menu, or on the context menu.
  3. If more than one occurrence of the expression is found within the class, specify whether you wish to replace only the selected occurrence, or all the found occurrences with the new property.
  4. Choose the semantic for the property.
  5. If you want the constant to be defined in the private category, select the Put to private category check box.
  6. To complete the refactoring, press or .

    If you haven't completed the refactoring and want to cancel the changes you have made, press .

See Also

Last modified: 20 July 2016