public class PropertyLookup extends java.lang.Object implements IPropertyLookup
Modifier and Type | Method and Description |
---|---|
protected int |
countProperties()
Counts number of properties currently in this object.
|
static PropertyLookup |
create(java.io.File propFile) |
static PropertyLookup |
create(java.io.File propfile,
IPropertyLookup defaultsLookup)
Calls base constructor with data from IPropertyLookup paramater as defaults.
|
static PropertyLookup |
create(java.io.File propfile,
java.util.Map defaults,
IPropertyLookup defaultsLookup)
Calls base constructor feeding defaults from Map and IPropertyLookup params
|
static PropertyLookup |
create(IPropertyLookup defaultsLookup) |
static PropertyLookup |
create(IPropertyLookup data,
IPropertyLookup defaultsLookup) |
static PropertyLookup |
create(java.util.Properties props) |
static PropertyLookup |
create(java.util.Properties data,
IPropertyLookup defaultsLookup) |
static PropertyLookup |
createDeferred(java.io.File propFile) |
protected java.util.Properties |
difference(java.util.Map map)
Reads map of input properties and returns a collection of those that are unique
to that input set.
|
PropertyLookup |
expand()
Calls
PropertyUtil.expand(Map) to expand all properties. |
static java.util.Properties |
fetchProperties(java.io.File propFile)
given a file reads in its properties
|
java.util.Map |
getPropertiesMap()
Retrieves map of property data
|
java.lang.String |
getProperty(java.lang.String key)
Get the property per specified key
|
boolean |
hasProperty(java.lang.String key)
Check if property exists in file
|
static boolean |
hasProperty(java.lang.String propKey,
java.io.File propFile)
Reads propFile and then checks if specified key exists.
|
PropertyRetriever |
safe() |
static PropertyRetriever |
safePropertyRetriever(IPropertyLookup lookup) |
public static PropertyLookup create(java.util.Properties props)
public static PropertyLookup create(IPropertyLookup defaultsLookup)
public static PropertyLookup create(java.io.File propFile)
propFile
- File where proeprty data is containedpublic static PropertyLookup createDeferred(java.io.File propFile)
propFile
- File where proeprty data is containedpublic static PropertyLookup create(java.io.File propfile, IPropertyLookup defaultsLookup)
IPropertyLookup.getPropertiesMap()
method.propfile
- File containing property datadefaultsLookup
- IPropertyLookup of default propertiespublic static PropertyLookup create(java.util.Properties data, IPropertyLookup defaultsLookup)
data
- Properties datadefaultsLookup
- IPropertyLookup of default propertiespublic static PropertyLookup create(IPropertyLookup data, IPropertyLookup defaultsLookup)
data
- Properties datadefaultsLookup
- IPropertyLookup of default propertiespublic static PropertyLookup create(java.io.File propfile, java.util.Map defaults, IPropertyLookup defaultsLookup)
propfile
- File containing property datadefaults
- Map of default propertiesdefaultsLookup
- IPropertyLookup of default propertiespublic java.lang.String getProperty(java.lang.String key)
getProperty
in interface PropertyRetriever
getProperty
in interface IPropertyLookup
key
- name of the propertyPropertyLookupException
- thrown if lookup fails for specified keypublic PropertyRetriever safe()
public static PropertyRetriever safePropertyRetriever(IPropertyLookup lookup)
lookup
- lookuppublic boolean hasProperty(java.lang.String key)
hasProperty
in interface IPropertyLookup
key
- Name of the propertypublic static java.util.Properties fetchProperties(java.io.File propFile)
propFile
- File to readPropertyLookupException
- thrown if error loading property filepublic java.util.Map getPropertiesMap()
getPropertiesMap
in interface IPropertyLookup
Map
containing property key/value pairPropertyLookupException
- thrown if loaderrorpublic PropertyLookup expand()
PropertyUtil.expand(Map)
to expand all properties.protected java.util.Properties difference(java.util.Map map)
map
- Map of key/value pairsprotected int countProperties()
public static boolean hasProperty(java.lang.String propKey, java.io.File propFile)
propKey
- property namepropFile
- property file