public abstract class ExtensionMigrator extends java.lang.Object implements Migrator
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ExtensionMigrator.AdjustedObject |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isSelected |
protected static java.lang.String |
ROOT_TAG |
protected static int |
SETTINGS |
JDEV_HOME_DIR, SYSTEM_DIR| Constructor and Description |
|---|
ExtensionMigrator() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addToProductPreferences()
Determines whether the migrated preferences should be added into the
Preferences object or remain separate.
|
protected ExtensionMigrator.AdjustedObject[] |
adjustObject(java.lang.String inKey,
java.lang.Object inObject)
Override to adjust an object in some way after it has been created
by Object2Dom and before it's either saved in the Preferences
or ClientSetting object.
|
boolean |
canMigrate(int category,
java.io.File sourceDir)
No categories supported.
|
java.lang.String[] |
copyPreferenceObject(java.io.File srcFile,
java.io.File destFile,
java.util.List settingKeys,
java.lang.String extensionID) |
static java.lang.String[] |
copyPreferenceObjectsAsIs(java.io.File srcFile,
java.io.File destFile,
java.util.List settingKeys,
java.lang.String extensionID) |
protected java.util.Collection<java.lang.String> |
getClassNamesToIgnoreErrorsOn()
Provides a way to suppress errors from Object2Dom when the preferences
file is read and contains preferences that are not in the same class loader
as the preferences you are migrating.
|
java.lang.String |
getDescription(int category)
No descriptions supported.
|
protected java.io.File |
getDestFile(java.io.File destDir)
Get the destination File from the given directory.
|
protected abstract java.lang.String |
getExtensionID()
Get the extension ID for which settings should be persisted.
|
protected java.io.File |
getIde1013ExtensionDirectory(java.io.File sourceDir) |
int[] |
getMigrationCategories()
No categories supported.
|
protected java.lang.ClassLoader |
getMigratorClassLoader()
Override to provide a class loader other than the one that
supplies the subclass of ExtensionMigrator.
|
protected java.lang.String |
getRootTag(java.net.URL sourceURL)
Override this only if the file that's storing your preferences uses a
different root tag than
ROOT_TAG. |
protected abstract java.util.List |
getSettingKeys()
Get a complete list of all key values for persisting in the ClientSetting
object associated with an extension.
|
protected java.io.File |
getSourceFile(java.io.File sourceDir)
Get the source File from the given directory.
|
protected java.io.File |
getSourceFileOrJDevExtrasFile(java.io.File sourceDir)
Get the source File from the given directory with the name
preferences.xml.
|
boolean |
isSelected(int category)
No categories supported.
|
protected java.lang.Class |
loadClass(org.w3c.dom.Element element) |
java.lang.String[] |
migrate(java.io.File sourceDir,
java.io.File destDir)
Migrate all flagged categories, from a given source directory, to a given
destination directory.
|
void |
setSelected(int category,
boolean selected)
No categories supported.
|
protected static final int SETTINGS
protected boolean isSelected
protected static final java.lang.String ROOT_TAG
public int[] getMigrationCategories()
getMigrationCategories in interface Migratorpublic java.lang.String getDescription(int category)
getDescription in interface Migratorcategory - ignored.public boolean canMigrate(int category,
java.io.File sourceDir)
canMigrate in interface Migratorcategory - ignored.sourceDir - ignored.public void setSelected(int category,
boolean selected)
setSelected in interface Migratorcategory - ignored.selected - ignored.public boolean isSelected(int category)
isSelected in interface Migratorcategory - ignored.public java.lang.String[] migrate(java.io.File sourceDir,
java.io.File destDir)
Migratorpublic static java.lang.String[] copyPreferenceObjectsAsIs(java.io.File srcFile,
java.io.File destFile,
java.util.List settingKeys,
java.lang.String extensionID)
public java.lang.String[] copyPreferenceObject(java.io.File srcFile,
java.io.File destFile,
java.util.List settingKeys,
java.lang.String extensionID)
protected java.lang.ClassLoader getMigratorClassLoader()
protected ExtensionMigrator.AdjustedObject[] adjustObject(java.lang.String inKey, java.lang.Object inObject)
protected java.io.File getSourceFile(java.io.File sourceDir)
sourceDir - the source directory.protected java.io.File getSourceFileOrJDevExtrasFile(java.io.File sourceDir)
sourceDir - the source directory.protected java.io.File getDestFile(java.io.File destDir)
destDir - the destination directory.protected boolean addToProductPreferences()
protected java.util.Collection<java.lang.String> getClassNamesToIgnoreErrorsOn()
protected java.lang.String getRootTag(java.net.URL sourceURL)
ROOT_TAG. The only known case of
this current is IdeMigrator to handle migrating settings.xml and it needs
to vary the root tag based on what URL it is trying to work withprotected java.lang.Class loadClass(org.w3c.dom.Element element)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionprotected abstract java.util.List getSettingKeys()
protected abstract java.lang.String getExtensionID()
protected java.io.File getIde1013ExtensionDirectory(java.io.File sourceDir)