public class PairsList extends Object implements Iterable<Pair>
Here is supported pairs list syntax. Please note that final semicolon is optional.
expression = pair *( ";" pair ) [ ";" ] pair = first SEP second first = string second = string ; separator for pair components SEP = ":" / "=" ; string is any character less semicolon and separators ; colon is default separator
Modifier and Type | Field and Description |
---|---|
private static char |
DEFAULT_SEPARATOR
Default pair separator.
|
private List<Pair> |
pairs
Underlying pairs storage.
|
Constructor and Description |
---|
PairsList(String expression)
Convenient constructor using default separator.
|
PairsList(String expression,
char separator)
Parse expression and extract a list of pairs of string values.
|
Modifier and Type | Method and Description |
---|---|
Iterator<Pair> |
iterator()
Returns an iterator for this pairs list instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private static final char DEFAULT_SEPARATOR
public PairsList(String expression) throws SyntaxException
expression
- expression to parse.SyntaxException
- if expression
is not well formed or on duplicated pairs.public PairsList(String expression, char separator) throws SyntaxException
expression
values should not contain semicolon used for pairs separation or used
values separator
.expression
- expression to parse,separator
- separator character.SyntaxException
- if expression
is not well formed or on duplicated pairs.Copyright © 2019. All rights reserved.