Package com.vaadin.copilot.javarewriter
Class JavaModifier
java.lang.Object
com.vaadin.copilot.javarewriter.JavaModifier
- All Implemented Interfaces:
ClassDeclarationModifier
A utility class for modifying Java source code.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class for performing operations on a CompilationUnit.Nested classes/interfaces inherited from interface com.vaadin.copilot.rewriter.ClassDeclarationModifier
ClassDeclarationModifier.OperationFunction<T>, ClassDeclarationModifier.Operations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmodify(Class<?> cls, ClassDeclarationModifier.OperationFunction<ClassDeclarationModifier.Operations> operations) Modifies the source code of the given class using the provided operations.
-
Constructor Details
-
JavaModifier
public JavaModifier()
-
-
Method Details
-
modify
public Map<File,String> modify(Class<?> cls, ClassDeclarationModifier.OperationFunction<ClassDeclarationModifier.Operations> operations) throws IOException Modifies the source code of the given class using the provided operations.- Specified by:
modifyin interfaceClassDeclarationModifier- Parameters:
cls- The class to modify.operations- The operations to perform on the class.- Returns:
- A map of modified files and their new content.
- Throws:
IOException- If an error occurs
-