Package org.jvnet.basicjaxb.config
Class LocatorProperties
java.lang.Object
java.util.Dictionary<Object,Object>
java.util.Hashtable<Object,Object>
java.util.Properties
org.jvnet.basicjaxb.config.LocatorProperties
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,,Object> LocatorLoader<Object,Object>
An implementation for a map of key-value pairs that is compatible with java.util.Properties.
This implementation adds a method to load properties using a string locator. The locator
represents either a classpath, a URL or a file.
Sample locators:
- file:///PATH/src/main/resources/org/jvnet/basicjaxb/locator/messages.properties
- file:src/main/resources/org/jvnet/basicjaxb/locator/messages.properties
- classpath:/org/jvnet/basicjaxb/locator/messages.properties
- classpath:messages.properties
- /PATH/src/main/resources/org/jvnet/basicjaxb/locator/messages.properties
- src/main/resources/org/jvnet/basicjaxb/locator/messages.properties
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class java.util.Properties
defaults -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
LocatorProperties
public LocatorProperties()
-
-
Method Details
-
load
Load properties for the given locator. The locator can represent a URL or a File. If the URL protocol is "classpath:" then the properties file will be located as a resource stream.- Specified by:
loadin interfaceLocatorLoader<Object,Object> - Parameters:
locator- The location of a property file or resource.- Throws:
IOException- If an error occurred when inputting from the reader.
-