java.lang.Object
org.htmlunit.corejs.javascript.config.RhinoProperties
Utility class to read current rhino configuration from various properties.
Rhino properties typically begins with "rhino." (properties) or "RHINO_" (env)
You can override this behaviour and implement a RhinoPropertiesLoader and register it
as service. If no loader was found, the configuration is read from these locations by default:
- rhino.config file from current class' classpath
- rhino.config file from current threas's classpath
- rhino.config file from current directory
- rhino-test.config file from current class' classpath
- rhino-test.config file from current threas's classpath
- rhino-test.config file from current directory
- env variables starting with "RHINO_" (underscores are replaced by '.' and string is
- System-properties starting with "rhino."
(the later config can override previous ones)
The config files are in UTF-8 format and all keys in this configuration are case-insensitive and dot/underscore-insensitive.
This means, "rhino.use_java_policy_security=true" is equvalent to "RHINO_USE_JAVA_POLICY_SECURITY=TRUE"
- Author:
- Roland Praml, Foconis Analytics GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a config map.Tries to find the property in the maps.voidLoad properties from the default locations.voidloadFromClasspath(ClassLoader cl, String location) Loads the configuration from classpath.voidloadFromFile(File config) Loads the configuration from the given file.voidloadFromResource(URL resource) Loads the configuration from the given resource.
-
Constructor Details
-
RhinoProperties
public RhinoProperties()
-
-
Method Details
-
loadDefaults
public void loadDefaults()Load properties from the default locations. -
loadFromFile
Loads the configuration from the given file. -
loadFromClasspath
Loads the configuration from classpath. -
loadFromResource
Loads the configuration from the given resource. -
addConfig
Adds a config map. Later added configs are overriding previous ones -
get
Tries to find the property in the maps. It tries the property first, then it tries the camel upper version.
-