public class PropertyFrameworkGlobals extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PropertyFrameworkGlobals.GlobalPropertyStaticCollection |
Constructor and Description |
---|
PropertyFrameworkGlobals() |
Modifier and Type | Method and Description |
---|---|
static boolean |
doAutoEncryptPasswords()
Gets the framework override for autoEncrypts a password in PasswordPropertyType.
|
static boolean |
doAutoRegisterPropertyCollections()
Gets if all PropertyCollections shall automatically register it self in
PropertyCollectionRegistry . |
static boolean |
doDisardValueQuotes()
Gets if values loaded from PropertyIO should have any "" or '' removed before further validation.
|
static boolean |
doLogDebugFrameworkPerformance()
If framework performance should be logged as a debug message.
|
static boolean |
doLogFileValidations()
Shall the framework log a message everytime its use a FileValidator.
|
static boolean |
doLogWarningIfUsingDefaultValues()
Do the framework logs a warning if the a property cant be loaded and the default value is used instead.
|
static boolean |
doReplaceInlinedProperties()
Do the framework replace inline values.
|
static boolean |
doUseDefaultValues()
Do the framework use default value set for the PropertyType is a valid value isnt found for a Property.
|
static boolean |
doValidateIPathPropertyTypes()
In PropertyCollection should Properties with a PropertyType which implements the marker interface "IPathPropertyType" be validated.
|
static long |
getDefaultPropertyIOCacheFlushingInMs()
Gets the time in milliseconds which is the default timeout value for the cache for any PropertyIO.
|
static Proxy |
getDefaultProxy()
Get the globally set Proxy.
|
static double |
getDoublePrecision()
When comparing two doubles, this value is total amount of difference two doubles must have absolute.
|
static Localizer |
getPropertyDescriptionLocalizer()
An implementation of the Localizer, from where Property will retrieve the description.
|
static void |
logGlobalProperties()
Logs all the values for the global propeties as info messages.
|
static void |
logGlobalPropertiesOnce()
Logs all the values for the global propeties as info messages, but only once.
|
static void |
resetGlobalSettings()
Resets all the global setting to default values and print them to the logger.
|
static void |
setAutoEncryptPasswords(boolean value)
Overrides general behaviour of PasswordPropertyType, no matter what the autoEncrypt is set to in the PasswordPropertyType.
|
static void |
setAutoRegisterPropertyCollections(boolean newAutoRegisterPropertyCollections)
Sets whether PropertyCollections automatically shall be registered in "PropertyCollectionRegistry".
|
static void |
setDefaultPropertyIOCacheFlushingInMs(long defaultPropertyIOCacheFlushingInMs)
Sets the time in milliseconds which is the default timeout value for the cache for any PropertyIO.
|
static void |
setDefaultProxy(Proxy defaultProxy)
Sets a proxy configuration, which can be used by the framework, currently only URLPropertyType is using this.
|
static void |
setDisardValueQuotes(boolean b_disardValueQuotes)
Sets wether values loaded from PropertyIO should have any "" or '' removed before further validation.
|
static void |
setDoublePrecision(double newDoublePrecision)
Sets the precision that two double maximum must have to determine them as equals.
|
static void |
setLogDebugFrameworkPerformance(boolean logDebugFrameworkPerformance)
Sets if framework performance should be logged as a debug message.
|
static void |
setLogFileValidations(boolean value)
Sets if the framework log a message everytime its use a FileValidator.
|
static void |
setLogWarningIfUsingDefaultValues(boolean value)
Set if a warning should be logged if the a property cant be loaded and the default value is used instead.
|
static void |
setPropertyDescriptionLocalizer(Localizer propertyDescriptionLocalizer)
Sets the implementation of the Property description localizer.
|
static void |
setReplaceInlinedProperties(boolean value)
Sets the value if "we" want to have replacement of System properties and System env variables of the loaded values.
|
static void |
setUseDefaultValues(boolean value)
Sets the global behaviour if the framework shall use default values set for a PropertyType, if a valid property value isnt found for
a Property.
|
static void |
setValidateIPathPropertyTypes(boolean value)
Overrides general behaviour of PropertyTypes mark with the interface "IPathPropertyType".
|
public static final void logGlobalProperties()
public static final void logGlobalPropertiesOnce()
public static final void resetGlobalSettings()
public static final boolean doReplaceInlinedProperties()
true
if replacing inline values, otherwise false
.public static final void setReplaceInlinedProperties(boolean value)
value
- true
to replace inline values, otherwise false
.public static final boolean doLogWarningIfUsingDefaultValues()
public static final void setLogWarningIfUsingDefaultValues(boolean value)
value
- true
to log warning if default is used, otherwise false
.public static final boolean doUseDefaultValues()
null
is returned. true
if the framework uses default values for invalid properties, otherwise false
.public static final void setUseDefaultValues(boolean value)
null
is returned.value
- true
if the framework shall use default values for invalid properties, otherwise false
and null
is returned.public static final boolean doLogFileValidations()
true
if logs a message, otherwise false
.public static final void setLogFileValidations(boolean value)
value
- true
to log, false
if not.public static final boolean doAutoEncryptPasswords()
true
will auto encrypt password if setup in the PasswordPropertyType, if false
the framework will NEVER autoEncrypts a password, even if set so.PasswordPropertyType
public static final void setAutoEncryptPasswords(boolean value)
value
- true
to set normal PasswordPropertyType behavior is executed, set to false
than framework will NEVER autoEncrypts a password, even if set so.PasswordTypeVO
,
PasswordPropertyType
public static final boolean doValidateIPathPropertyTypes()
true
if PropertyTypes mark with "IPathPropertyType" should be validated otherwise false
.FilePropertyType
,
DirectoryPropertyType
,
FileStructurePropertyType
public static final void setValidateIPathPropertyTypes(boolean value)
value
- true
to validate PropertyTypes mark with "IPathPropertyType", set to false
to never a PropertyCollecton will never validate then.FilePropertyType
,
DirectoryPropertyType
,
FileStructurePropertyType
public static final double getDoublePrecision()
public static final void setDoublePrecision(double newDoublePrecision) throws IllegalArgumentException
newDoublePrecision
- the new double equal precision.IllegalArgumentException
- if value is above 0.01public static final boolean doAutoRegisterPropertyCollections()
PropertyCollectionRegistry
.true
if they automatically registeres, otherwise false
.PropertyCollectionRegistry
public static final void setAutoRegisterPropertyCollections(boolean newAutoRegisterPropertyCollections)
false
, it will clear the registry.newAutoRegisterPropertyCollections
- should PropertyCollections automatically be registred.PropertyCollectionRegistry
public static final Proxy getDefaultProxy()
null
.public static final void setDefaultProxy(Proxy defaultProxy)
defaultProxy
- the default proxy.public static final boolean doDisardValueQuotes()
false
.true
if "" or '' is to remove around any value loaded, otherwise false.
PropertyCollectionRegistry
public static final void setDisardValueQuotes(boolean b_disardValueQuotes)
b_disardValueQuotes
- true
if "" or '' has to removed around values.public static final Localizer getPropertyDescriptionLocalizer()
null
. Localizer
,
setPropertyDescriptionLocalizer(Localizer)
,
Property.getDescription()
,
Property.getI18NName()
,
PropertyUtils.getI18NName(String, String)
,
PropertyUtils.getPropertyI18NDescription(String)
public static final void setPropertyDescriptionLocalizer(Localizer propertyDescriptionLocalizer)
propertyDescriptionLocalizer
- the localizer for the Property descriptions.Localizer
,
getPropertyDescriptionLocalizer()
,
Property.getDescription()
,
Property.getI18NName()
,
PropertyUtils.getI18NName(String, String)
,
PropertyUtils.getPropertyI18NDescription(String)
public static long getDefaultPropertyIOCacheFlushingInMs()
PropertyIO.getCacheTime()
,
PropertyIO.setCacheTime(long)
public static void setDefaultPropertyIOCacheFlushingInMs(long defaultPropertyIOCacheFlushingInMs)
defaultPropertyIOCacheFlushingInMs
- the default timeout in ms for PropertyIO cache.PropertyIO.getCacheTime()
,
PropertyIO.setCacheTime(long)
public static boolean doLogDebugFrameworkPerformance()
public static void setLogDebugFrameworkPerformance(boolean logDebugFrameworkPerformance)
logDebugFrameworkPerformance
- the logDebugFrameworkPerformance to set