Package org.openrewrite.java
Annotation Interface InlineMe
Indicates that calls to the annotated method or constructor can be replaced with the provided replacement template.
This annotation is typically used to mark methods or constructors that are deprecated and have a preferred alternative
implementation. The replacement template should provide a way to achieve the same functionality as the annotated
method or constructor, but using a different approach.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionA Java template that can be used to replace calls to the annotated method. -
Optional Element Summary
Optional Elements
-
Element Details
-
replacement
String replacementA Java template that can be used to replace calls to the annotated method. Typically starts withthis.for method invocations in the same class, orthis(, for constructor invocations in the same class. Replacement templates may refer to elements from other classes, provided the necessary imports are passed in. Replacement templates can reference method parameters by name, and can also referencethis.- Returns:
- a Java template that can be used to replace calls to the annotated method.
-
imports
String[] importsOptional imports required by the replacement template.- Returns:
- imports to be used when compiling the replacement template, and added to the source file if necessary.
- Default:
{}
-
staticImports
String[] staticImportsOptional static imports required by the replacement template.- Returns:
- static imports to be used when compiling the replacement template, and added to the source file if necessary.
- Default:
{}
-