|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.property.SimplePropertySource
This simple class implements PropertySource around a standard property file.
Field Summary | |
private static java.lang.String |
prefix
|
private java.lang.String |
propertiesPath
|
private java.util.Properties |
props
|
Constructor Summary | |
SimplePropertySource(java.lang.String propertySourceName)
|
Method Summary | |
java.lang.String |
getPrefix()
Return the String prefix for this PropertySource. |
java.lang.String |
getProperty(java.lang.String key)
If the property isn't there, return null. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
If the property isn't there, return default. |
java.lang.String |
getPropertySafely(java.lang.String key)
|
PropertySource |
getSubsetPropertySource(java.lang.String keyPrefix)
Return a PropertySource that contains the subset of these properties based on the prefix. |
java.util.Iterator |
propertyIterator()
Return an iterator of property keys. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Add or change the value of a property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Properties props
private java.lang.String propertiesPath
private static final java.lang.String prefix
Constructor Detail |
public SimplePropertySource(java.lang.String propertySourceName)
propertySourceName
- The name of the property source file. Set the path to this property by using a system property
(-DpropertySourceName=propertySourcePath). If the constructor does not find a system property named propertySourceName,
it uses propertySourceName as the path.Method Detail |
public java.lang.String getProperty(java.lang.String key)
PropertySource
getProperty
in interface PropertySource
public java.lang.String getProperty(java.lang.String key, java.lang.String def)
PropertySource
getProperty
in interface PropertySource
public java.lang.String getPropertySafely(java.lang.String key)
getPropertySafely
in interface PropertySource
public java.util.Iterator propertyIterator()
PropertySource
propertyIterator
in interface PropertySource
public java.lang.String getPrefix()
PropertySource
getPrefix
in interface PropertySource
public PropertySource getSubsetPropertySource(java.lang.String keyPrefix)
PropertySource
getSubsetPropertySource
in interface PropertySource
public void setProperty(java.lang.String key, java.lang.String value)
PropertySource
setProperty
in interface PropertySource
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |