Package adams.env
Class AbstractPropertiesDefinition
- java.lang.Object
-
- adams.env.AbstractPropertiesDefinition
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ActorSuggestionDefinition
,ActorTemplateSuggestionDefinition
,AdvancedScriptEditorTemplatesDefinition
,BrowserDefinition
,CharsetDefinition
,ClassListerBlacklistDefinition
,ClassListerDefinition
,ClasspathBlacklistDefinition
,ConditionsDefinition
,ConversionDefinition
,DatabaseConnectionDefinition
,DbBackendDefinition
,DriversDefinition
,EmailDefinition
,ExternalActorSuggestionDefinition
,FlowControlCenterPanelDefinition
,FlowDefinition
,FlowEditorPanelDefinition
,FlowEditorPanelMenuDefinition
,FlowEditorTreePopupMenuDefinition
,FlowEditorTreeQuickActionMenuDefinition
,FlowRunnerPanelDefinition
,FontsDefinition
,GOEBlacklistDefinition
,GOEEditorsDefinition
,GUIHelperDefinition
,ImageViewerPanelDefinition
,InstanceCompareDefinition
,InstanceExplorerDefinition
,JenericCmdlineDefinition
,JVisualVMDefinition
,LocaleDefinition
,LogEntryDBViewerPanelDefinition
,LogEntryDefinition
,LogEntryViewerPanelDefinition
,MemoryMonitorDefinition
,ModuleDefinition
,NewInstanceDefinition
,OptionManagerDefinition
,OptionsDefinition
,PerformanceDefinition
,PlaceholdersDefinition
,PreviewBrowserPanelDefinition
,ProxyDefinition
,ScriptingDialogDefinition
,ScriptingEngineDefinition
,ScriptingLoggerDefinition
,SequenceViewerDefinition
,SimpleScriptEditorTemplatesDefinition
,SMBDefinition
,SpreadSheetExplorerDefinition
,SSLDefinition
,TableDefinition
,TesseractDefinition
,TimeZoneDefinition
,WekaInvestigatorDefinition
,WekaInvestigatorShortcutsDefinition
,WineDefinition
public abstract class AbstractPropertiesDefinition extends Object implements Serializable
Ancestor for properties definitions, whether they are merged or replaced.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertiesDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
add(AbstractEnvironment env, String propsdir, String[] overrides)
Adds the props file under they specified key.protected void
add(AbstractEnvironment env, String propsdir, String home, String[] overrides)
Adds the props file under they specified key.protected void
add(AbstractEnvironment env, String propsdir, List<String> dirs, String[] overrides)
Adds the props file under they specified key.String
createPath(String dir)
Creates a full path for the props file, from its path and filename.String
createPath(String dir, String ext)
Creates a full path for the props file, from its path and filename.String
getAlternativeExtension()
Returns an alternative extension to use besides the default one ("props").abstract String
getFile()
Returns the properties file name (no path) this definition is for.abstract String
getKey()
Returns the key this definition is for.boolean
hasAlternativeExtension()
Returns whether an alternative extension is to be used besides the default one ("props").protected void
replace(AbstractEnvironment env, String propsdir)
Adds the props file under they specified key.protected void
replace(AbstractEnvironment env, String propsdir, List<String> dirs)
Adds the props file under they specified key.String
toString()
Returns a short description.abstract void
update(AbstractEnvironment env)
Updates the environment object with its definition for the props file (whether to add/replace/etc the values).
-
-
-
Method Detail
-
getKey
public abstract String getKey()
Returns the key this definition is for.- Returns:
- the key
-
getFile
public abstract String getFile()
Returns the properties file name (no path) this definition is for.- Returns:
- the key
-
hasAlternativeExtension
public boolean hasAlternativeExtension()
Returns whether an alternative extension is to be used besides the default one ("props"). Useful if distinguishing props files from different projects. Only used in "add(...) methods".- Returns:
- true if alternative extension to be used as well
-
getAlternativeExtension
public String getAlternativeExtension()
Returns an alternative extension to use besides the default one ("props"). Useful if distinguishing props files from different projects. Only used in "add(...) methods".- Returns:
- the alternative extension (without dot), null if none available
-
createPath
public String createPath(String dir)
Creates a full path for the props file, from its path and filename.- Parameters:
dir
- the directory the props file is located in- Returns:
- the full path
- See Also:
getFile()
-
createPath
public String createPath(String dir, String ext)
Creates a full path for the props file, from its path and filename.- Parameters:
dir
- the directory the props file is located inext
- the extension to replace current one, null to use default one (without the dot)- Returns:
- the full path
- See Also:
getFile()
-
add
protected void add(AbstractEnvironment env, String propsdir, String[] overrides)
Adds the props file under they specified key.- Parameters:
env
- the environment to updatepropsdir
- the location of the props file (e.g., "adams/gui")overrides
- the keys to override with the values from props files added later on
-
add
protected void add(AbstractEnvironment env, String propsdir, String home, String[] overrides)
Adds the props file under they specified key.- Parameters:
env
- the environment to updatepropsdir
- the location of the props file (e.g., "adams/gui")home
- the home directory to useoverrides
- the keys to override with the values from props files added later on
-
add
protected void add(AbstractEnvironment env, String propsdir, List<String> dirs, String[] overrides)
Adds the props file under they specified key.- Parameters:
env
- the environment to updatepropsdir
- the location of the props file (e.g., "adams/gui")dirs
- the directories to look foroverrides
- the keys (or regular expression of keys) to override with the values from props files added later on
-
replace
protected void replace(AbstractEnvironment env, String propsdir)
Adds the props file under they specified key. Previously added props files are removed first.- Parameters:
env
- the environment to updatepropsdir
- the location of the props file (e.g., "adams/gui")
-
replace
protected void replace(AbstractEnvironment env, String propsdir, List<String> dirs)
Adds the props file under they specified key. Previously added props files are removed first.- Parameters:
env
- the environment to updatepropsdir
- the location of the props file (e.g., "adams/gui")dirs
- the directories to look for
-
update
public abstract void update(AbstractEnvironment env)
Updates the environment object with its definition for the props file (whether to add/replace/etc the values).- Parameters:
env
- the environment object to update
-
-