public class PropertiesParser extends Object
This is an utility class used to parse the properties.
| Constructor and Description |
|---|
PropertiesParser(com.helger.commons.lang.NonBlockingProperties props) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanProperty(String name) |
boolean |
getBooleanProperty(String name,
boolean def) |
byte |
getByteProperty(String name) |
byte |
getByteProperty(String name,
byte def) |
char |
getCharProperty(String name) |
char |
getCharProperty(String name,
char def) |
double |
getDoubleProperty(String name) |
double |
getDoubleProperty(String name,
double def) |
float |
getFloatProperty(String name) |
float |
getFloatProperty(String name,
float def) |
int[] |
getIntArrayProperty(String name) |
int[] |
getIntArrayProperty(String name,
int[] def) |
int |
getIntProperty(String name) |
int |
getIntProperty(String name,
int def) |
long |
getLongProperty(String name) |
long |
getLongProperty(String name,
long def) |
com.helger.commons.lang.NonBlockingProperties |
getPropertyGroup(String prefix) |
com.helger.commons.lang.NonBlockingProperties |
getPropertyGroup(String prefix,
boolean stripPrefix) |
com.helger.commons.lang.NonBlockingProperties |
getPropertyGroup(String sPrefix,
boolean bStripPrefix,
String[] excludedPrefixes)
Get all properties that start with the given prefix.
|
com.helger.commons.collection.impl.ICommonsList<String> |
getPropertyGroups(String sPrefix) |
short |
getShortProperty(String name) |
short |
getShortProperty(String name,
short def) |
String[] |
getStringArrayProperty(String name) |
String[] |
getStringArrayProperty(String name,
String[] def) |
String |
getStringProperty(String name)
Get the trimmed String value of the property with the given
name. |
String |
getStringProperty(String name,
String def)
Get the trimmed String value of the property with the given
name or the given default value if the value is null or empty
after trimming. |
com.helger.commons.lang.NonBlockingProperties |
getUnderlyingProperties() |
public PropertiesParser(com.helger.commons.lang.NonBlockingProperties props)
public com.helger.commons.lang.NonBlockingProperties getUnderlyingProperties()
public String getStringProperty(String name)
name. If the value the empty String (after trimming), then it
returns null.public String getStringProperty(String name, String def)
name or the given default value if the value is null or empty
after trimming.public boolean getBooleanProperty(String name)
public boolean getBooleanProperty(String name, boolean def)
public byte getByteProperty(String name)
public byte getByteProperty(String name, byte def)
public char getCharProperty(String name)
public char getCharProperty(String name, char def)
public double getDoubleProperty(String name)
public double getDoubleProperty(String name, double def)
public float getFloatProperty(String name)
public float getFloatProperty(String name, float def)
public int getIntProperty(String name)
public int getIntProperty(String name, int def)
public int[] getIntArrayProperty(String name)
public int[] getIntArrayProperty(String name, int[] def)
public long getLongProperty(String name)
public long getLongProperty(String name, long def)
public short getShortProperty(String name)
public short getShortProperty(String name, short def)
public com.helger.commons.collection.impl.ICommonsList<String> getPropertyGroups(String sPrefix)
public com.helger.commons.lang.NonBlockingProperties getPropertyGroup(String prefix)
public com.helger.commons.lang.NonBlockingProperties getPropertyGroup(String prefix, boolean stripPrefix)
public com.helger.commons.lang.NonBlockingProperties getPropertyGroup(String sPrefix, boolean bStripPrefix, String[] excludedPrefixes)
sPrefix - The prefix for which to search. If it does not end in a "." then one
will be added to it for search purposes.bStripPrefix - Whether to strip off the given prefix in the result's
keys.excludedPrefixes - Optional array of fully qualified prefixes to exclude. For example
if prefix is "a.b.c", then
excludedPrefixes might be "a.b.c.ignore".NonBlockingProperties that start with the
given prefix, optionally have that prefix removed, and do not
include properties that start with one of the given excluded
prefixes.Copyright © 2016–2021 Philip Helger. All rights reserved.