public class NmBracketParser
extends java.lang.Object
Constructor and Description |
---|
NmBracketParser() |
Modifier and Type | Method and Description |
---|---|
static java.util.HashMap<NameIdentifier,java.lang.String> |
createIdentifiersHashMapFromEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersHashMapFromNonEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersHashMapWithMandatoryValuesFromEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersHashMapWithMandatoryValuesFromNonEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersMapFromEscapedString(java.lang.String s,
boolean emptyMapAllowed)
Parses a bracketed String and builds a hashmap with the information contained within the (map) value is the (attribute) value, also in string format.
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersTreeMapFromEscaped(java.lang.String s)
Creates a TreeMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersTreeMapFromNonEscaped(java.lang.String s)
Creates a TreeMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersTreeMapWithMandatoryValuesFromEscaped(java.lang.String s)
Creates a TreeMap for a String in the general format Name1(value1)Name2(value2)...
|
static java.util.Map<NameIdentifier,java.lang.String> |
createIdentifiersTreeMapWithMandatoryValuesFromNonEscaped(java.lang.String s)
Creates a TreeMap for a String in the general format Name1(value1)Name2(value2)...
|
static void |
fillIdentifiersMapFromEscaped(java.lang.String s,
java.util.Map<NameIdentifier,java.lang.String> attributeValueMap)
Filles the given Map with the entries held in a String in the general format Name1(value1)Name2(value2)...
|
static void |
fillIdentifiersMapFromNonEscaped(java.lang.String s,
java.util.Map<NameIdentifier,java.lang.String> attributeValueMap)
Filles the given Map with the entries held in a String in the general format Name1(value1)Name2(value2)...
|
static void |
fillIdentifiersMapWithMandatoryValuesFromEscaped(java.lang.String s,
java.util.Map<NameIdentifier,java.lang.String> attributeValueMap)
Filles the given Map with the entries held in a String in the general format Name1(value1)Name2(value2)...
|
static void |
fillIdentifiersMapWithMandatoryValuesFromNonEscaped(java.lang.String s,
java.util.Map<NameIdentifier,java.lang.String> attributeValueMap)
Filles the given Map with the entries held in a String in the general format Name1(value1)Name2(value2)...
|
static void |
fillNonEmptyIdentifiersMapWithMandatoryValuesFromEscaped(java.lang.String s,
java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) |
public static java.util.HashMap<NameIdentifier,java.lang.String> createIdentifiersHashMapFromEscaped(java.lang.String s) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... The 'value' parts are in escaped format, i.e. ()\ tokens that are part of the value, should be contained as \(, \), \\.InvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketDuplicateNameException
- If the String argument contains a duplicate name.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersHashMapFromNonEscaped(java.lang.String s) throws NoClosingBracketException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketDuplicateNameException
- If the String argument contains a duplicate name.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersHashMapWithMandatoryValuesFromEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException
s
- A string in the general format name1(value1)name2(value2)... The 'value' parts are in escaped format, i.e. ()\ tokens that are part of the value, should be contained as \(, \), \\.DuplicateNameException
- If the String argument contains a duplicate name.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersHashMapWithMandatoryValuesFromNonEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, NoValueCorrespondingToNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .DuplicateNameException
- If the String argument contains a duplicate name.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersMapFromEscapedString(java.lang.String s, boolean emptyMapAllowed) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException, DuplicateNameException
s
- The textual representation of a bracketed expressionemptyMapAllowed
- true if the result is not expected to contain at least one entryDuplicateNameException
- If the String argument contains a duplicate name.NoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketpublic static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersTreeMapFromEscaped(java.lang.String s) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... The 'value' parts are in escaped format, i.e. ()\ tokens that are part of the value, should be contained as \(, \), \\.InvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketDuplicateNameException
- If the String argument contains a duplicate name.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersTreeMapFromNonEscaped(java.lang.String s) throws NoClosingBracketException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketDuplicateNameException
- If the String argument contains a duplicate name.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersTreeMapWithMandatoryValuesFromEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException
s
- A string in the general format name1(value1)name2(value2)... The 'value' parts are in escaped format, i.e. ()\ tokens that are part of the value, should be contained as \(, \), \\.DuplicateNameException
- If the String argument contains a duplicate name.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.public static java.util.Map<NameIdentifier,java.lang.String> createIdentifiersTreeMapWithMandatoryValuesFromNonEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, NoValueCorrespondingToNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .DuplicateNameException
- If the String argument contains a duplicate name.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.public static void fillIdentifiersMapFromNonEscaped(java.lang.String s, java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) throws NoClosingBracketException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .attributeValueMap
- The map to be filled. May or may not be empty. If non-empty at the moment of invocation, entries from the String argument will be added to the Map, in addition to those that were already present.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketDuplicateNameException
- If the String argument contains a duplicate name, or contains a name for which the given map already holds an entry.public static void fillIdentifiersMapWithMandatoryValuesFromEscaped(java.lang.String s, java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .attributeValueMap
- The map to be filled. May or may not be empty. If non-empty at the moment of invocation, entries from the String argument will be added to the Map, in addition to those that were already present.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.DuplicateNameException
- If the String argument contains a duplicate name, or contains a name for which the given map already holds an entry.public static void fillIdentifiersMapWithMandatoryValuesFromNonEscaped(java.lang.String s, java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) throws NoClosingBracketException, NoValueCorrespondingToNameException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... Values cannot hold any tokens of the meta language, i.e. one of ()\ .attributeValueMap
- The map to be filled. May or may not be empty. If non-empty at the moment of invocation, entries from the String argument will be added to the Map, in addition to those that were already present.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketNoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.DuplicateNameException
- If the String argument contains a duplicate name, or contains a name for which the given map already holds an entry.public static void fillNonEmptyIdentifiersMapWithMandatoryValuesFromEscaped(java.lang.String s, java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException, DuplicateNameException
s
- The string to parseattributeValueMap
- The map to fillDuplicateNameException
- If the String argument contains a duplicate name, or contains a name for which the given map already holds an entry.NoValueCorrespondingToNameException
- If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketpublic static void fillIdentifiersMapFromEscaped(java.lang.String s, java.util.Map<NameIdentifier,java.lang.String> attributeValueMap) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)... The 'value' parts are in escaped format, i.e. ()\ tokens that are part of the value, should be contained as \(, \), \\.attributeValueMap
- The map to be filled. May or may not be empty. If non-empty at the moment of invocation, entries from the String argument will be added to the Map, in addition to those that were already present.NoClosingBracketException
- If an opening bracket was found with an unmatched closing bracketInvalidEscapedCharacterException
- If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException
- If the string argument ends with the escape token (backslash), with the subsequent escaped character missingDuplicateNameException
- If the String argument contains a duplicate name, or contains a name for which the given map already holds an entry.