
Classes | |
| class | _Properties |
| class | EncryptedOperator |
| class | InRangeOperator |
| interface | Operator |
| class | Property |
Public Member Functions | |
| String | getProperty (String key) |
| void | takeValueForKey (Object anObject, String aKey) |
| Object | toExternalForm () throws IOException |
| Object | valueForKey (String aKey) |
Static Public Member Functions | |
| static NSArray< Property > | allProperties () |
| static Map< String, String > | allPropertiesMap (boolean protectValues) |
| static String | applicationDeveloperProperties () |
| static String | applicationMachinePropertiesPath (String fileName) |
| static String | applicationUserProperties () |
| static Properties | applyConfiguration (Properties source, Properties commandLine) |
| static NSArray | arrayForKey (String s) |
| static NSArray | arrayForKeyWithDefault (final String s, final NSArray defaultValue) |
| static BigDecimal | bigDecimalForKey (String s) |
| static BigDecimal | bigDecimalForKeyWithDefault (String s, BigDecimal defaultValue) |
| static boolean | booleanForKey (String s) |
| static boolean | booleanForKeyWithDefault (final String s, final boolean defaultValue) |
| static NSArray< String > | componentsSeparatedByString (String key, String separator) |
| static NSArray< String > | componentsSeparatedByStringWithDefault (String key, String separator, NSArray< String > defaultValue) |
| static String | decryptedStringForKey (String propertyName) |
| static String | decryptedStringForKeyWithDefault (String propertyName, String defaultValue) |
| static String | decryptedStringForKeyWithEncryptedDefault (String propertyName, String defaultValue) |
| static NSDictionary | dictionaryForKey (String s) |
| static NSDictionary | dictionaryForKeyWithDefault (final String s, final NSDictionary defaultValue) |
| static double | doubleForKey (String s) |
| static double | doubleForKeyWithDefault (final String s, final double defaultValue) |
| static void | evaluatePropertyOperators (Properties originalProperties, Properties destinationProperties) |
| static float | floatForKey (String s) |
| static float | floatForKeyWithDefault (final String s, final float defaultValue) |
| static ERXProperties | fromExternalForm (String string) |
| static String | getActualPath (String path) |
| static int | intForKey (String s) |
| static int | intForKeyWithDefault (final String s, final int defaultValue) |
| static String | logString (Properties properties) |
| static long | longForKey (String s) |
| static long | longForKeyWithDefault (final String s, final long defaultValue) |
| static NSArray | optionalConfigurationFiles () |
| static String | pathForPropertiesUnderProjectPath (String projectPath) |
| static NSArray | pathsForUserAndBundleProperties (boolean reportLoggingEnabled) |
| static NSArray | pathsForUserAndBundleProperties () |
| static void | populateSystemProperties () |
| static Properties | propertiesFromArgv (String[] argv) |
| static Properties | propertiesFromFile (File file) throws java.io.IOException |
| static Properties | propertiesFromPath (String path) |
| static Map< String, String > | propertiesMap (Properties properties, boolean protectValues) |
| static void | removeKey (String key) |
| static void | setArrayForKey (NSArray array, String key) |
| static void | setCommandLineArguments (String[] argv) |
| static void | setDictionaryForKey (NSDictionary dictionary, String key) |
| static void | setOperatorForKey (ERXProperties.Operator operator, String key) |
| static void | setStringForKey (String string, String key) |
| static String | sourceVersionString () |
| static String | stringForKey (String s) |
| static String | stringForKeyWithDefault (final String s, final String defaultValue) |
| static void | systemPropertiesChanged () |
| static void | transferPropertiesFromSourceToDest (Properties source, Properties dest) |
| static String | variantPropertiesInBundle (String userName, String bundleName) |
| static String | versionStringForApplication () |
| static String | versionStringForFrameworkNamed (String frameworkName) |
| static String | webObjectsVersion () |
| static double | webObjectsVersionAsDouble () |
| static boolean | webObjectsVersionIs522OrHigher () |
| static boolean | webObjectsVersionIs52OrHigher () |
Static Public Attributes | |
| static final String | DefaultString = "Default" |
| static final Logger | log = Logger.getLogger(ERXProperties.class) |
Protected Member Functions | |
| String | applicationNameForAppending () |
Protected Attributes | |
| String | applicationNameForAppending |
Static Private Member Functions | |
| static void | addIfPresent (String info, String path, NSMutableArray< String > propertiesPaths, NSMutableArray< String > projectsInfo) |
| static String | getApplicationSpecificPropertyName (final String propertyName) |
| static boolean | retainDefaultsEnabled () |
Static Private Attributes | |
| static Map | _cache = Collections.synchronizedMap(new HashMap()) |
| static String | _webObjectsVersion |
| static double | _webObjectsVersionDouble |
| static final Map | AppSpecificPropertyNames = new HashMap(128) |
| static final NSMutableDictionary< String, ERXProperties.Operator > | operators = new NSMutableDictionary<String, ERXProperties.Operator>() |
| static Boolean | RetainDefaultsEnabled |
| static String | UndefinedMarker = "-undefined-" |
| static void addIfPresent | ( | String | info, | |
| String | path, | |||
| NSMutableArray< String > | propertiesPaths, | |||
| NSMutableArray< String > | projectsInfo | |||
| ) | [static, private] |
| static NSArray<Property> allProperties | ( | ) | [static] |
Returns all of the properties in the system mapped to their evaluated values, sorted by key.
| protectValues | if true, keys with the word "password" in them will have their values removed |
| static String applicationDeveloperProperties | ( | ) | [static] |
Returns the application-specific user properties.
Returns the path to the application-specific system-wide file "fileName". By default this path is /etc/WebObjects, and the application name will be appended. For instance, if you are asking for the MyApp Properties file for the system, it would go in /etc/WebObjects/MyApp/Properties.
| String applicationNameForAppending | ( | ) | [protected] |
Caches the application name for appending to the key. Note that for a period when the application is starting up application() will be null and name() will be null.
| static String applicationUserProperties | ( | ) | [static] |
Returns the application-specific user properties.
| static Properties applyConfiguration | ( | Properties | source, | |
| Properties | commandLine | |||
| ) | [static] |
Apply the current configuration to the supplied properties.
| source | ||
| commandLine |
| static NSArray arrayForKey | ( | String | s | ) | [static] |
Cover method for returning an NSArray for a given system property.
| s | system property |
| static NSArray arrayForKeyWithDefault | ( | final String | s, | |
| final NSArray | defaultValue | |||
| ) | [static] |
Cover method for returning an NSArray for a given system property and set a default value if not given.
| s | system property | |
| defaultValue | default value |
| static BigDecimal bigDecimalForKey | ( | String | s | ) | [static] |
Cover method for returning a BigDecimal for a given system property. This method uses the method bigDecimalValueWithDefault from ERXValueUtilities.
| s | system property |
| static BigDecimal bigDecimalForKeyWithDefault | ( | String | s, | |
| BigDecimal | defaultValue | |||
| ) | [static] |
Cover method for returning a BigDecimal for a given system property or a default value. This method uses the method bigDecimalValueWithDefault from ERXValueUtilities.
| s | system property | |
| defaultValue | default value |
| static boolean booleanForKey | ( | String | s | ) | [static] |
Cover method for returning a boolean for a given system property. This method uses the method booleanValue from ERXUtilities.
| s | system property |
| static boolean booleanForKeyWithDefault | ( | final String | s, | |
| final boolean | defaultValue | |||
| ) | [static] |
Cover method for returning a boolean for a given system property or a default value. This method uses the method booleanValue from ERXUtilities.
| s | system property | |
| defaultValue | default value |
Returns an array of strings separated with the given separator string.
| key | the key to lookup | |
| separator | the separator (",") |
| static NSArray<String> componentsSeparatedByStringWithDefault | ( | String | key, | |
| String | separator, | |||
| NSArray< String > | defaultValue | |||
| ) | [static] |
Returns an array of strings separated with the given separator string.
| key | the key to lookup | |
| separator | the separator (",") | |
| defaultValue | the default array to return if there is no value |
Returns the decrypted value for the given property name using the default crypter if the property propertyName.encrypted=true. For instance, if you are requesting my.password, if my.password.encrypted=true the value of my.password will be passed to the default crypter's decrypt method.
| propertyName | the property name to retrieve and optionally decrypt |
| static String decryptedStringForKeyWithDefault | ( | String | propertyName, | |
| String | defaultValue | |||
| ) | [static] |
If the propertyName.encrypted property is set to true, returns the plain text value of the given property name, after decrypting it with the ERXCrypto.defaultCrypter. For instance, if you are requesting my.password and my.password.encrypted is set to true, the value of my.password will be sent to the default crypter's decrypt() method.
| propertyName | the property name to retrieve and optionally decrypt | |
| defaultValue | the default value to return if there is no password |
| static String decryptedStringForKeyWithEncryptedDefault | ( | String | propertyName, | |
| String | defaultValue | |||
| ) | [static] |
Returns the decrypted value for the given property name using the ERXCrypto.defaultCrypter. This is slightly different than decryptedStringWithKeyWithDefault in that it does not require the encrypted property to be set.
| propertyName | the name of the property to decrypt | |
| defaultValue | the default encrypted value |
| static NSDictionary dictionaryForKey | ( | String | s | ) | [static] |
Cover method for returning an NSDictionary for a given system property.
| s | system property |
| static NSDictionary dictionaryForKeyWithDefault | ( | final String | s, | |
| final NSDictionary | defaultValue | |||
| ) | [static] |
Cover method for returning an NSDictionary for a given system property or the default value.
| s | system property | |
| defaultValue | default value |
| static double doubleForKey | ( | String | s | ) | [static] |
Cover method for returning a double for a given system property.
| s | system property |
| static double doubleForKeyWithDefault | ( | final String | s, | |
| final double | defaultValue | |||
| ) | [static] |
Cover method for returning a double for a given system property with a default value.
| s | system property | |
| defaultValue | default value |
| static void evaluatePropertyOperators | ( | Properties | originalProperties, | |
| Properties | destinationProperties | |||
| ) | [static] |
For each property in originalProperties, process the keys and avlues with the registered property operators and stores the converted value into destinationProperties.
| originalProperties | the properties to convert | |
| destinationProperties | the properties to copy into |
| static float floatForKey | ( | String | s | ) | [static] |
Cover method for returning a float for a given system property.
| s | system property |
| static float floatForKeyWithDefault | ( | final String | s, | |
| final float | defaultValue | |||
| ) | [static] |
Cover method for returning a float for a given system property with a default value.
| s | system property | |
| defaultValue | default value |
| static ERXProperties fromExternalForm | ( | String | string | ) | [static] |
Load the properties from a String in Property file format. Useful when you use them as custom value types, you would set this as the factory method name.
| string |
Returns actual full path to the given file system path that could contain symbolic links. For example: /Resources will be converted to /Versions/A/Resources when /Resources is a symbolic link.
| path | path string to a resource that could contain symbolic links |
Converts the standard propertyName into one with a .<AppName> on the end, if the property is defined with that suffix. If not, then this caches the standard propertyName. A cache is maintained to avoid concatenating strings frequently, but may be overkill since most usage of this system doesn't involve frequent access.
| propertyName |
Overriding the default getProperty method to first check: key.<ApplicationName> before checking for key. If nothing is found then key.Default is checked.
| key | to check |
| static int intForKey | ( | String | s | ) | [static] |
Cover method for returning an int for a given system property.
| s | system property |
| static int intForKeyWithDefault | ( | final String | s, | |
| final int | defaultValue | |||
| ) | [static] |
Cover method for returning an int for a given system property with a default value.
| s | system property | |
| defaultValue | default value |
| static String logString | ( | Properties | properties | ) | [static] |
Returns a string suitable for logging.
| properties |
| static long longForKey | ( | String | s | ) | [static] |
Cover method for returning a long for a given system property.
| s | system property |
| static long longForKeyWithDefault | ( | final String | s, | |
| final long | defaultValue | |||
| ) | [static] |
Cover method for returning a long for a given system property with a default value.
| s | system property | |
| defaultValue | default value |
| static NSArray optionalConfigurationFiles | ( | ) | [static] |
Gets an array of optionally defined configuration files. For each file, if it does not exist as an absolute path, ERXProperties will attempt to resolve it as an application resource and use that instead.
Returns the full path to the Properties file under the given project path. At the current implementation, it looks for /Properties and /Resources/Properties. If the Properties file doesn't exist, returns null.
| projectPath | string to the project root directory |
| static NSArray pathsForUserAndBundleProperties | ( | boolean | reportLoggingEnabled | ) | [static] |
Properties.dev -- per-Framework-dev properties This adds support for Properties.dev in your Frameworks new load order will be
Properties.<userName> -- per-Framework-per-User properties
/etc/WebObjects/AppName/Properties -- per-Application-per-Machine properties
Properties.dev -- per-Application-dev properties
Properties.<userName> -- per-Application-per-User properties
| static NSArray pathsForUserAndBundleProperties | ( | ) | [static] |
Returns an array of paths to the Properties and WebObjects.properties files contained in the application/framework bundles and home directory.
If ProjectBuilder (for Mac OS X) has the project opened, it will attempt to get the path to the one in the project directory instead of the one in the bundle.
This opened project detection feature is pretty fragile and will change between versions of the dev-tools.
| static void populateSystemProperties | ( | ) | [static] |
Puts handy properties such as com.webobjects.version into the system properties. This method is called when the framework is initialized (when WOApplication.ApplicationWillFinishLaunchingNotification is posted.)
| static Properties propertiesFromArgv | ( | String[] | argv | ) | [static] |
Sets and returns properties object with the values from the given command line arguments string array.
| argv | string array typically provided by the command line arguments |
| static Properties propertiesFromFile | ( | File | file | ) | throws java.io.IOException [static] |
Gets the properties for a given file.
| file | the properties file |
| java.io.IOException | if the file is not found or cannot be read |
| static Properties propertiesFromPath | ( | String | path | ) | [static] |
Reads a Java properties file at the given path and returns a Properties object as the result. If the file does not exist, returns an empty properties object.
| path | file path to the properties file |
Returns all of the properties in the system mapped to their evaluated values, sorted by key.
| protectValues | if true, keys with the word "password" in them will have their values removed |
| static void removeKey | ( | String | key | ) | [static] |
| static boolean retainDefaultsEnabled | ( | ) | [static, private] |
| static void setArrayForKey | ( | NSArray | array, | |
| String | key | |||
| ) | [static] |
Sets an array in the System properties for a particular key.
| array | to be set in the System properties | |
| key | to be used to get the value |
| static void setCommandLineArguments | ( | String[] | argv | ) | [static] |
| static void setDictionaryForKey | ( | NSDictionary | dictionary, | |
| String | key | |||
| ) | [static] |
Sets a dictionary in the System properties for a particular key.
| dictionary | to be set in the System properties | |
| key | to be used to get the value |
| static void setOperatorForKey | ( | ERXProperties.Operator | operator, | |
| String | key | |||
| ) | [static] |
Registers a property operator for a particular key.
| operator | the operator to register | |
| key | the key name of the operator |
Sets a string in the System properties for another string.
| string | to be set in the System properties | |
| key | to be used to get the value |
| static String sourceVersionString | ( | ) | [static] |
Returns the version string of the given framework. It checks SourceVersion property in the version.plist resource and returns a trimmed version of the value.
SourceVersion in its info.plist resource. Returning an string for a given system property. This is a cover method of java.lang.System#getProperty
| s | system property |
Returning an string for a given system property. This is a cover method of java.lang.System#getProperty
| s | system property |
| static void systemPropertiesChanged | ( | ) | [static] |
| void takeValueForKey | ( | Object | anObject, | |
| String | aKey | |||
| ) |
KVC implementation.
| anObject | ||
| aKey |
| Object toExternalForm | ( | ) | throws IOException |
Returns the properties as a String in Property file format. Useful when you use them as custom value types, you would set this as the conversion method name.
| IOException |
| static void transferPropertiesFromSourceToDest | ( | Properties | source, | |
| Properties | dest | |||
| ) | [static] |
Copies all properties from source to dest.
| source | properties copied from | |
| dest | properties copied to |
| Object valueForKey | ( | String | aKey | ) |
KVC implementation.
| aKey |
Returns the application-specific variant properties for the given bundle.
| static String versionStringForApplication | ( | ) | [static] |
Returns the version string of the application. It checks CFBundleShortVersionString property in the info.plist resource and returns a trimmed version of the value.
CFBundleShortVersionString in its info.plist resource.
Returns the version string of the given framework. It checks CFBundleShortVersionString property in the info.plist resource and returns a trimmed version of the value.
| frameworkName | name |
CFBundleShortVersionString in its info.plist resource. | static String webObjectsVersion | ( | ) | [static] |
Returns WebObjects version as string. If it's one of those version 5.1s (5.1, 5.1.1, 5.1.2...), this method will only return 5.1. If it's 5.2s, this mothod will return more precise version numbers such as 5.2.1. Note that version 5.0 series is not supported and may return incorrect version numbers (it will return 5.1).
| static double webObjectsVersionAsDouble | ( | ) | [static] |
Returns WebObjects version as double. If it's one of those version 5.1s (5.1, 5.1.1, 5.1.2...), this method will only return 5.1. If it's 5.2s, this mothod will return more precise version numbers such as 5.2.1. Note that version 5.0 series is not supported and may return incorrect version numbers (it will return 5.1).
| static boolean webObjectsVersionIs522OrHigher | ( | ) | [static] |
Quick convience method used to determine if the current webobjects version is 5.22 or higher.
| static boolean webObjectsVersionIs52OrHigher | ( | ) | [static] |
Quick convience method used to determine if the current webobjects version is 5.2 or higher.
Map _cache = Collections.synchronizedMap(new HashMap()) [static, private] |
Internal cache of type converted values to avoid reconverting attributes that are asked for frequently
String _webObjectsVersion [static, private] |
WebObjects version number as string
double _webObjectsVersionDouble [static, private] |
WebObjects version number as double
String applicationNameForAppending [protected] |
caches the application name that is appended to the key for lookup
final Map AppSpecificPropertyNames = new HashMap(128) [static, private] |
final String DefaultString = "Default" [static] |
default string
final NSMutableDictionary<String, ERXProperties.Operator> operators = new NSMutableDictionary<String, ERXProperties.Operator>() [static, private] |
Stores the mapping between operator keys and operators
Boolean RetainDefaultsEnabled [static, private] |
String UndefinedMarker = "-undefined-" [static, private] |
1.5.8