F - the field enum this parsers usespublic class ConfigParser<F extends ConfigField> extends AbstractConfigParser<F> implements ParseResult<F>
| Modifier and Type | Field and Description |
|---|---|
static String |
MAX_HEAP_SIZE_WILDCARD
The Constant MAX_HEAP_SIZE_WILDCARD.
|
static String |
NEGATIVE_INFINITY_WILDCARD
The Constant NEGATIVE_INFINITY_WILDCARD.
|
static String |
NO_OF_CPUS_WILDCARD
The Constant NO_OF_CPUS_WILDCARD.
|
static String |
PGX_VERSION_WILDCARD
The Constant PGX_VERSION_WILDCARD.
|
static String |
POSITIVE_INFINITY_WILDCARD1
The Constant POSITIVE_INFINITY_WILDCARD1.
|
static String |
POSITIVE_INFINITY_WILDCARD2
The Constant POSITIVE_INFINITY_WILDCARD2.
|
static String |
TMP_DIR_WILDCARD
The Constant TMP_DIR_WILDCARD.
|
| Modifier and Type | Method and Description |
|---|---|
Set<F> |
getDefaults()
Gets the set of optional fields whose defaults where used during parsing.
|
Map<F,Object> |
getValues()
Gets the parsed values.
|
ParseResult<F> |
parse()
Starts parsing.
|
static <F extends ConfigField> |
parse(Map<String,Object> raw, F[] fields, boolean strict, File parent)
Parses raw key/value pairs into a
ParseResult object. |
static Map<String,Object> |
parseRaw(InputStream is)
Parses an input stream into raw key/value pairs.
|
static Object |
replaceWildcards(Class<?> type, Object given)
Replaces a given wildcard value with the value the wildcard represents.
|
public static final String MAX_HEAP_SIZE_WILDCARD
public static final String NEGATIVE_INFINITY_WILDCARD
public static final String NO_OF_CPUS_WILDCARD
public static final String PGX_VERSION_WILDCARD
public static final String POSITIVE_INFINITY_WILDCARD1
public static final String POSITIVE_INFINITY_WILDCARD2
public static final String TMP_DIR_WILDCARD
public Set<F> getDefaults()
ParseResultgetDefaults in interface ParseResult<F extends ConfigField>public Map<F,Object> getValues()
ParseResultgetValues in interface ParseResult<F extends ConfigField>public ParseResult<F> parse()
public static <F extends ConfigField> ParseResult<F> parse(Map<String,Object> raw, F[] fields, boolean strict, File parent)
ParseResult object.F - the field enum this parsers usesraw - the raw key/value input pairsfields - the fields to use for parsingstrict - the strict if true, parses in strict modeparent - the parent to resolve relative paths againstIllegalArgumentException - if any input errors are encountered during parsing. Non-critical errors won't resolve in an exception if not parsing in strict mode.public static Map<String,Object> parseRaw(InputStream is) throws IOException
is - the input streamIOException - Signals that an I/O exception has occurred.public static Object replaceWildcards(Class<?> type, Object given)
type - the type of given valuegiven - the given value, must not be nullCopyright © 2015. All rights reserved.