public class PropertiesHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_GRAMAR_ID |
static String |
PROPERTY_LIST_SAMPLES |
static String |
PROPERTY_MODEL |
static String |
PROPERTY_PROPERTY_FILE |
static String |
PROPERTY_SAMPLE_NAME |
Constructor and Description |
---|
PropertiesHelper(String[] args) |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getIndexedValues(Properties properties,
String propertyNamePrefix)
Returns all values whose corresponding property name starts with the
given prefix.
|
Properties |
getProperties() |
String |
getString(String propertyName)
Returns the value of the given property name as specified in either the
command line arguments or the specified property file.
|
String |
getString(String propertyName,
String defaultValue)
Returns the value of the given property name as specified in either the
command line arguments or the specified property file.
|
boolean |
hasValue(String propertyName)
Answers whether the given property name was provided in the command line
arguments or in the property file
Note this class's static constants for common property names for convenience.
|
void |
setProperty(String key,
String value,
boolean override)
Set the value of a property.
|
public static final String PROPERTY_PROPERTY_FILE
public static final String PROPERTY_GRAMAR_ID
public static final String PROPERTY_MODEL
public static final String PROPERTY_LIST_SAMPLES
public static final String PROPERTY_SAMPLE_NAME
public PropertiesHelper(String[] args) throws GramarException
GramarException
public String getString(String propertyName) throws GramarException
propertyName
- GramarException
public boolean hasValue(String propertyName)
propertyName
- GramarException
public String getString(String propertyName, String defaultValue)
propertyName
- public static List<String> getIndexedValues(Properties properties, String propertyNamePrefix)
properties
- propertyNamePrefix
- public Properties getProperties()
Copyright © 2015. All rights reserved.