public abstract class XMLMigrator extends java.lang.Object implements Migrator
Modifier and Type | Class and Description |
---|---|
static class |
XMLMigrator.MigrationLogger |
JDEV_HOME_DIR, SYSTEM_DIR
Modifier | Constructor and Description |
---|---|
protected |
XMLMigrator(int[] categories) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
adjustObject(java.io.File sourceDir,
java.io.File destDir,
java.lang.Object obj)
Perform any postprocessing necessary before migrating the file.
|
boolean |
canMigrate(int category,
java.io.File sourceDir)
Determine whether the settings can be migrated from the given directory.
|
protected int |
categoryToIndex(int category)
Get the internal index of the given category.
|
protected java.io.File |
getDestFile(java.io.File sourceDir,
java.io.File destDir)
Get the File to hold the information being migrated.
|
protected abstract java.lang.String |
getFileName()
Get the filename to migrate.
|
protected XMLMigrator.MigrationLogger |
getLogger() |
int[] |
getMigrationCategories()
Get an array of unique id values representing available categories to
migrate.
|
protected abstract java.lang.String |
getNamespaceURI()
Get the XML namespace URI.
|
protected Object2Dom |
getObjectStore() |
protected abstract java.lang.String |
getRootTag()
Get the XML root element tag.
|
protected java.io.File |
getSourceFile(java.io.File sourceDir,
java.io.File destDir)
Get the File containing the information to be migrated.
|
protected boolean |
isAnyCategorySelected()
Determine whether any categories are selected.
|
boolean |
isSelected(int category)
Determine whether a category has been flagged for migration.
|
protected boolean |
isValidCategory(int category)
Determine whether the given category is valid for this Migrator.
|
java.lang.String[] |
migrate(java.io.File sourceDir,
java.io.File destDir)
Migrate the settings from a given source directory to a given destination
directory.
|
protected void |
prepareToMigrate()
Perform any preprocessing necessary before migrating the file.
|
protected java.lang.Object |
readObject(java.io.File sourceDir,
java.io.File destDir)
Read in the settings.
|
void |
setSelected(int category,
boolean selected)
Flag a category as selected for migration.
|
protected void |
writeObject(java.io.File sourceDir,
java.io.File destDir,
java.lang.Object settings)
Write out the settings.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription
public final int[] getMigrationCategories()
getMigrationCategories
in interface Migrator
public void setSelected(int category, boolean selected)
setSelected
in interface Migrator
public final boolean isSelected(int category)
isSelected
in interface Migrator
public boolean canMigrate(int category, java.io.File sourceDir)
canMigrate
in interface Migrator
public java.lang.String[] migrate(java.io.File sourceDir, java.io.File destDir)
protected abstract java.lang.String getFileName()
protected abstract java.lang.String getNamespaceURI()
protected abstract java.lang.String getRootTag()
protected final boolean isValidCategory(int category)
protected final int categoryToIndex(int category)
protected final boolean isAnyCategorySelected()
protected void prepareToMigrate()
protected java.lang.Object readObject(java.io.File sourceDir, java.io.File destDir) throws java.lang.Exception
java.lang.Exception
protected void writeObject(java.io.File sourceDir, java.io.File destDir, java.lang.Object settings) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object adjustObject(java.io.File sourceDir, java.io.File destDir, java.lang.Object obj) throws java.lang.Exception
java.lang.Exception
protected java.io.File getSourceFile(java.io.File sourceDir, java.io.File destDir)
protected java.io.File getDestFile(java.io.File sourceDir, java.io.File destDir)
protected final XMLMigrator.MigrationLogger getLogger()
protected final Object2Dom getObjectStore()