Package edu.umd.cs.findbugs
Class PropertyBundle
- java.lang.Object
-
- edu.umd.cs.findbugs.PropertyBundle
-
public class PropertyBundle extends java.lang.Object
- Author:
- pugh
-
-
Constructor Summary
Constructors Constructor Description PropertyBundle()
PropertyBundle(java.util.Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyBundle
copy()
boolean
getBoolean(java.lang.String name)
Get boolean property, returning false if a security manager prevents us from accessing system propertiesboolean
getBoolean(java.lang.String name, boolean defaultValue)
int
getInt(java.lang.String name, int defaultValue)
java.lang.String
getOSDependentProperty(java.lang.String name)
java.util.Properties
getProperties()
java.lang.String
getProperty(java.lang.String name)
java.lang.String
getProperty(java.lang.String name, java.lang.String defaultValue)
void
loadProperties(java.util.Properties properties)
void
loadPropertiesFromString(java.lang.String contents)
void
loadPropertiesFromURL(java.net.URL url)
java.lang.String
rewriteURLAccordingToProperties(java.lang.String u)
void
setProperty(java.lang.String name, java.lang.String value)
java.lang.String
toString()
-
-
-
Method Detail
-
copy
public PropertyBundle copy()
-
getProperties
public java.util.Properties getProperties()
-
loadPropertiesFromString
public void loadPropertiesFromString(java.lang.String contents)
-
loadPropertiesFromURL
public void loadPropertiesFromURL(java.net.URL url)
-
loadProperties
public void loadProperties(java.util.Properties properties)
-
getBoolean
public boolean getBoolean(java.lang.String name)
Get boolean property, returning false if a security manager prevents us from accessing system properties- Returns:
- true if the property exists and is set to true
-
getBoolean
public boolean getBoolean(java.lang.String name, boolean defaultValue)
-
getInt
public int getInt(java.lang.String name, int defaultValue)
- Parameters:
name
- property namedefaultValue
- default value- Returns:
- the int value (or defaultValue if the property does not exist)
-
getOSDependentProperty
public java.lang.String getOSDependentProperty(java.lang.String name)
- Parameters:
name
- property name- Returns:
- string value (or null if the property does not exist)
-
getProperty
public java.lang.String getProperty(java.lang.String name)
- Parameters:
name
- property name- Returns:
- string value (or null if the property does not exist)
-
setProperty
public void setProperty(java.lang.String name, java.lang.String value)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getProperty
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
- Parameters:
name
- property namedefaultValue
- default value- Returns:
- string value (or defaultValue if the property does not exist)
-
rewriteURLAccordingToProperties
public java.lang.String rewriteURLAccordingToProperties(java.lang.String u)
-
-