|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.SIRAPRISE.util.BracketParser
public class BracketParser
Provides methods for working with bracketed expressions.
Constructor Summary | |
---|---|
BracketParser()
|
Method Summary | |
---|---|
static java.util.LinkedList<java.lang.String> |
createListFromEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static java.util.LinkedList<java.lang.String> |
createListFromNonEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static java.util.HashMap<java.lang.String,java.lang.String> |
createMapFromEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static java.util.Map<java.lang.String,java.lang.String> |
createMapFromEscapedString(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.HashMap<java.lang.String,java.lang.String> |
createMapFromNonEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static java.util.HashMap<java.lang.String,java.lang.String> |
createMapWithMandatoryValuesFromEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static java.util.HashMap<java.lang.String,java.lang.String> |
createMapWithMandatoryValuesFromNonEscaped(java.lang.String s)
Creates a HashMap for a String in the general format Name1(value1)Name2(value2)... |
static void |
fillMapWithMandatoryValuesFromEscaped(java.lang.String s,
java.util.Map<java.lang.String,java.lang.String> attributeValueMap)
|
static void |
fillMapWithMandatoryValuesFromNonEscaped(java.lang.String s,
java.util.Map<java.lang.String,java.lang.String> attributeValueMap)
|
static void |
fillNonEmptyMapWithMandatoryValuesFromEscaped(java.lang.String s,
java.util.Map<java.lang.String,java.lang.String> attributeValueMap)
|
static void |
fillNonEmptyMapWithMandatoryValuesFromNonEscaped(java.lang.String s,
java.util.Map<java.lang.String,java.lang.String> attributeValueMap)
|
static int |
findCorrespondingClosingBracket(java.lang.String s)
Find the position of the closing bracket that matches the opening bracket in position 0. |
static NameValueResult |
getNameAndMandatoryValueFromEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static NameValueResult |
getNameAndMandatoryValueFromNonEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static NameValueResult |
getNameAndMandatoryValueUntrimmedFromEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static BracketParseResult |
getNameBeforeBracket(java.lang.String s)
Deprecated. |
static NameValueResult |
getNameValueFromEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static NameValueResult |
getNameValueFromNonEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static NameValueResult |
getNameValueUntrimmedFromEscaped(java.lang.String s,
int startPos)
Returns the 'name' part of an expression of the form "name(content)" |
static BracketParseResult |
getUnMetaContentsWithinBrackets(java.lang.String s)
Deprecated. |
static BracketParseResult |
getUnMetaContentsWithinBracketsUntrimmed(java.lang.String s)
Deprecated. |
static java.lang.String |
meta(java.lang.String s)
Adapts a given string for representation of the siraprise metalanguage characters ()\ |
static java.lang.String |
removeSuperfluousOuterBrackets(java.lang.String arg)
Removes superfluous outer brackets from arg. e.g. |
static java.lang.String |
unMeta(java.lang.String s)
Translates strings in sira_prise meta language to their actual value. |
static java.lang.String |
unMetaWithoutException(java.lang.String s)
Translates strings in sira_prise meta language to their actual value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BracketParser()
Method Detail |
---|
public static java.util.LinkedList<java.lang.String> createListFromEscaped(java.lang.String s) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException
s
- A string in the general format name1(value1)name2(value2)...
MissingEscapedCharacterException
NoOpeningBracketException
InvalidEscapedCharacterException
NoClosingBracketException
public static java.util.LinkedList<java.lang.String> createListFromNonEscaped(java.lang.String s) throws NoClosingBracketException, NoOpeningBracketException
s
- A string in the general format name1(value1)name2(value2)...
NoOpeningBracketException
NoClosingBracketException
public static java.util.HashMap<java.lang.String,java.lang.String> createMapFromEscaped(java.lang.String s) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)...
InvalidEscapedCharacterException
MissingEscapedCharacterException
NoClosingBracketException
DuplicateNameException
public static java.util.HashMap<java.lang.String,java.lang.String> createMapFromNonEscaped(java.lang.String s) throws NoClosingBracketException, DuplicateNameException
s
- A string in the general format name1(value1)name2(value2)...
NoClosingBracketException
DuplicateNameException
public static java.util.HashMap<java.lang.String,java.lang.String> createMapWithMandatoryValuesFromEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException
s
- A string in the general format name1(value1)name2(value2)...
DuplicateNameException
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
NoOpeningBracketException
public static java.util.HashMap<java.lang.String,java.lang.String> createMapWithMandatoryValuesFromNonEscaped(java.lang.String s) throws DuplicateNameException, NoClosingBracketException, NoOpeningBracketException
s
- A string in the general format name1(value1)name2(value2)...
DuplicateNameException
NoClosingBracketException
NoOpeningBracketException
public static void fillMapWithMandatoryValuesFromEscaped(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> attributeValueMap) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException, DuplicateNameException
s
- attributeValueMap
-
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
NoOpeningBracketException
DuplicateNameException
public static void fillMapWithMandatoryValuesFromNonEscaped(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> attributeValueMap) throws NoClosingBracketException, NoOpeningBracketException, DuplicateNameException
s
- attributeValueMap
-
NoClosingBracketException
NoOpeningBracketException
DuplicateNameException
public static void fillNonEmptyMapWithMandatoryValuesFromEscaped(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> attributeValueMap) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException, DuplicateNameException
s
- attributeValueMap
-
DuplicateNameException
NoOpeningBracketException
MissingEscapedCharacterException
InvalidEscapedCharacterException
NoClosingBracketException
public static void fillNonEmptyMapWithMandatoryValuesFromNonEscaped(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> attributeValueMap) throws NoClosingBracketException, NoOpeningBracketException, DuplicateNameException
s
- attributeValueMap
-
DuplicateNameException
NoOpeningBracketException
NoClosingBracketException
public static int findCorrespondingClosingBracket(java.lang.String s) throws NoClosingBracketException
s
- A String holding a bracketed expression that begins with an opening bracket
NoClosingBracketException
public static NameValueResult getNameAndMandatoryValueFromEscaped(java.lang.String s, int startPos) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
NoOpeningBracketException
public static NameValueResult getNameAndMandatoryValueFromNonEscaped(java.lang.String s, int startPos) throws NoClosingBracketException, NoOpeningBracketException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
NoOpeningBracketException
public static NameValueResult getNameAndMandatoryValueUntrimmedFromEscaped(java.lang.String s, int startPos) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
NoOpeningBracketException
public static BracketParseResult getNameBeforeBracket(java.lang.String s) throws NoOpeningBracketException
s
- a string of the general form name(content)
NoOpeningBracketException
public static NameValueResult getNameValueFromEscaped(java.lang.String s, int startPos) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
public static NameValueResult getNameValueFromNonEscaped(java.lang.String s, int startPos) throws NoClosingBracketException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
public static NameValueResult getNameValueUntrimmedFromEscaped(java.lang.String s, int startPos) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException
s
- a string of the general form name(content)startPos
- The first position in s to inspect for the name, in the range [0...length-1]
NoClosingBracketException
InvalidEscapedCharacterException
MissingEscapedCharacterException
public static BracketParseResult getUnMetaContentsWithinBrackets(java.lang.String s) throws NoOpeningBracketException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException
s
- the input string
NoOpeningBracketException
NoClosingBracketException
MissingEscapedCharacterException
InvalidEscapedCharacterException
public static BracketParseResult getUnMetaContentsWithinBracketsUntrimmed(java.lang.String s) throws NoOpeningBracketException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException
s
- the input string
NoOpeningBracketException
NoClosingBracketException
MissingEscapedCharacterException
InvalidEscapedCharacterException
public static java.lang.String meta(java.lang.String s)
s
- The string to be adapted for representation of the siraprise metalanguage characters ()\
public static java.lang.String removeSuperfluousOuterBrackets(java.lang.String arg)
arg
- The argument from which superfluous outer brackets are to be removed
public static java.lang.String unMeta(java.lang.String s) throws InvalidEscapedCharacterException, MissingEscapedCharacterException
s
- The string to be un-meta-ified
InvalidEscapedCharacterException
MissingEscapedCharacterException
public static java.lang.String unMetaWithoutException(java.lang.String s)
s
- The string to be un-meta-ified
public static java.util.Map<java.lang.String,java.lang.String> createMapFromEscapedString(java.lang.String s, boolean emptyMapAllowed) throws NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoOpeningBracketException, DuplicateNameException
s
- The textual representation of a bracketed expressionemptyMapAllowed
- true if the result is not expected to contain at least one entry
DuplicateNameException
NoOpeningBracketException
MissingEscapedCharacterException
InvalidEscapedCharacterException
NoClosingBracketException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |