public static final class JavaFix.TransformationContext extends Object
WorkingCopy
through which
modifications of Java source code can be made.Modifier and Type | Method and Description |
---|---|
TreePath |
getPath()
|
InputStream |
getResourceContent(FileObject file)
Allows access to non-Java resources.
|
OutputStream |
getResourceOutput(FileObject file)
Record a changed version of a file.
|
WorkingCopy |
getWorkingCopy()
A
WorkingCopy over which the transformation should operate. |
@NonNull public WorkingCopy getWorkingCopy()
WorkingCopy
over which the transformation should operate.WorkingCopy
over which the transformation should operate.@NonNull public InputStream getResourceContent(@NonNull FileObject file) throws IOException, IllegalArgumentException
JavaFix.TransformationContext.getResourceOutput(org.openide.filesystems.FileObject)
before calling this method.file
- whose content should be returnedIOException
- if something goes wrong while opening the fileIllegalArgumentException
- if file
parameter is null, or
if it represents a Java file@NonNull public OutputStream getResourceOutput(@NonNull FileObject file) throws IOException
file
- whose content should be changedOutputStream
into which the new content of the file should be writtenIOException
- if something goes wrong while opening the fileIllegalArgumentException
- if file
parameter is null, or
if it represents a Java file