public class CodeSnipitInserter extends Object
| Constructor and Description |
|---|
CodeSnipitInserter() |
| Modifier and Type | Method and Description |
|---|---|
void |
insert(JavaForgerConfiguration config,
String mergeClassPath,
String newCode,
LinkedHashMap<CodeSnipitLocation,CodeSnipitLocation> newCodeInsertionLocations)
Inserts the new code into the file given by the mergeClassPath according to the insertLocations.
|
public void insert(JavaForgerConfiguration config, String mergeClassPath, String newCode, LinkedHashMap<CodeSnipitLocation,CodeSnipitLocation> newCodeInsertionLocations) throws IOException
config - JavaForgerConfiguration indicating insert settings, such as if it is allowed to override code or only to insert.mergeClassPath - The path to the class to merge the new code into.newCode - The code to insert.newCodeInsertionLocations - Defines where new code needs to be inserted in the existing code. This map should be ordered on increasing insertLocation.IOException - If path to existing class is invalid.Copyright © 2019. All rights reserved.