|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dtolabs.rundeck.core.utils.PropertyLookup
public class PropertyLookup
Simple utiltiy class to lookup property info
Method Summary | |
---|---|
protected int |
countProperties()
Counts number of properties currently in this object. |
static PropertyLookup |
create(java.io.File propFile)
Factory method to create a property lookup object |
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(java.util.Properties props)
|
static PropertyLookup |
createDeferred(java.io.File propFile)
Factory method to create a property lookup object |
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)
Create a PropertyRetriever from a PropertyLookup that will not throw exception |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 contained
public static PropertyLookup createDeferred(java.io.File propFile)
propFile
- File where proeprty data is contained
public 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.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 property
PropertyLookupException
- thrown if lookup fails for specified keypublic PropertyRetriever safe()
public static PropertyRetriever safePropertyRetriever(IPropertyLookup lookup)
lookup
-
public boolean hasProperty(java.lang.String key)
hasProperty
in interface IPropertyLookup
key
- Name of the property
public static java.util.Properties fetchProperties(java.io.File propFile)
propFile
- File to read
PropertyLookupException
- thrown if error loading property filepublic java.util.Map getPropertiesMap()
getPropertiesMap
in interface IPropertyLookup
Map
containing property key/value pair
PropertyLookupException
- 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 pairs
protected int countProperties()
public static boolean hasProperty(java.lang.String propKey, java.io.File propFile)
propKey
- property namepropFile
- property file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |