public class Properties extends Properties
Modifier and Type | Field and Description |
---|---|
static String |
BOOLEAN_TYPE |
static String |
EXE_PATH |
static String |
FILE_PATH |
static String |
FILE_PATH_LIST |
static String |
INTEGER_TYPE |
static String[] |
KNOWN_TYPES |
static String |
LIST_TYPE |
static String |
NO_BROAD_USE
Added description for general properties that are not meant to be used in their general form.
|
static String |
NUMERTIC_TYPE |
static String |
POS_INTEGER_TYPE |
static String |
REQUIRED
Prefix for property types whose values cannot be null.
|
static String |
STRING_TYPE |
defaults
Constructor and Description |
---|
Properties()
Default constructor.
|
Properties(Properties defaultConfig)
Constructor called when "pipeline.defaultProps" contains a valid file-path
|
Modifier and Type | Method and Description |
---|---|
protected static Properties |
buildConfig(File propFile)
Recursive method handles nested default Config files.
|
static String |
deprecatedPropMessage(String prop)
Returns a message telling the user that the property is deprecated.
|
protected static ArrayList<File> |
getDefaultConfig(File propFile)
Parse property file for the property "pipeline.defaultProps".
|
static String |
getDescription(String prop) |
static List<String> |
getListedModules(File file) |
static HashMap<String,String> |
getPropDescMap()
Allow the API to access the list of properties and descriptions.
|
static String |
getPropertyType(String prop) |
static HashMap<String,String> |
getPropTypeMap()
Allow the API to access the list of properties and descriptions.
|
static boolean |
isDeprecatedProp(String prop)
Determines if the given prop is in the list of deprecated properties.
|
static boolean |
isValidExeProp(BioModule module,
String property)
Verify that a given exe property has a valid value.
|
static Boolean |
isValidProp(String property)
Check if a property has a value in a valid format.
|
protected void |
load(FileInputStream fis)
Load properties, adding escape characters where necessary.
|
static Properties |
loadProperties(File file)
Instantiate
Properties via buildConfig(File) |
protected static Properties |
readProps(File propFile,
Properties defaultProps)
Read the properties defined in the required propFile and defaultProps (if included) to build Config.
Properties in propFile will override the defaultProps. |
static void |
registerProp(String prop,
String type,
String desc)
Allow utility classes to keep their props private but still register them with Properties for API.
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public static final String REQUIRED
public static final String NO_BROAD_USE
public static final String STRING_TYPE
public static final String BOOLEAN_TYPE
public static final String FILE_PATH
public static final String EXE_PATH
public static final String LIST_TYPE
public static final String FILE_PATH_LIST
public static final String INTEGER_TYPE
public static final String POS_INTEGER_TYPE
public static final String NUMERTIC_TYPE
public static final String[] KNOWN_TYPES
public Properties()
public Properties(Properties defaultConfig)
defaultConfig
- Config built from "pipeline.defaultProps" propertyprotected void load(FileInputStream fis) throws IOException
fis
- FileInputStreamIOException
- if unable to convert escape characterspublic static Properties loadProperties(File file) throws Exception
Properties
via buildConfig(File)
file
- of Properties
fileException
- if unable to extract properties from filePathprotected static Properties buildConfig(File propFile) throws Exception
propFile
- BioLockJ Configuration fileException
- if errors occurprotected static ArrayList<File> getDefaultConfig(File propFile) throws BioLockJException, IOException
propFile
- BioLockJ Config fileBioLockJException
IOException
- if FileReader reader fails to close.Exception
- if errors occurprotected static Properties readProps(File propFile, Properties defaultProps) throws FileNotFoundException, IOException
propFile
- BioLockJ configuration filedefaultProps
- Default propertiesProperties
instanceFileNotFoundException
- thrown if propFile is not a valid file pathIOException
- thrown if propFile or defaultProps cannot be parsed to read in propertiespublic static List<String> getListedModules(File file) throws Exception
Exception
public static void registerProp(String prop, String type, String desc) throws API_Exception
prop
- a propertytype
- The expected type of value for that property, must be one of the recognized types in Properties classdesc
- Human readable string for users guide and similar uses.API_Exception
public static HashMap<String,String> getPropDescMap() throws API_Exception
API_Exception
public static String getDescription(String prop) throws API_Exception
API_Exception
public static HashMap<String,String> getPropTypeMap() throws API_Exception
API_Exception
public static String getPropertyType(String prop) throws API_Exception
API_Exception
public static boolean isValidExeProp(BioModule module, String property)
property
- public static Boolean isValidProp(String property) throws API_Exception
property
- API_Exception
public static boolean isDeprecatedProp(String prop)
prop
-