|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.PropertyHandler.Builder
public static class PropertyHandler.Builder
This Builder class lets you have more control over how a PropertyHandler is constructed. If a properties file location or a properties file is not provided, the PropertyHandler will look for an "openmap.properties" file in the classpath, config directory or user home directory. If you don't want the PropertyHandler to search for a properties file, set an empty Properties object in the Builder.
Field Summary | |
---|---|
protected java.util.Properties |
properties
|
protected java.lang.String |
propertyPrefix
|
protected boolean |
update
|
Constructor Summary | |
---|---|
PropertyHandler.Builder()
|
Method Summary | |
---|---|
PropertyHandler |
build()
Build the property handler. |
protected java.util.Properties |
createProperties(java.net.URL location)
Reads the file at the given location and creates a Properties file from the contents. |
PropertyHandler.Builder |
setProgressUpdates(boolean update)
|
PropertyHandler.Builder |
setProperties(java.util.Properties props)
Have the builder use the provided properties. |
PropertyHandler.Builder |
setPropertiesFile(java.lang.String location)
Have the builder look for a resource, file or URL at the location. |
PropertyHandler.Builder |
setPropertiesFile(java.net.URL url)
Have the builder look for properties file at URL location. |
PropertyHandler.Builder |
setPropertyPrefix(java.lang.String prefix)
Set the property prefix used for general settings in the properties in configuration of application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean update
protected java.util.Properties properties
protected java.lang.String propertyPrefix
Constructor Detail |
---|
public PropertyHandler.Builder()
Method Detail |
---|
public PropertyHandler.Builder setPropertiesFile(java.lang.String location) throws java.net.MalformedURLException, java.io.IOException
location
- of the properties file
java.net.MalformedURLException
java.io.IOException
public PropertyHandler.Builder setPropertiesFile(java.net.URL url) throws java.io.IOException
url
-
java.io.IOException
public PropertyHandler.Builder setProperties(java.util.Properties props)
props
- Properties to use.
public PropertyHandler.Builder setPropertyPrefix(java.lang.String prefix)
prefix
- Set the property prefix for the PropertyHandler
public PropertyHandler.Builder setProgressUpdates(boolean update)
update
- flag for providing progress updates
protected java.util.Properties createProperties(java.net.URL location) throws java.io.IOException
location
- URL of file
java.io.IOException
- if something goes wrong reading the file.public PropertyHandler build()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |