Package edu.umd.cs.findbugs
Class PropertyBundle
- java.lang.Object
-
- edu.umd.cs.findbugs.PropertyBundle
-
public class PropertyBundle extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classPropertyBundle.Rewriter
-
Field Summary
Fields Modifier and Type Field Description private java.util.Propertiesproperties(package private) PropertyBundle.Rewriterrewriter
-
Constructor Summary
Constructors Constructor Description PropertyBundle()PropertyBundle(java.util.Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyBundlecopy()booleangetBoolean(java.lang.String name)Get boolean property, returning false if a security manager prevents us from accessing system propertiesbooleangetBoolean(java.lang.String name, boolean defaultValue)intgetInt(java.lang.String name, int defaultValue)java.lang.StringgetOSDependentProperty(java.lang.String name)java.util.PropertiesgetProperties()java.lang.StringgetProperty(java.lang.String name)java.lang.StringgetProperty(java.lang.String name, java.lang.String defaultValue)(package private) PropertyBundle.RewritergetRewriter()voidloadProperties(java.util.Properties properties)voidloadPropertiesFromString(java.lang.String contents)voidloadPropertiesFromURL(java.net.URL url)java.lang.StringrewriteURLAccordingToProperties(java.lang.String u)voidsetProperty(java.lang.String name, java.lang.String value)private booleantoBoolean(java.lang.String name)java.lang.StringtoString()
-
-
-
Field Detail
-
properties
private final java.util.Properties properties
-
rewriter
volatile PropertyBundle.Rewriter rewriter
-
-
Method Detail
-
getRewriter
PropertyBundle.Rewriter getRewriter()
-
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)
-
toBoolean
private boolean toBoolean(java.lang.String name)
-
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:
toStringin 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)
-
-