public final class MapFile
extends java.lang.Object
Constructor and Description |
---|
MapFile() |
Modifier and Type | Method and Description |
---|---|
ClassRecord |
addClass(java.lang.String originalName,
java.lang.String newName)
Add a class to the map file.
|
java.util.Iterator<ClassRecord> |
classes()
Return an iterator over the class renaming information.
|
static MapFile |
forFilename(java.lang.String filename)
Creates a MapFile instance and loads the map file.
|
ClassRecord |
getClass(java.lang.String className)
Find a class by its original name.
|
int |
getClassesCount()
Return the number of class renaming records the map file has.
|
ClassRecord |
getRenamedClass(java.lang.String className)
Find a class by its new name.
|
boolean |
hasClasses()
Does the map file contain any class renaming information?
|
void |
load(java.io.File file)
Loads the map file from the given file.
|
boolean |
removeClass(ClassRecord clazz)
Remove a class from the renaming info.
|
void |
save(java.io.File file)
Stores the map file.
|
public static MapFile forFilename(java.lang.String filename) throws java.io.IOException
filename
- the filename of the map containing the mapping
information.java.io.IOException
- if there is a problem reading or parsing the filepublic void load(java.io.File file) throws java.io.IOException
file
- the file containing the mapping information.java.io.IOException
- if there is a problem reading or parsing the filepublic void save(java.io.File file) throws java.io.IOException
file
- the file that will hold the map file data.java.io.IOException
- if the file cannot be saved.public java.util.Iterator<ClassRecord> classes()
public boolean hasClasses()
true
if the map file has information about renamed
classes.public int getClassesCount()
public ClassRecord getRenamedClass(java.lang.String className)
className
- the new name of the class in either source code or class
file format.null
if not foundpublic ClassRecord getClass(java.lang.String className)
className
- the original name of the class in either source code or
class file format.null
if not foundpublic ClassRecord addClass(java.lang.String originalName, java.lang.String newName)
originalName
- the original name of the class in either source code
or class file format.newName
- the original name of the class in either source code or
class file format.public boolean removeClass(ClassRecord clazz)
clazz
- the item to removetrue
if the item was removedCopyright 2019 PreEmptive Solutions, LLC. All Rights Reserved.